Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / chain / wrapperCommit.js
1 var LodashWrapper = require('../internal/LodashWrapper');
2
3 /**
4  * Executes the chained sequence and returns the wrapped result.
5  *
6  * @name commit
7  * @memberOf _
8  * @category Chain
9  * @returns {Object} Returns the new `lodash` wrapper instance.
10  * @example
11  *
12  * var array = [1, 2];
13  * var wrapped = _(array).push(3);
14  *
15  * console.log(array);
16  * // => [1, 2]
17  *
18  * wrapped = wrapped.commit();
19  * console.log(array);
20  * // => [1, 2, 3]
21  *
22  * wrapped.last();
23  * // => 3
24  *
25  * console.log(array);
26  * // => [1, 2, 3]
27  */
28 function wrapperCommit() {
29   return new LodashWrapper(this.value(), this.__chain__);
30 }
31
32 module.exports = wrapperCommit;