Simplify _.chain

This commit is contained in:
Benjamin Tan
2014-03-25 11:30:06 +08:00
parent ce01d696a0
commit 1bdf74951a

View File

@@ -784,7 +784,7 @@
*
* @private
* @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.
*/
function lodashWrapper(value, chainAll) {
@@ -3446,9 +3446,7 @@
* // => 'pebbles is 1'
*/
function chain(value) {
value = new lodashWrapper(value);
value.__chain__ = true;
return value;
return new lodashWrapper(value, true);
}
/**