MCPcopy Index your code
hub / github.com/nodejs/node / _unsupportedIterableToArray

Function _unsupportedIterableToArray

test/fixtures/snapshot/marked.js:34–41  ·  view source on GitHub ↗
(o, minLen)

Source from the content-addressed store, hash-verified

32 }
33
34 function _unsupportedIterableToArray(o, minLen) {
35 if (!o) return;
36 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
37 var n = Object.prototype.toString.call(o).slice(8, -1);
38 if (n === "Object" && o.constructor) n = o.constructor.name;
39 if (n === "Map" || n === "Set") return Array.from(o);
40 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
41 }
42
43 function _arrayLikeToArray(arr, len) {
44 if (len == null || len > arr.length) len = arr.length;

Callers 1

Calls 5

_arrayLikeToArrayFunction · 0.85
sliceMethod · 0.65
callMethod · 0.45
fromMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected