Urara-Blog/node_modules/.pnpm-store/v3/files/e5/9e816d5b9fce328d55ea36d168385c9c98ad2b73c126adbe9938f46d91e0f4e2dab320e0798981c8753a9fab0a95d1da5a4054ad35a700014a459f35d5ecb0
2022-08-14 01:14:53 +08:00

35 lines
836 B
Text

var toArray = require('./toArray');
/**
* Gets the next value on a wrapped object following the
* [iterator protocol](https://mdn.io/iteration_protocols#iterator).
*
* @name next
* @memberOf _
* @since 4.0.0
* @category Seq
* @returns {Object} Returns the next iterator value.
* @example
*
* var wrapped = _([1, 2]);
*
* wrapped.next();
* // => { 'done': false, 'value': 1 }
*
* wrapped.next();
* // => { 'done': false, 'value': 2 }
*
* wrapped.next();
* // => { 'done': true, 'value': undefined }
*/
function wrapperNext() {
if (this.__values__ === undefined) {
this.__values__ = toArray(this.value());
}
var done = this.__index__ >= this.__values__.length,
value = done ? undefined : this.__values__[this.__index__++];
return { 'done': done, 'value': value };
}
module.exports = wrapperNext;