diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/lodash/fp | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/lodash/fp')
-rw-r--r-- | node_modules/lodash/fp/_baseConvert.js | 33 | ||||
-rw-r--r-- | node_modules/lodash/fp/_mapping.js | 10 | ||||
-rw-r--r-- | node_modules/lodash/fp/_util.js | 2 |
3 files changed, 19 insertions, 26 deletions
diff --git a/node_modules/lodash/fp/_baseConvert.js b/node_modules/lodash/fp/_baseConvert.js index 7af27655b..9baf8e190 100644 --- a/node_modules/lodash/fp/_baseConvert.js +++ b/node_modules/lodash/fp/_baseConvert.js @@ -136,8 +136,7 @@ function wrapImmutable(func, cloner) { * @returns {Function|Object} Returns the converted function or object. */ function baseConvert(util, name, func, options) { - var setPlaceholder, - isLib = typeof name == 'function', + var isLib = typeof name == 'function', isObj = name === Object(name); if (isObj) { @@ -158,10 +157,10 @@ function baseConvert(util, name, func, options) { 'rearg': 'rearg' in options ? options.rearg : true }; - var forceCurry = ('curry' in options) && options.curry, + var defaultHolder = isLib ? func : fallbackHolder, + forceCurry = ('curry' in options) && options.curry, forceFixed = ('fixed' in options) && options.fixed, forceRearg = ('rearg' in options) && options.rearg, - placeholder = isLib ? func : fallbackHolder, pristine = isLib ? func.runInContext() : undefined; var helpers = isLib ? func : { @@ -171,7 +170,9 @@ function baseConvert(util, name, func, options) { 'curry': util.curry, 'forEach': util.forEach, 'isArray': util.isArray, + 'isError': util.isError, 'isFunction': util.isFunction, + 'isWeakMap': util.isWeakMap, 'iteratee': util.iteratee, 'keys': util.keys, 'rearg': util.rearg, @@ -185,7 +186,9 @@ function baseConvert(util, name, func, options) { curry = helpers.curry, each = helpers.forEach, isArray = helpers.isArray, + isError = helpers.isError, isFunction = helpers.isFunction, + isWeakMap = helpers.isWeakMap, keys = helpers.keys, rearg = helpers.rearg, toInteger = helpers.toInteger, @@ -355,8 +358,9 @@ function baseConvert(util, name, func, options) { var key = path[index], value = nested[key]; - if (value != null) { - nested[path[index]] = clone(index == lastIndex ? value : Object(value)); + if (value != null && + !(isFunction(value) || isError(value) || isWeakMap(value))) { + nested[key] = clone(index == lastIndex ? value : Object(value)); } nested = nested[key]; } @@ -461,7 +465,7 @@ function baseConvert(util, name, func, options) { * @param {Function} func The function to wrap. * @returns {Function} Returns the converted function. */ - function wrap(name, func) { + function wrap(name, func, placeholder) { var result, realName = mapping.aliasToReal[name] || name, wrapped = func, @@ -506,17 +510,15 @@ function baseConvert(util, name, func, options) { }; } result.convert = createConverter(realName, func); - if (mapping.placeholder[realName]) { - setPlaceholder = true; - result.placeholder = func.placeholder = placeholder; - } + result.placeholder = func.placeholder = placeholder; + return result; } /*--------------------------------------------------------------------------*/ if (!isObj) { - return wrap(name, func); + return wrap(name, func, defaultHolder); } var _ = func; @@ -526,7 +528,7 @@ function baseConvert(util, name, func, options) { each(mapping.aryMethod[aryKey], function(key) { var func = _[mapping.remap[key] || key]; if (func) { - pairs.push([key, wrap(key, func)]); + pairs.push([key, wrap(key, func, _)]); } }); }); @@ -552,9 +554,8 @@ function baseConvert(util, name, func, options) { }); _.convert = convertLib; - if (setPlaceholder) { - _.placeholder = placeholder; - } + _.placeholder = _; + // Assign aliases. each(keys(_), function(key) { each(mapping.realToAlias[key] || [], function(alias) { diff --git a/node_modules/lodash/fp/_mapping.js b/node_modules/lodash/fp/_mapping.js index 8f5ddf2d0..a642ec058 100644 --- a/node_modules/lodash/fp/_mapping.js +++ b/node_modules/lodash/fp/_mapping.js @@ -261,16 +261,6 @@ exports.mutate = { } }; -/** Used to track methods with placeholder support */ -exports.placeholder = { - 'bind': true, - 'bindKey': true, - 'curry': true, - 'curryRight': true, - 'partial': true, - 'partialRight': true -}; - /** Used to map real names to their aliases. */ exports.realToAlias = (function() { var hasOwnProperty = Object.prototype.hasOwnProperty, diff --git a/node_modules/lodash/fp/_util.js b/node_modules/lodash/fp/_util.js index 708446302..1dbf36f5d 100644 --- a/node_modules/lodash/fp/_util.js +++ b/node_modules/lodash/fp/_util.js @@ -5,7 +5,9 @@ module.exports = { 'curry': require('../curry'), 'forEach': require('../_arrayEach'), 'isArray': require('../isArray'), + 'isError': require('../isError'), 'isFunction': require('../isFunction'), + 'isWeakMap': require('../isWeakMap'), 'iteratee': require('../iteratee'), 'keys': require('../_baseKeys'), 'rearg': require('../rearg'), |