Use Array.from in toIterable

This commit is contained in:
toasted-nutbread 2020-02-13 20:28:59 -05:00
parent 75fbb1565c
commit db1da33321

View File

@ -113,11 +113,7 @@ function toIterable(value) {
if (value !== null && typeof value === 'object') {
const length = value.length;
if (typeof length === 'number' && Number.isFinite(length)) {
const array = [];
for (let i = 0; i < length; ++i) {
array.push(value[i]);
}
return array;
return Array.from(value);
}
}