iterableToArrayLimit.js 574 B

1234567891011121314151617181920212223242526272829
  1. var _getIterator = require("../core-js/get-iterator");
  2. function _iterableToArrayLimit(arr, i) {
  3. var _arr = [];
  4. var _n = true;
  5. var _d = false;
  6. var _e = undefined;
  7. try {
  8. for (var _i = _getIterator(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {
  9. _arr.push(_s.value);
  10. if (i && _arr.length === i) break;
  11. }
  12. } catch (err) {
  13. _d = true;
  14. _e = err;
  15. } finally {
  16. try {
  17. if (!_n && _i["return"] != null) _i["return"]();
  18. } finally {
  19. if (_d) throw _e;
  20. }
  21. }
  22. return _arr;
  23. }
  24. module.exports = _iterableToArrayLimit;