IteratorStep.js 353 B

12345678910111213
  1. 'use strict';
  2. var IteratorComplete = require('./IteratorComplete');
  3. var IteratorNext = require('./IteratorNext');
  4. // https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep
  5. module.exports = function IteratorStep(iterator) {
  6. var result = IteratorNext(iterator);
  7. var done = IteratorComplete(result);
  8. return done === true ? false : result;
  9. };