mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-28 19:31:03 -05:00
Fixed getOwnEntries
for arrays
This commit is contained in:
parent
0ebd21131f
commit
dfd4e9ac5b
1 changed files with 5 additions and 1 deletions
|
@ -173,7 +173,7 @@ export function getOwnEntries<K, V>(obj: KeyValueIterable<K, V> | Iterable<reado
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isKeyValueIterable(obj)) {
|
if (!Array.isArray(obj) && isKeyValueIterable(obj)) {
|
||||||
return obj.entries();
|
return obj.entries();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,6 +184,10 @@ export function getOwnEntries<K, V>(obj: KeyValueIterable<K, V> | Iterable<reado
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(obj)) {
|
||||||
|
return obj.entries() as Iterable<[K, V]>;
|
||||||
|
}
|
||||||
|
|
||||||
return Object.entries(obj) as Iterable<[K, V]>;
|
return Object.entries(obj) as Iterable<[K, V]>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue