mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Simplify _.chain
This commit is contained in:
@@ -784,7 +784,7 @@
|
|||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {*} value The value to wrap in a `lodash` instance.
|
* @param {*} value The value to wrap in a `lodash` instance.
|
||||||
* @param {boolean} [chainAll=false] A flag to enable chaining for all methods
|
* @param {boolean} [chainAll=false] A flag to enable chaining for all methods.
|
||||||
* @returns {Object} Returns a `lodash` instance.
|
* @returns {Object} Returns a `lodash` instance.
|
||||||
*/
|
*/
|
||||||
function lodashWrapper(value, chainAll) {
|
function lodashWrapper(value, chainAll) {
|
||||||
@@ -3446,9 +3446,7 @@
|
|||||||
* // => 'pebbles is 1'
|
* // => 'pebbles is 1'
|
||||||
*/
|
*/
|
||||||
function chain(value) {
|
function chain(value) {
|
||||||
value = new lodashWrapper(value);
|
return new lodashWrapper(value, true);
|
||||||
value.__chain__ = true;
|
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user