UNPKG

iter-tools-es

Version:
24 lines (20 loc) 447 B
const { iterableCurry } = require('../../internal/iterable.js'); function* __dropWhile(source, predicate) { let drop = true; let c = 0; for (const value of source) { if (!drop) { yield value; } else { drop = predicate(value, c++); if (!drop) { yield value; } } } } exports.__dropWhile = __dropWhile; const dropWhile = /*#__PURE__*/iterableCurry(__dropWhile); exports.dropWhile = dropWhile;