mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 18:07:49 +00:00
Bump to v4.0.0.
This commit is contained in:
38
next.js
Normal file
38
next.js
Normal file
@@ -0,0 +1,38 @@
|
||||
define(['./toArray'], function(toArray) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
|
||||
/**
|
||||
* Gets the next value on a wrapped object following the
|
||||
* [iterator protocol](https://mdn.io/iteration_protocols#iterator).
|
||||
*
|
||||
* @name next
|
||||
* @memberOf _
|
||||
* @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 };
|
||||
}
|
||||
|
||||
return wrapperNext;
|
||||
});
|
||||
Reference in New Issue
Block a user