MCPcopy Create free account
hub / github.com/WebReflection/neverland / _unsupportedIterableToArray

Function _unsupportedIterableToArray

index.js:18–25  ·  view source on GitHub ↗
(o, minLen)

Source from the content-addressed store, hash-verified

16 }
17
18 function _unsupportedIterableToArray(o, minLen) {
19 if (!o) return;
20 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
21 var n = Object.prototype.toString.call(o).slice(8, -1);
22 if (n === "Object" && o.constructor) n = o.constructor.name;
23 if (n === "Map" || n === "Set") return Array.from(o);
24 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
25 }
26
27 function _arrayLikeToArray(arr, len) {
28 if (len == null || len > arr.length) len = arr.length;

Callers 1

_toConsumableArrayFunction · 0.85

Calls 1

_arrayLikeToArrayFunction · 0.85

Tested by

no test coverage detected