iterationDecorator.js 895 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(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  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. }