iterableToArrayLimit.js 607 B

1234567891011121314151617181920212223242526272829
  1. export default function _iterableToArrayLimit(arr, i) {
  2. var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
  3. if (_i == null) return;
  4. var _arr = [];
  5. var _n = true;
  6. var _d = false;
  7. var _s, _e;
  8. try {
  9. for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
  10. _arr.push(_s.value);
  11. if (i && _arr.length === i) break;
  12. }
  13. } catch (err) {
  14. _d = true;
  15. _e = err;
  16. } finally {
  17. try {
  18. if (!_n && _i["return"] != null) _i["return"]();
  19. } finally {
  20. if (_d) throw _e;
  21. }
  22. }
  23. return _arr;
  24. }