Use Array.from in toIterable
This commit is contained in:
parent
75fbb1565c
commit
db1da33321
@ -113,11 +113,7 @@ function toIterable(value) {
|
|||||||
if (value !== null && typeof value === 'object') {
|
if (value !== null && typeof value === 'object') {
|
||||||
const length = value.length;
|
const length = value.length;
|
||||||
if (typeof length === 'number' && Number.isFinite(length)) {
|
if (typeof length === 'number' && Number.isFinite(length)) {
|
||||||
const array = [];
|
return Array.from(value);
|
||||||
for (let i = 0; i < length; ++i) {
|
|
||||||
array.push(value[i]);
|
|
||||||
}
|
|
||||||
return array;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user