Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

esnext.iterator.map.js 847B

1234567891011121314151617181920212223
  1. 'use strict';
  2. // https://github.com/tc39/proposal-iterator-helpers
  3. var $ = require('../internals/export');
  4. var aFunction = require('../internals/a-function');
  5. var anObject = require('../internals/an-object');
  6. var createIteratorProxy = require('../internals/iterator-create-proxy');
  7. var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');
  8. var IteratorProxy = createIteratorProxy(function (arg) {
  9. var iterator = this.iterator;
  10. var result = anObject(this.next.call(iterator, arg));
  11. var done = this.done = !!result.done;
  12. if (!done) return callWithSafeIterationClosing(iterator, this.mapper, result.value);
  13. });
  14. $({ target: 'Iterator', proto: true, real: true }, {
  15. map: function map(mapper) {
  16. return new IteratorProxy({
  17. iterator: anObject(this),
  18. mapper: aFunction(mapper)
  19. });
  20. }
  21. });