0
0
mirror of https://github.com/Doodle3D/Doodle3D-API synced 2024-12-23 14:13:47 +01:00
Doodle3D-API/jspm_packages/npm/babel-runtime@5.6.20/helpers/sliced-to-array-loose.js
2015-07-15 15:06:18 +02:00

22 lines
620 B
JavaScript

/* */
"use strict";
var _isIterable = require("../core-js/is-iterable")["default"];
var _getIterator = require("../core-js/get-iterator")["default"];
exports["default"] = function(arr, i) {
if (Array.isArray(arr)) {
return arr;
} else if (_isIterable(Object(arr))) {
var _arr = [];
for (var _iterator = _getIterator(arr),
_step; !(_step = _iterator.next()).done; ) {
_arr.push(_step.value);
if (i && _arr.length === i)
break;
}
return _arr;
} else {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
};
exports.__esModule = true;