source:
node_modules/d3-shape/src/array.js@
e4c61dd
| Last change on this file since e4c61dd was e4c61dd, checked in by , 6 months ago | |
|---|---|
|
|
| File size: 242 bytes | |
| Rev | Line | |
|---|---|---|
| [e4c61dd] | 1 | export var slice = Array.prototype.slice; |
| 2 | ||
| 3 | export default function(x) { | |
| 4 | return typeof x === "object" && "length" in x | |
| 5 | ? x // Array, TypedArray, NodeList, array-like | |
| 6 | : Array.from(x); // Map, Set, iterable, string, or anything else | |
| 7 | } |
Note:
See TracBrowser
for help on using the repository browser.
