iterationDecorator.js 867 B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = iterationDecorator;
  6. var _iteratorProxy = _interopRequireDefault(require("./iteratorProxy"));
  7. function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
  8. function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
  9. function iterationDecorator(collection, entries) {
  10. if (typeof Symbol === 'function' && _typeof(Symbol.iterator) === 'symbol') {
  11. Object.defineProperty(collection, Symbol.iterator, {
  12. value: _iteratorProxy.default.bind(entries)
  13. });
  14. }
  15. return collection;
  16. }