site/node_modules/d3-shape/src/array.js
2024-10-14 08:09:33 +02:00

7 lines
242 B
JavaScript

export var slice = Array.prototype.slice;
export default function(x) {
return typeof x === "object" && "length" in x
? x // Array, TypedArray, NodeList, array-like
: Array.from(x); // Map, Set, iterable, string, or anything else
}