mirror of
https://github.com/swc-project/swc.git
synced 2024-12-18 19:21:33 +03:00
12 lines
505 B
JavaScript
12 lines
505 B
JavaScript
|
import _arrayLikeToArray from './_array_like_to_array';
|
||
|
|
||
|
export default function _unsupportedIterableToArray(o, minLen) {
|
||
|
if (!o) return;
|
||
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
||
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
||
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
||
|
if (n === "Map" || n === "Set") return Array.from(n);
|
||
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
||
|
return _arrayLikeToArray(o, minLen);
|
||
|
}
|