Closed JoacoEsteban closed 1 week 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.
a
if (a.slice) {
(a as any[]).map(...)
a.map
Array.isArray(a)
If
a
is of type string it will match theif (a.slice) {
condition and fail on the(a as any[]).map(...)
call as string lacksa.map
method. The fix usesArray.isArray(a)
to prevent such case or any others.