tkrajina / typescriptify-golang-structs

A Golang struct to TypeScript class/interface converter
Apache License 2.0
505 stars 87 forks source link

Change array check to use `Array.isArray(a)` #77

Closed JoacoEsteban closed 1 week ago

JoacoEsteban commented 3 months ago

If a is of type string it will match the if (a.slice) { condition and fail on the (a as any[]).map(...) call as string lacks a.map method. The fix uses Array.isArray(a) to prevent such case or any others.