Permalink
Cannot retrieve contributors at this time
35 lines (32 sloc)
836 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/lodash/next.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |