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.as-indexed-pairs.js 637B

1234567891011121314151617181920
  1. 'use strict';
  2. // https://github.com/tc39/proposal-iterator-helpers
  3. var $ = require('../internals/export');
  4. var anObject = require('../internals/an-object');
  5. var createIteratorProxy = require('../internals/iterator-create-proxy');
  6. var IteratorProxy = createIteratorProxy(function (arg) {
  7. var result = anObject(this.next.call(this.iterator, arg));
  8. var done = this.done = !!result.done;
  9. if (!done) return [this.index++, result.value];
  10. });
  11. $({ target: 'Iterator', proto: true, real: true }, {
  12. asIndexedPairs: function asIndexedPairs() {
  13. return new IteratorProxy({
  14. iterator: anObject(this),
  15. index: 0
  16. });
  17. }
  18. });