summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperCommit.js
blob: c46a787e97d0e785960449fc8e274f2814b0aee8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var LodashWrapper = require('../internal/LodashWrapper');

/**
 * Executes the chained sequence and returns the wrapped result.
 *
 * @name commit
 * @memberOf _
 * @category Chain
 * @returns {Object} Returns the new `lodash` wrapper instance.
 * @example
 *
 * var array = [1, 2];
 * var wrapper = _(array).push(3);
 *
 * console.log(array);
 * // => [1, 2]
 *
 * wrapper = wrapper.commit();
 * console.log(array);
 * // => [1, 2, 3]
 *
 * wrapper.last();
 * // => 3
 *
 * console.log(array);
 * // => [1, 2, 3]
 */
function wrapperCommit() {
  return new LodashWrapper(this.value(), this.__chain__);
}

module.exports = wrapperCommit;