From 9477e46fb3a5fe3b5f6cb1a3ffd14575120c7b70 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 12 Jan 2016 18:17:27 -0800 Subject: [PATCH 01/90] Fix typos in `lodash` doc note. [ci skip] --- lodash.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index e20df38848..2de0200292 100644 --- a/lodash.js +++ b/lodash.js @@ -1405,8 +1405,8 @@ * `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, * `result`, `round`, `runInContext`, `sample`, `shift`, `size`, `snakeCase`, * `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, - * `startCase`, `startsWith`, `subtract`, `sum`, sumBy`, `template`, `times`, - * `toLower`, `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, toString`, + * `startCase`, `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, + * `toLower`, `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, * `upperCase`, `upperFirst`, `value`, and `words` * From a5c3ae0a7ef837206117d9d387069e9866618509 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 12 Jan 2016 18:18:06 -0800 Subject: [PATCH 02/90] Remove `run` from jsdoc alias tag. [ci skip] --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 2de0200292..8df2e00035 100644 --- a/lodash.js +++ b/lodash.js @@ -7262,7 +7262,7 @@ * * @name value * @memberOf _ - * @alias run, toJSON, valueOf + * @alias toJSON, valueOf * @category Seq * @returns {*} Returns the resolved unwrapped value. * @example From afb7d3e351f955dd0b46f8b3c3faebf409d52d44 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 12 Jan 2016 18:19:21 -0800 Subject: [PATCH 03/90] Add `split` to fp map. [closes #1752] --- lib/fp/mapping.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index 4c76e4289a..18745633a6 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -86,7 +86,7 @@ module.exports = { 'matchesProperty,maxBy,mean,minBy,merge,omit,orderBy,overArgs,pad,padLeft,' + 'padRight,parseInt,partition,pick,pull,pullAll,pullAt,random,range,rangeRight,' + 'rearg,reject,remove,repeat,result,sampleSize,some,sortBy,sortedIndexBy,' + - 'sortedLastIndexBy,sortedUniqBy,startsWith,subtract,sumBy,take,takeRight,' + + 'sortedLastIndexBy,sortedUniqBy,split,startsWith,subtract,sumBy,take,takeRight,' + 'takeRightWhile,takeWhile,throttle,times,truncate,union,uniqBy,without,wrap,' + 'xor,zip,zipObject').split(','), 3: ( From 027c5727589b3e6aff9f321c71623a8f5e4a60ce Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 12 Jan 2016 18:26:00 -0800 Subject: [PATCH 04/90] Add `replace` to fp map. --- lib/fp/mapping.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index 18745633a6..4ad62a1410 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -92,7 +92,7 @@ module.exports = { 3: ( 'assignWith,clamp,differenceBy,extendWith,getOr,inRange,intersectionBy,' + 'isEqualWith,isMatchWith,mergeWith,omitBy,pickBy,pullAllBy,reduce,' + - 'reduceRight,set,slice,transform,unionBy,xorBy,zipWith').split(','), + 'reduceRight,replace,set,slice,transform,unionBy,xorBy,zipWith').split(','), 4: ['fill', 'setWith'] }, From 753a32bed76aff4182e66e0c2babc6c6907f54bc Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 12 Jan 2016 20:00:56 -0800 Subject: [PATCH 05/90] Remove legacy doc note from `_.range`. [closes #1753] [ci skip] --- lodash.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index 8df2e00035..106f359bf4 100644 --- a/lodash.js +++ b/lodash.js @@ -13368,8 +13368,7 @@ * Creates an array of numbers (positive and/or negative) progressing from * `start` up to, but not including, `end`. A step of `-1` is used if a negative * `start` is specified without an `end` or `step`. If `end` is not specified - * it's set to `start` with `start` then set to `0`. If `end` is less than - * `start` a zero-length range is created unless a negative `step` is specified. + * it's set to `start` with `start` then set to `0`. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. From 0fc6929dd4a3438a866c14b9ffa5af2e66cb3c07 Mon Sep 17 00:00:00 2001 From: greenkeeperio-bot Date: Tue, 12 Jan 2016 15:19:56 -0800 Subject: [PATCH 06/90] Update lodash dev dep. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d9fe1c800b..80a1210b56 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "istanbul": "0.4.2", "jquery": "^2.2.0", "jscs": "^2.8.0", - "lodash": "^3.10.1", + "lodash": "^4.0.0", "platform": "^1.3.1", "qunit-extras": "^1.4.5", "qunitjs": "~1.20.0", From 79c873f3f852c1a6ea45ad9ede7eaf4787e18aeb Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 13 Jan 2016 00:05:11 -0800 Subject: [PATCH 07/90] Update fp map for assignment methods and set methods. [closes #1754] --- lib/fp/mapping.js | 9 ++++++++- test/test-fp.js | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index 4ad62a1410..2ff8e71af5 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -109,7 +109,8 @@ module.exports = { 'clamp': [2, 0, 1], 'reduce': [2, 0, 1], 'reduceRight': [2, 0, 1], - 'setWith': [3, 2, 1, 0], + 'set': [2, 0, 1], + 'setWith': [3, 1, 2, 0], 'slice': [2, 0, 1], 'transform': [2, 0, 1] }, @@ -153,8 +154,14 @@ module.exports = { /** Used to track methods that skip `_.rearg`. */ 'skipReargMap': { + 'assign': true, + 'assignIn': true, + 'defaults': true, + 'defaultsDeep': true, 'difference': true, + 'extend': true, 'matchesProperty': true, + 'merge': true, 'random': true, 'range': true, 'rangeRight': true, diff --git a/test/test-fp.js b/test/test-fp.js index c278622859..e987e8b682 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -743,14 +743,14 @@ assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.assignWith'); value = _.clone(object); - actual = fp.defaults({ 'a': 2, 'b': 2 }, value); + actual = fp.defaults(value, { 'a': 2, 'b': 2 }); assert.deepEqual(value, object, 'fp.defaults'); assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.defaults'); value = _.clone(object); value.b = { 'c': 1 }; - actual = fp.defaultsDeep({ 'b': { 'c': 2, 'd': 2 } }, value); + actual = fp.defaultsDeep(value, { 'b': { 'c': 2, 'd': 2 } }); assert.deepEqual(value, { 'a': 1, 'b': { 'c': 1 } } , 'fp.defaultsDeep'); assert.deepEqual(actual, { 'a': 1, 'b': { 'c': 1, 'd': 2 } }, 'fp.defaultsDeep'); @@ -824,13 +824,13 @@ assert.deepEqual(actual, [3, 2, 1], 'fp.reverse'); value = _.cloneDeep(deepObject); - actual = fp.set(3, 'a.b', value); + actual = fp.set('a.b', 3, value); assert.deepEqual(value, deepObject, 'fp.set'); assert.deepEqual(actual, { 'a': { 'b': 3, 'c': 3 } }, 'fp.set'); value = _.cloneDeep(deepObject); - actual = fp.setWith(Object, 4, 'd.e', value); + actual = fp.setWith(Object, 'd.e', 4, value); assert.deepEqual(value, deepObject, 'fp.setWith'); assert.deepEqual(actual, { 'a': { 'b': 2, 'c': 3 }, 'd': { 'e': 4 } }, 'fp.setWith'); From 73405cf042828f01ef3bf485c5acd87d9e22cb57 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 13 Jan 2016 00:09:29 -0800 Subject: [PATCH 08/90] Update fp `property` alias mapping. [closes #1755] --- lib/fp/mapping.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index 2ff8e71af5..feb27e9046 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -22,7 +22,7 @@ module.exports = { 'overArgs': ['useWith'], 'omit': ['dissoc', 'omitAll'], 'pick': ['pickAll'], - 'property': ['prop'], + 'property': ['get'], 'propertyOf': ['propOf'], 'rest': ['unapply'], 'some': ['all'], From 846e813c9954cb759b55cc797d2d338fd4f63460 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 13 Jan 2016 03:45:15 -0800 Subject: [PATCH 09/90] Ensure `each` and `eachRight` have the correct chain behavior. --- lodash.js | 4 ++-- test/index.html | 2 +- test/test.js | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lodash.js b/lodash.js index 106f359bf4..6b66d7f90f 100644 --- a/lodash.js +++ b/lodash.js @@ -13988,8 +13988,6 @@ lodash.zipWith = zipWith; // Add aliases. - lodash.each = forEach; - lodash.eachRight = forEachRight; lodash.extend = assignIn; lodash.extendWith = assignInWith; @@ -14132,6 +14130,8 @@ lodash.upperFirst = upperFirst; // Add aliases. + lodash.each = forEach; + lodash.eachRight = forEachRight; lodash.first = head; mixin(lodash, (function() { diff --git a/test/index.html b/test/index.html index 00cadc6068..047437f2b4 100644 --- a/test/index.html +++ b/test/index.html @@ -22,7 +22,7 @@ }; } - + diff --git a/test/test.js b/test/test.js index 8a6b59ccaa..b2278a9a5a 100644 --- a/test/test.js +++ b/test/test.js @@ -5748,6 +5748,8 @@ ]; var unwrappedMethods = [ + 'each', + 'eachRight', 'every', 'find', 'findIndex', From 1ef4807a8e1317e529fd9bf6e1ba0414e1c0a196 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 13 Jan 2016 03:56:55 -0800 Subject: [PATCH 10/90] Ensure object are compared unordered. [closes #1758] --- lodash.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lodash.js b/lodash.js index 6b66d7f90f..5a4ef6368d 100644 --- a/lodash.js +++ b/lodash.js @@ -4575,7 +4575,6 @@ */ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { var isPartial = bitmask & PARTIAL_COMPARE_FLAG, - isUnordered = bitmask & UNORDERED_COMPARE_FLAG, objProps = keys(object), objLength = objProps.length, othProps = keys(other), @@ -4587,8 +4586,7 @@ var index = objLength; while (index--) { var key = objProps[index]; - if (!(isPartial ? key in other : baseHas(other, key)) || - !(isUnordered || key == othProps[index])) { + if (!(isPartial ? key in other : baseHas(other, key))) { return false; } } From d0d86aecf869b7b6f96fdd418bda32c451057cf4 Mon Sep 17 00:00:00 2001 From: Abhas Tandon Date: Wed, 13 Jan 2016 18:05:18 +0530 Subject: [PATCH 11/90] Fix _.maxBy/_.minBy doc example. [ci skip] --- lodash.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index 5a4ef6368d..70db9a6840 100644 --- a/lodash.js +++ b/lodash.js @@ -13634,7 +13634,7 @@ * * var objects = [{ 'n': 1 }, { 'n': 2 }]; * - * _.maxBy(objects, function(o) { return o.a; }); + * _.maxBy(objects, function(o) { return o.n; }); * // => { 'n': 2 } * * // using the `_.property` iteratee shorthand @@ -13702,7 +13702,7 @@ * * var objects = [{ 'n': 1 }, { 'n': 2 }]; * - * _.minBy(objects, function(o) { return o.a; }); + * _.minBy(objects, function(o) { return o.n; }); * // => { 'n': 1 } * * // using the `_.property` iteratee shorthand From 1ef22e976d31f9a9ad9c4bd78117093c921e10c4 Mon Sep 17 00:00:00 2001 From: Strider Date: Wed, 13 Jan 2016 15:46:26 +0300 Subject: [PATCH 12/90] Fix _.clone/_.cloneDeep doc typo. [ci skip] --- lodash.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index 70db9a6840..4c9652fc3e 100644 --- a/lodash.js +++ b/lodash.js @@ -9088,7 +9088,7 @@ * } * } * - * var el = _.clone(document.body, customizer); + * var el = _.cloneWith(document.body, customizer); * * console.log(el === document.body); * // => false @@ -9138,7 +9138,7 @@ * } * } * - * var el = _.cloneDeep(document.body, customizer); + * var el = _.cloneDeepWith(document.body, customizer); * * console.log(el === document.body); * // => false From 8b6bd8442e6ba4604dc092f07b8fdc55efaa9571 Mon Sep 17 00:00:00 2001 From: think2011 <452125301@qq.com> Date: Wed, 13 Jan 2016 23:01:56 +0800 Subject: [PATCH 13/90] Fix `_.isMatchWith` doc typo. [ci skip] --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 4c9652fc3e..8debf156ec 100644 --- a/lodash.js +++ b/lodash.js @@ -9716,7 +9716,7 @@ /** * This method is like `_.isMatch` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three + * are handled by the method instead. The `customizer` is invoked with five * arguments: (objValue, srcValue, index|key, object, source). * * @static From 9058c00cfeda7fff16655cc835782782d3c49aca Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 13 Jan 2016 07:49:21 -0800 Subject: [PATCH 14/90] Add `isEqual` to fp mapping. [closes #1764] --- lib/fp/mapping.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index feb27e9046..feadf63e70 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -82,7 +82,7 @@ module.exports = { 'dropRightWhile,dropWhile,endsWith,eq,every,extend,filter,find,find,findIndex,' + 'findKey,findLast,findLastIndex,findLastKey,flatMap,forEach,forEachRight,' + 'forIn,forInRight,forOwn,forOwnRight,get,groupBy,includes,indexBy,indexOf,' + - 'intersection,invoke,invokeMap,isMatch,lastIndexOf,map,mapKeys,mapValues,' + + 'intersection,invoke,invokeMap,isEqual,isMatch,lastIndexOf,map,mapKeys,mapValues,' + 'matchesProperty,maxBy,mean,minBy,merge,omit,orderBy,overArgs,pad,padLeft,' + 'padRight,parseInt,partition,pick,pull,pullAll,pullAt,random,range,rangeRight,' + 'rearg,reject,remove,repeat,result,sampleSize,some,sortBy,sortedIndexBy,' + From f92dc95c5840b4cdc45f0b2f9e379b2cb26aea2d Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 13 Jan 2016 14:44:52 -0800 Subject: [PATCH 15/90] Add fp mapping for `_.gt`, `_.gte`, `_.lt`, and `_.lte`. [closes #1776] --- lib/fp/mapping.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index feadf63e70..03ef0cce66 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -81,14 +81,14 @@ module.exports = { 'curryRightN,debounce,defaults,defaultsDeep,delay,difference,drop,dropRight,' + 'dropRightWhile,dropWhile,endsWith,eq,every,extend,filter,find,find,findIndex,' + 'findKey,findLast,findLastIndex,findLastKey,flatMap,forEach,forEachRight,' + - 'forIn,forInRight,forOwn,forOwnRight,get,groupBy,includes,indexBy,indexOf,' + - 'intersection,invoke,invokeMap,isEqual,isMatch,lastIndexOf,map,mapKeys,mapValues,' + - 'matchesProperty,maxBy,mean,minBy,merge,omit,orderBy,overArgs,pad,padLeft,' + - 'padRight,parseInt,partition,pick,pull,pullAll,pullAt,random,range,rangeRight,' + - 'rearg,reject,remove,repeat,result,sampleSize,some,sortBy,sortedIndexBy,' + - 'sortedLastIndexBy,sortedUniqBy,split,startsWith,subtract,sumBy,take,takeRight,' + - 'takeRightWhile,takeWhile,throttle,times,truncate,union,uniqBy,without,wrap,' + - 'xor,zip,zipObject').split(','), + 'forIn,forInRight,forOwn,forOwnRight,get,groupBy,gt,gte,includes,indexBy,' + + 'indexOf,intersection,invoke,invokeMap,isEqual,isMatch,lastIndexOf,lt,lte,' + + 'map,mapKeys,mapValues,matchesProperty,maxBy,mean,minBy,merge,omit,orderBy,' + + 'overArgs,pad,padLeft,padRight,parseInt,partition,pick,pull,pullAll,pullAt,' + + 'random,range,rangeRight,rearg,reject,remove,repeat,result,sampleSize,some,' + + 'sortBy,sortedIndexBy,sortedLastIndexBy,sortedUniqBy,split,startsWith,subtract,' + + 'sumBy,take,takeRight,takeRightWhile,takeWhile,throttle,times,truncate,union,' + + 'uniqBy,without,wrap,xor,zip,zipObject').split(','), 3: ( 'assignWith,clamp,differenceBy,extendWith,getOr,inRange,intersectionBy,' + 'isEqualWith,isMatchWith,mergeWith,omitBy,pickBy,pullAllBy,reduce,' + From fe3d86bf13a3f136fc26265dce84d738a7aa490c Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 13 Jan 2016 21:20:05 -0800 Subject: [PATCH 16/90] Ensure `_.defaultsDeep` doesn't convert function properties to objects. [closes #1783] --- lodash.js | 4 +++- test/test.js | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 8debf156ec..707ca0bccc 100644 --- a/lodash.js +++ b/lodash.js @@ -5099,7 +5099,9 @@ stack.set(srcValue, objValue); baseMerge(objValue, srcValue, mergeDefaults, stack); } - return objValue === undefined ? baseClone(srcValue) : objValue; + return objValue === undefined + ? baseClone(srcValue, undefined, undefined, key, object) + : objValue; } /** diff --git a/test/test.js b/test/test.js index b2278a9a5a..19e192e0ad 100644 --- a/test/test.js +++ b/test/test.js @@ -3998,6 +3998,16 @@ assert.strictEqual(actual.a.b, null); }); + QUnit.test('should not convert function properties to objects', function(assert) { + assert.expect(2); + + var actual = _.defaultsDeep({}, { 'a': noop }); + assert.strictEqual(actual.a, noop); + + actual = _.defaultsDeep({}, { 'a': { 'b': noop } }); + assert.strictEqual(actual.a.b, noop); + }); + QUnit.test('should overwrite `undefined` values', function(assert) { assert.expect(1); From 06395f84369e7efd6d44024eec4cabcc51d79ace Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 13 Jan 2016 22:01:24 -0800 Subject: [PATCH 17/90] Simplify fp map. --- lib/fp/baseConvert.js | 16 ++++++++-------- lib/fp/mapping.js | 16 ++++++++-------- test/test-fp.js | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/fp/baseConvert.js b/lib/fp/baseConvert.js index f43ee62403..a32684937b 100644 --- a/lib/fp/baseConvert.js +++ b/lib/fp/baseConvert.js @@ -1,5 +1,5 @@ var mapping = require('./mapping.js'), - mutateMap = mapping.mutateMap; + mutateMap = mapping.mutate; /** * The base implementation of `convert` which accepts a `util` object of methods @@ -158,13 +158,13 @@ function baseConvert(util, name, func) { } var result; each(mapping.caps, function(cap) { - each(mapping.aryMethodMap[cap], function(otherName) { + each(mapping.aryMethod[cap], function(otherName) { if (name == otherName) { result = ary(func, cap); - if (cap > 1 && !mapping.skipReargMap[name]) { - result = rearg(result, mapping.methodReargMap[name] || mapping.aryReargMap[cap]); + if (cap > 1 && !mapping.skipRearg[name]) { + result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[cap]); } - var n = !isLib && mapping.aryIterateeMap[name]; + var n = !isLib && mapping.aryIteratee[name]; if (n) { result = iterateeAry(result, n); } @@ -185,8 +185,8 @@ function baseConvert(util, name, func) { // Iterate over methods for the current ary cap. var pairs = []; each(mapping.caps, function(cap) { - each(mapping.aryMethodMap[cap], function(key) { - var func = _[mapping.keyMap[key] || key]; + each(mapping.aryMethod[cap], function(key) { + var func = _[mapping.key[key] || key]; if (func) { pairs.push([key, wrap(key, func)]); } @@ -200,7 +200,7 @@ function baseConvert(util, name, func) { // Wrap the lodash method and its aliases. each(keys(_), function(key) { - each(mapping.aliasMap[key] || [], function(alias) { + each(mapping.alias[key] || [], function(alias) { _[alias] = _[key]; }); }); diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index 03ef0cce66..866205e99c 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -1,7 +1,7 @@ module.exports = { /** Used to map method names to their aliases. */ - 'aliasMap': { + 'alias': { 'ary': ['nAry'], 'overEvery': ['allPass'], 'overSome': ['somePass'], @@ -31,7 +31,7 @@ module.exports = { }, /** Used to map method names to their iteratee ary. */ - 'aryIterateeMap': { + 'aryIteratee': { 'assignWith': 2, 'cloneDeepWith': 1, 'cloneWith': 1, @@ -71,7 +71,7 @@ module.exports = { }, /** Used to map ary to method names. */ - 'aryMethodMap': { + 'aryMethod': { 1: ( 'attempt,ceil,create,curry,curryRight,floor,fromPairs,iteratee,invert,over,' + 'overEvery,overSome,memoize,method,methodOf,mixin,rest,reverse,round,' + @@ -98,14 +98,14 @@ module.exports = { }, /** Used to map ary to rearg configs by method ary. */ - 'aryReargMap': { + 'aryRearg': { 2: [1, 0], 3: [2, 1, 0], 4: [3, 2, 0, 1] }, /** Used to map ary to rearg configs by method names. */ - 'methodReargMap': { + 'methodRearg': { 'clamp': [2, 0, 1], 'reduce': [2, 0, 1], 'reduceRight': [2, 0, 1], @@ -119,14 +119,14 @@ module.exports = { 'caps': [1, 2, 3, 4], /** Used to map keys to other keys. */ - 'keyMap': { + 'key': { 'curryN': 'curry', 'curryRightN': 'curryRight', 'getOr': 'get' }, /** Used to identify methods which mutate arrays or objects. */ - 'mutateMap': { + 'mutate': { 'array': { 'fill': true, 'pull': true, @@ -153,7 +153,7 @@ module.exports = { }, /** Used to track methods that skip `_.rearg`. */ - 'skipReargMap': { + 'skipRearg': { 'assign': true, 'assignIn': true, 'defaults': true, diff --git a/test/test-fp.js b/test/test-fp.js index e987e8b682..02fa5aed92 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -71,7 +71,7 @@ QUnit.test('should have correct aliases', function(assert) { assert.expect(1); - var actual = _.transform(mapping.aliasMap, function(result, aliases, methodName) { + var actual = _.transform(mapping.alias, function(result, aliases, methodName) { var func = fp[methodName]; _.each(aliases, function(alias) { result.push([alias, fp[alias] === func]); @@ -92,13 +92,13 @@ var funcMethods = [ 'curry', 'iteratee', 'memoize', 'over', 'overEvery', 'overSome', - 'method', 'methodOf', 'restParam', 'runInContext' + 'method', 'methodOf', 'rest', 'runInContext' ]; var exceptions = funcMethods.concat('mixin', 'template'), - expected = _.map(mapping.aryMethodMap[1], _.constant(true)); + expected = _.map(mapping.aryMethod[1], _.constant(true)); - var actual = _.map(mapping.aryMethodMap[1], function(methodName) { + var actual = _.map(mapping.aryMethod[1], function(methodName) { var arg = _.includes(funcMethods, methodName) ? _.noop : 1, result = _.attempt(function() { return fp[methodName](arg); }); @@ -124,9 +124,9 @@ ]; var exceptions = _.difference(funcMethods.concat('matchesProperty'), ['cloneDeepWith', 'cloneWith', 'delay']), - expected = _.map(mapping.aryMethodMap[2], _.constant(true)); + expected = _.map(mapping.aryMethod[2], _.constant(true)); - var actual = _.map(mapping.aryMethodMap[2], function(methodName) { + var actual = _.map(mapping.aryMethod[2], function(methodName) { var args = _.includes(funcMethods, methodName) ? [methodName == 'curryN' ? 1 : _.noop, _.noop] : [1, []], result = _.attempt(function() { return fp[methodName](args[0])(args[1]); }); @@ -151,9 +151,9 @@ 'pickBy', 'reduce', 'reduceRight', 'transform', 'zipWith' ]; - var expected = _.map(mapping.aryMethodMap[3], _.constant(true)); + var expected = _.map(mapping.aryMethod[3], _.constant(true)); - var actual = _.map(mapping.aryMethodMap[3], function(methodName) { + var actual = _.map(mapping.aryMethod[3], function(methodName) { var args = _.includes(funcMethods, methodName) ? [_.noop, 0, 1] : [0, 1, []], result = _.attempt(function() { return fp[methodName](args[0])(args[1])(args[2]); }); From ff5f06b9f050c178ca6580e691b47b6b6ec10136 Mon Sep 17 00:00:00 2001 From: mori_9tarou Date: Thu, 14 Jan 2016 14:47:28 +0900 Subject: [PATCH 18/90] Fix `_.pullAll` doc example typo. [ci skip] --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 707ca0bccc..a22b705e51 100644 --- a/lodash.js +++ b/lodash.js @@ -6029,7 +6029,7 @@ * * var array = [1, 2, 3, 1, 2, 3]; * - * _.pull(array, [2, 3]); + * _.pullAll(array, [2, 3]); * console.log(array); * // => [1, 1] */ From 7544166d11a547cc14588c9c65378d856195425a Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 13 Jan 2016 22:06:11 -0800 Subject: [PATCH 19/90] Add placeholders to fp wrapper. [closes #1780] --- lib/fp/baseConvert.js | 10 ++++++++-- lib/fp/mapping.js | 10 ++++++++++ test/test-fp.js | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lib/fp/baseConvert.js b/lib/fp/baseConvert.js index a32684937b..3c50222b33 100644 --- a/lib/fp/baseConvert.js +++ b/lib/fp/baseConvert.js @@ -1,5 +1,6 @@ var mapping = require('./mapping.js'), - mutateMap = mapping.mutate; + mutateMap = mapping.mutate, + placeholder = {}; /** * The base implementation of `convert` which accepts a `util` object of methods @@ -176,7 +177,12 @@ function baseConvert(util, name, func) { }); return !result; }); - return result || func; + + result || (result = func); + if (mapping.placeholder[name]) { + result.placeholder = placeholder; + } + return result; }; if (!isLib) { diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index 866205e99c..5ef0a8528f 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -152,6 +152,16 @@ module.exports = { } }, + /** Used to track methods with placeholder support */ + 'placeholder': { + 'bind': true, + 'bindKey': true, + 'curry': true, + 'curryRight': true, + 'partial': true, + 'partialRight': true + }, + /** Used to track methods that skip `_.rearg`. */ 'skipRearg': { 'assign': true, diff --git a/test/test-fp.js b/test/test-fp.js index 02fa5aed92..293fb39930 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -563,6 +563,20 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('placeholder methods'); + + _.forOwn(mapping.placeholder, function(truthy, methodName) { + var func = fp[methodName]; + + QUnit.test('`_.' + methodName + '` should have a `placeholder` property', function(assert) { + assert.expect(1); + + assert.ok(_.isObject(func.placeholder)); + }); + }); + + /*--------------------------------------------------------------------------*/ + QUnit.module('fp.random'); (function() { From ace771d4e97bcf1d5d00d3b8f1b7bef3e57c2660 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 13 Jan 2016 22:41:48 -0800 Subject: [PATCH 20/90] Add `matches` to core build. [closes #1784] --- dist/lodash.core.js | 48 +++++++++++++++++++++++++++++++---------- dist/lodash.core.min.js | 31 +++++++++++++------------- test/backbone.html | 19 +++++++++++++++- 3 files changed, 71 insertions(+), 27 deletions(-) diff --git a/dist/lodash.core.js b/dist/lodash.core.js index 15d49a4ab7..d7a9e5baa1 100644 --- a/dist/lodash.core.js +++ b/dist/lodash.core.js @@ -454,8 +454,8 @@ * `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, * `result`, `round`, `runInContext`, `sample`, `shift`, `size`, `snakeCase`, * `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, - * `startCase`, `startsWith`, `subtract`, `sum`, sumBy`, `template`, `times`, - * `toLower`, `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, toString`, + * `startCase`, `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, + * `toLower`, `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, * `upperCase`, `upperFirst`, `value`, and `words` * @@ -875,17 +875,18 @@ * @returns {Function} Returns the new function. */ function baseMatches(source) { - var props = keys(source), - length = props.length; - + var props = keys(source); return function(object) { + var length = props.length; if (object == null) { return !length; } object = Object(object); while (length--) { var key = props[length]; - if (!(key in object && baseIsEqual(source[key], object[key], undefined, true))) { + if (!(key in object && + baseIsEqual(source[key], object[key], undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG) + )) { return false; } } @@ -1289,7 +1290,6 @@ */ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { var isPartial = bitmask & PARTIAL_COMPARE_FLAG, - isUnordered = bitmask & UNORDERED_COMPARE_FLAG, objProps = keys(object), objLength = objProps.length, othProps = keys(other), @@ -1301,8 +1301,7 @@ var index = objLength; while (index--) { var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key)) || - !(isUnordered || key == othProps[index])) { + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } @@ -1708,7 +1707,7 @@ * * @name value * @memberOf _ - * @alias run, toJSON, valueOf + * @alias toJSON, valueOf * @category Seq * @returns {*} Returns the resolved unwrapped value. * @example @@ -3494,6 +3493,32 @@ */ var iteratee = baseIteratee; + /** + * Creates a function that performs a deep partial comparison between a given + * object and `source`, returning `true` if the given object has equivalent + * property values, else `false`. + * + * **Note:** This method supports comparing the same values as `_.isEqual`. + * + * @static + * @memberOf _ + * @category Util + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, _.matches({ 'age': 40, 'active': false })); + * // => [{ 'user': 'fred', 'age': 40, 'active': false }] + */ + function matches(source) { + return baseMatches(assign({}, source)); + } + /** * Adds all own enumerable function properties of a source object to the * destination object. If `object` is a function then methods are added to @@ -3693,6 +3718,7 @@ lodash.iteratee = iteratee; lodash.keys = keys; lodash.map = map; + lodash.matches = matches; lodash.mixin = mixin; lodash.negate = negate; lodash.once = once; @@ -3705,7 +3731,6 @@ lodash.values = values; // Add aliases. - lodash.each = forEach; lodash.extend = assignIn; // Add functions to `lodash.prototype`. @@ -3751,6 +3776,7 @@ lodash.uniqueId = uniqueId; // Add aliases. + lodash.each = forEach; lodash.first = head; mixin(lodash, (function() { diff --git a/dist/lodash.core.min.js b/dist/lodash.core.min.js index 062e55d490..d095d09a10 100644 --- a/dist/lodash.core.min.js +++ b/dist/lodash.core.min.js @@ -7,23 +7,24 @@ }function c(n){var t=false;if(null!=n&&typeof n.toString!="function")try{t=!!(n+"")}catch(r){}return t}function f(n,t){return n=typeof n=="number"||hn.test(n)?+n:-1,n>-1&&0==n%1&&(null==t?9007199254740991:t)>n}function a(n){if(Z(n)&&!Vn(n)){if(n instanceof l)return n;if(En.call(n,"__wrapped__")){var t=new l(n.__wrapped__,n.__chain__);return t.__actions__=k(n.__actions__),t}}return new l(n)}function l(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function p(n,t,r,e){return n===ln||H(n,xn[r])&&!En.call(e,r)?t:n; }function s(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(ln,r)},t)}function h(n,t){var r=true;return $n(n,function(n,e,u){return r=!!t(n,e,u)}),r}function v(n,t){var r=[];return $n(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function y(t,r,e,u){u||(u=[]);for(var o=-1,i=t.length;++ot&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e1?r[u-1]:ln,o=typeof o=="function"?(u--,o):ln;for(t=Object(t);++et&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e1?r[u-1]:ln,o=typeof o=="function"?(u--,o):ln;for(t=Object(t);++ef))return false;for(a=true;++iarguments.length,$n)}function P(n){return null==n?0:(n=Q(n)?n:un(n),n.length)}function U(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function"); +return n.name==t.name&&n.message==t.message;case"[object Number]":return n!=+n?t!=+t:n==+t;case"[object RegExp]":case"[object String]":return n==t+""}return false}function $(n,t,r,e,u,o){var i=2&u,c=un(n),f=c.length,a=un(t).length;if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:En.call(t,p)))return false}for(a=true;++larguments.length,$n)}function P(n){return null==n?0:(n=Q(n)?n:un(n),n.length)}function U(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function"); return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=ln),r}}function V(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=Rn(t===ln?n.length-1:Hn(t),0),function(){for(var r=arguments,e=-1,u=Rn(r.length-t,0),o=Array(u);++et}function L(n){return Z(n)&&Q(n)&&En.call(n,"callee")&&(!Fn.call(n,"callee")||"[object Arguments]"==kn.call(n)); }function Q(n){return null!=n&&!(typeof n=="function"&&W(n))&&X(Mn(n))}function W(n){return n=Y(n)?kn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function X(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function Y(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function Z(n){return!!n&&typeof n=="object"}function nn(n){return typeof n=="number"||Z(n)&&"[object Number]"==kn.call(n)}function tn(n){return typeof n=="string"||!Vn(n)&&Z(n)&&"[object String]"==kn.call(n); -}function rn(n,t){return t>n}function en(n){return typeof n=="string"?n:null==n?"":n+""}function un(n){var t=M(n);if(!t&&!Q(n))return Dn(Object(n));var r,e=q(n),u=!!e,e=e||[],o=e.length;for(r in n)!En.call(n,r)||u&&("length"==r||f(r,o))||t&&"constructor"==r||e.push(r);return e}function on(n){for(var t=-1,r=M(n),e=m(n),u=e.length,o=q(n),i=!!o,o=o||[],c=o.length;++tn}function en(n){return typeof n=="string"?n:null==n?"":n+""}function un(n){var t=M(n);if(!t&&!Q(n))return Dn(Object(n));var r,e=q(n),u=!!e,e=e||[],o=e.length;for(r in n)!En.call(n,r)||u&&("length"==r||f(r,o))||t&&"constructor"==r||e.push(r);return e}function on(n){for(var t=-1,r=M(n),e=d(n),u=e.length,o=q(n),i=!!o,o=o||[],c=o.length;++t"'`]/g,sn=RegExp(pn.source),hn=/^(?:0|[1-9]\d*)$/,vn={ -"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},yn={"function":true,object:true},_n=yn[typeof exports]&&exports&&!exports.nodeType?exports:null,gn=yn[typeof module]&&module&&!module.nodeType?module:null,bn=o(yn[typeof self]&&self),jn=o(yn[typeof window]&&window),dn=gn&&gn.exports===_n?_n:null,mn=o(yn[typeof this]&&this),wn=o(_n&&gn&&typeof global=="object"&&global)||jn!==(mn&&mn.window)&&jn||bn||mn||Function("return this")(),On=Array.prototype,xn=Object.prototype,En=xn.hasOwnProperty,An=0,kn=xn.toString,Nn=wn._,Sn=wn.f,Tn=Sn?Sn.g:ln,Fn=xn.propertyIsEnumerable,Bn=wn.isFinite,Dn=Object.keys,Rn=Math.max,In=function(){ -function n(){}return function(t){if(Y(t)){n.prototype=t;var r=new n;n.prototype=ln}return r||{}}}(),$n=function(n,t){return function(r,e){if(null==r)return r;if(!Q(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o":">",'"':""","'":"'","`":"`"},yn={"function":true,object:true},_n=yn[typeof exports]&&exports&&!exports.nodeType?exports:null,gn=yn[typeof module]&&module&&!module.nodeType?module:null,bn=o(yn[typeof self]&&self),jn=o(yn[typeof window]&&window),mn=gn&&gn.exports===_n?_n:null,dn=o(yn[typeof this]&&this),wn=o(_n&&gn&&typeof global=="object"&&global)||jn!==(dn&&dn.window)&&jn||bn||dn||Function("return this")(),On=Array.prototype,xn=Object.prototype,En=xn.hasOwnProperty,An=0,kn=xn.toString,Nn=wn._,Sn=wn.f,Tn=Sn?Sn.g:ln,Fn=xn.propertyIsEnumerable,Bn=wn.isFinite,Dn=Object.keys,Rn=Math.max,In=function(){ +function n(){}return function(t){if(Y(t)){n.prototype=t;var r=new n;n.prototype=ln}return r||{}}}(),$n=function(n,t){return function(r,e){if(null==r)return r;if(!Q(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++oe&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return Q(n)?n.length?k(n):[]:cn(n)},a.values=cn,a.each=G,a.extend=Qn,an(a,a),a.clone=function(n){return Y(n)?Vn(n)?k(n):T(n,un(n)):n},a.escape=function(n){return(n=en(n))&&sn.test(n)?n.replace(pn,i):n},a.every=function(n,t,r){return t=r?ln:t,h(n,d(t))},a.find=C,a.forEach=G,a.has=function(n,t){ -return null!=n&&En.call(n,t)},a.head=z,a.identity=fn,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?Rn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++re&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return Q(n)?n.length?k(n):[]:cn(n)},a.values=cn,a.extend=Qn,an(a,a),a.clone=function(n){return Y(n)?Vn(n)?k(n):T(n,un(n)):n},a.escape=function(n){return(n=en(n))&&sn.test(n)?n.replace(pn,i):n},a.every=function(n,t,r){ +return t=r?ln:t,h(n,m(t))},a.find=C,a.forEach=G,a.has=function(n,t){return null!=n&&En.call(n,t)},a.head=z,a.identity=fn,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?Rn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r Date: Wed, 13 Jan 2016 23:08:56 -0800 Subject: [PATCH 21/90] Fix `lodash` doc ticks. [ci skip] [closes #1787] --- lodash.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lodash.js b/lodash.js index a22b705e51..6d85307c75 100644 --- a/lodash.js +++ b/lodash.js @@ -1367,13 +1367,13 @@ * The chainable wrapper methods are: * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, * `at`, `before`, `bind`, `bindAll`, `bindKey`, `chain`, `chunk`, `commit`, - * `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`, + * `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`, * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, - * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, + * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`, * `flowRight`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, * `forOwnRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, - * `intersection`, `intersectionBy`, `intersectionWith`, invert`, `invokeMap`, + * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invokeMap`, * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`, * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, From b081b3ae2d600de9e53766c2a4df241a96e6faf8 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 13 Jan 2016 23:09:46 -0800 Subject: [PATCH 22/90] Cleanup intentation in `baseIsMatch`. --- lodash.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 6d85307c75..7c958ee01b 100644 --- a/lodash.js +++ b/lodash.js @@ -2810,7 +2810,10 @@ var stack = new Stack, result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined; - if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) { + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { return false; } } From 349dfbf1823cb3e13775e81e14768eff990a342e Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 14 Jan 2016 01:34:34 -0800 Subject: [PATCH 23/90] Ensure core build `slice` has default `start` and `end` params. [closes #1789] --- dist/lodash.core.js | 2 ++ dist/lodash.core.min.js | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dist/lodash.core.js b/dist/lodash.core.js index d7a9e5baa1..7985e3df5c 100644 --- a/dist/lodash.core.js +++ b/dist/lodash.core.js @@ -1583,6 +1583,8 @@ */ function slice(array, start, end) { var length = array ? array.length : 0; + start = start == null ? 0 : +start; + end = end === undefined ? length : +end; return length ? baseSlice(array, start, end) : []; } diff --git a/dist/lodash.core.min.js b/dist/lodash.core.min.js index d095d09a10..95e9723817 100644 --- a/dist/lodash.core.min.js +++ b/dist/lodash.core.min.js @@ -21,10 +21,10 @@ return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=ln) function n(){}return function(t){if(Y(t)){n.prototype=t;var r=new n;n.prototype=ln}return r||{}}}(),$n=function(n,t){return function(r,e){if(null==r)return r;if(!Q(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++oe&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return Q(n)?n.length?k(n):[]:cn(n)},a.values=cn,a.extend=Qn,an(a,a),a.clone=function(n){return Y(n)?Vn(n)?k(n):T(n,un(n)):n},a.escape=function(n){return(n=en(n))&&sn.test(n)?n.replace(pn,i):n},a.every=function(n,t,r){ -return t=r?ln:t,h(n,m(t))},a.find=C,a.forEach=G,a.has=function(n,t){return null!=n&&En.call(n,t)},a.head=z,a.identity=fn,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?Rn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++re&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return Q(n)?n.length?k(n):[]:cn(n)},a.values=cn,a.extend=Qn,an(a,a),a.clone=function(n){return Y(n)?Vn(n)?k(n):T(n,un(n)):n},a.escape=function(n){return(n=en(n))&&sn.test(n)?n.replace(pn,i):n}, +a.every=function(n,t,r){return t=r?ln:t,h(n,m(t))},a.find=C,a.forEach=G,a.has=function(n,t){return null!=n&&En.call(n,t)},a.head=z,a.identity=fn,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?Rn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r Date: Thu, 14 Jan 2016 15:33:16 +0200 Subject: [PATCH 24/90] Fix ES5 `parseInt` link. [ci skip] --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 7c958ee01b..f3429efe42 100644 --- a/lodash.js +++ b/lodash.js @@ -12043,7 +12043,7 @@ * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, * in which case a `radix` of `16` is used. * - * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E) + * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#x15.1.2.2) * of `parseInt`. * * @static From 16343885346a92aeb7f3ff1bd049490861e29619 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 14 Jan 2016 08:25:49 -0800 Subject: [PATCH 25/90] Update fallback lodash module path. --- test/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.js b/test/test.js index 19e192e0ad..ea2e70dcd2 100644 --- a/test/test.js +++ b/test/test.js @@ -217,7 +217,7 @@ var QUnit = root.QUnit || (root.QUnit = load('../node_modules/qunitjs/qunit/qunit.js')); /** Load stable Lodash and QUnit Extras. */ - var lodashStable = root.lodashStable || load('../node_modules/lodash/index.js'); + var lodashStable = root.lodashStable || load('../node_modules/lodash/lodash.js'); if (lodashStable) { lodashStable = lodashStable.runInContext(root); } From 1ab5a2078427b0a8aa3cc7d875e25097ee52f0cb Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 14 Jan 2016 08:32:01 -0800 Subject: [PATCH 26/90] Fix phantomjs test fails. --- test/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.js b/test/test.js index ea2e70dcd2..c97b0c5518 100644 --- a/test/test.js +++ b/test/test.js @@ -217,7 +217,7 @@ var QUnit = root.QUnit || (root.QUnit = load('../node_modules/qunitjs/qunit/qunit.js')); /** Load stable Lodash and QUnit Extras. */ - var lodashStable = root.lodashStable || load('../node_modules/lodash/lodash.js'); + var lodashStable = root.lodashStable || load('../node_modules/lodash/lodash.js').noConflict(); if (lodashStable) { lodashStable = lodashStable.runInContext(root); } From 1a54e43a24b980533be3a9b68b7a2cad4c8e088e Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 14 Jan 2016 19:22:54 -0800 Subject: [PATCH 27/90] Add `chunk` to fp mapping. --- lib/fp/mapping.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index 5ef0a8528f..46f87c4a28 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -77,18 +77,18 @@ module.exports = { 'overEvery,overSome,memoize,method,methodOf,mixin,rest,reverse,round,' + 'runInContext,template,trim,trimLeft,trimRight,uniqueId,words').split(','), 2: ( - 'add,ary,assign,at,bind,bindKey,cloneDeepWith,cloneWith,concat,countBy,curryN,' + - 'curryRightN,debounce,defaults,defaultsDeep,delay,difference,drop,dropRight,' + - 'dropRightWhile,dropWhile,endsWith,eq,every,extend,filter,find,find,findIndex,' + - 'findKey,findLast,findLastIndex,findLastKey,flatMap,forEach,forEachRight,' + - 'forIn,forInRight,forOwn,forOwnRight,get,groupBy,gt,gte,includes,indexBy,' + - 'indexOf,intersection,invoke,invokeMap,isEqual,isMatch,lastIndexOf,lt,lte,' + - 'map,mapKeys,mapValues,matchesProperty,maxBy,mean,minBy,merge,omit,orderBy,' + - 'overArgs,pad,padLeft,padRight,parseInt,partition,pick,pull,pullAll,pullAt,' + - 'random,range,rangeRight,rearg,reject,remove,repeat,result,sampleSize,some,' + - 'sortBy,sortedIndexBy,sortedLastIndexBy,sortedUniqBy,split,startsWith,subtract,' + - 'sumBy,take,takeRight,takeRightWhile,takeWhile,throttle,times,truncate,union,' + - 'uniqBy,without,wrap,xor,zip,zipObject').split(','), + 'add,ary,assign,at,bind,bindKey,chunk,cloneDeepWith,cloneWith,concat,countBy,', + 'curryN,curryRightN,debounce,defaults,defaultsDeep,delay,difference,drop,' + + 'dropRight,dropRightWhile,dropWhile,endsWith,eq,every,extend,filter,find,' + + 'find,findIndex,findKey,findLast,findLastIndex,findLastKey,flatMap,forEach,' + + 'forEachRight,forIn,forInRight,forOwn,forOwnRight,get,groupBy,gt,gte,includes,' + + 'indexBy,indexOf,intersection,invoke,invokeMap,isEqual,isMatch,lastIndexOf,' + + 'lt,lte,map,mapKeys,mapValues,matchesProperty,maxBy,mean,minBy,merge,omit,' + + 'orderBy,overArgs,pad,padLeft,padRight,parseInt,partition,pick,pull,pullAll,' + + 'pullAt,random,range,rangeRight,rearg,reject,remove,repeat,result,sampleSize,' + + 'some,sortBy,sortedIndexBy,sortedLastIndexBy,sortedUniqBy,split,startsWith,' + + 'subtract,sumBy,take,takeRight,takeRightWhile,takeWhile,throttle,times,' + + 'truncate,union,uniqBy,without,wrap,xor,zip,zipObject').split(','), 3: ( 'assignWith,clamp,differenceBy,extendWith,getOr,inRange,intersectionBy,' + 'isEqualWith,isMatchWith,mergeWith,omitBy,pickBy,pullAllBy,reduce,' + From a5c1421c6b895566aff8f48e43d010caf50b6abe Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 14 Jan 2016 19:36:04 -0800 Subject: [PATCH 28/90] Ensure `_.fromPairs` can consume results of `_.toPairs`. [closes #1790] --- lodash.js | 2 +- test/test.js | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lodash.js b/lodash.js index f3429efe42..15b5003383 100644 --- a/lodash.js +++ b/lodash.js @@ -5751,7 +5751,7 @@ while (++index < length) { var pair = pairs[index]; - baseSet(result, pair[0], pair[1]); + result[pair[0]] = pair[1]; } return result; } diff --git a/test/test.js b/test/test.js index c97b0c5518..3459acce4f 100644 --- a/test/test.js +++ b/test/test.js @@ -6326,13 +6326,13 @@ QUnit.module('lodash.fromPairs'); (function() { - var object = { 'barney': 36, 'fred': 40 }, - array = [['barney', 36], ['fred', 40]]; - QUnit.test('should accept a two dimensional array', function(assert) { assert.expect(1); - var actual = _.fromPairs(array); + var array = [['a', 1], ['b', 2]], + object = { 'a': 1, 'b': 2 }, + actual = _.fromPairs(array); + assert.deepEqual(actual, object); }); @@ -6350,16 +6350,17 @@ assert.deepEqual(actual, expected); }); - QUnit.test('should support deep paths', function(assert) { + QUnit.test('should not support deep paths', function(assert) { assert.expect(1); var actual = _.fromPairs([['a.b.c', 1]]); - assert.deepEqual(actual, { 'a': { 'b': { 'c': 1 } } }); + assert.deepEqual(actual, { 'a.b.c': 1 }); }); QUnit.test('should support consuming the return value of `_.toPairs`', function(assert) { assert.expect(1); + var object = { 'a.b.c': 1 }; assert.deepEqual(_.fromPairs(_.toPairs(object)), object); }); From fc2ce9a021ccd76594ab3d56910031a5e0b2d7ff Mon Sep 17 00:00:00 2001 From: Beau Gunderson Date: Thu, 14 Jan 2016 11:50:39 -0800 Subject: [PATCH 29/90] Add test fails for keycap emoji (#1796). --- test/test.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index 3459acce4f..da0cb27762 100644 --- a/test/test.js +++ b/test/test.js @@ -21227,10 +21227,11 @@ raisedHand = '\u270B' + emojiVar, rocket = '\ud83d\ude80', thumbsUp = '\ud83d\udc4d', - comboGlyph = '\ud83d\udc68\u200d' + heart + '\u200d\ud83d\udc8B\u200d\ud83d\udc68'; + comboGlyph = '\ud83d\udc68\u200d' + heart + '\u200d\ud83d\udc8B\u200d\ud83d\udc68', + keycapHash = '#' + emojiVar + '\u20e3'; QUnit.test('should account for astral symbols', function(assert) { - assert.expect(25); + assert.expect(26); var allHearts = _.repeat(hearts, 10), chars = hearts + comboGlyph, @@ -21262,6 +21263,8 @@ assert.deepEqual(_.words(string), ['A', leafs, comboGlyph, 'and', rocket]); + assert.deepEqual(_.toArray(keycapHash), [keycapHash]); + lodashStable.times(2, function(index) { var separator = index ? RegExp(hearts) : hearts, options = { 'length': 4, 'separator': separator }, From 84763cab261dd6dc9e3a264b9eea2ef4987395be Mon Sep 17 00:00:00 2001 From: Beau Gunderson Date: Thu, 14 Jan 2016 12:38:26 -0800 Subject: [PATCH 30/90] Add failing test for Fitzpatrick modifiers. --- test/test.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index da0cb27762..b5da634e6b 100644 --- a/test/test.js +++ b/test/test.js @@ -21228,10 +21228,12 @@ rocket = '\ud83d\ude80', thumbsUp = '\ud83d\udc4d', comboGlyph = '\ud83d\udc68\u200d' + heart + '\u200d\ud83d\udc8B\u200d\ud83d\udc68', - keycapHash = '#' + emojiVar + '\u20e3'; + keycapHash = '#' + emojiVar + '\u20e3', + oneFitzpatrick = '\ud83c\udfff', + twoFitzpatrick = oneFitzpatrick + oneFitzpatrick; QUnit.test('should account for astral symbols', function(assert) { - assert.expect(26); + assert.expect(27); var allHearts = _.repeat(hearts, 10), chars = hearts + comboGlyph, @@ -21265,6 +21267,8 @@ assert.deepEqual(_.toArray(keycapHash), [keycapHash]); + assert.deepEqual(_.toArray(twoFitzpatrick), [oneFitzpatrick, oneFitzpatrick]); + lodashStable.times(2, function(index) { var separator = index ? RegExp(hearts) : hearts, options = { 'length': 4, 'separator': separator }, From 96ef2110ce6a6e1e6994735c591905cc3104840d Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 14 Jan 2016 21:31:26 -0800 Subject: [PATCH 31/90] Add support for combining diacritical marks for symbols. --- lodash.js | 17 +++++--- test/test.js | 117 ++++++++++++++++++++++++++------------------------- 2 files changed, 71 insertions(+), 63 deletions(-) diff --git a/lodash.js b/lodash.js index 15b5003383..def0470ebc 100644 --- a/lodash.js +++ b/lodash.js @@ -163,7 +163,8 @@ /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', - rsComboRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', rsDingbatRange = '\\u2700-\\u27bf', rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', @@ -177,12 +178,13 @@ /** Used to compose unicode capture groups. */ var rsAstral = '[' + rsAstralRange + ']', rsBreak = '[' + rsBreakRange + ']', - rsCombo = '[' + rsComboRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', rsDigits = '\\d+', rsDingbat = '[' + rsDingbatRange + ']', rsLower = '[' + rsLowerRange + ']', rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', - rsModifier = '(?:\\ud83c[\\udffb-\\udfff])', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', @@ -199,14 +201,17 @@ rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */ + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ var reComboMark = RegExp(rsCombo, 'g'); /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ - var reComplexSymbol = RegExp(rsSymbol + rsSeq, 'g'); + var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ - var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); /** Used to match non-compound words composed of alphanumeric characters. */ var reBasicWord = /[a-zA-Z0-9]+/g; diff --git a/test/test.js b/test/test.js index b5da634e6b..523bd21bd1 100644 --- a/test/test.js +++ b/test/test.js @@ -274,15 +274,6 @@ 'i', 'd', 'n', 'o', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 'u', 'u', 'y', 'th', 'y' ]; - /** List of emoji modifiers. */ - var emojiModifiers = [ - '\ud83c\udffb', - '\ud83c\udffc', - '\ud83c\udffd', - '\ud83c\udffe', - '\ud83c\udfff' - ]; - /** Used to specify the emoji style glyph variant of characters. */ var emojiVar = '\ufe0f'; @@ -303,6 +294,15 @@ new URIError ]; + /** List of fitzpatrick modifiers. */ + var fitzModifiers = [ + '\ud83c\udffb', + '\ud83c\udffc', + '\ud83c\udffd', + '\ud83c\udffe', + '\ud83c\udfff' + ]; + /** Used to check whether methods support typed arrays. */ var typedArrays = [ 'Float32Array', @@ -21223,17 +21223,16 @@ var flag = '\ud83c\uddfa\ud83c\uddf8', heart = '\u2764' + emojiVar, hearts = '\ud83d\udc95', + comboGlyph = '\ud83d\udc68\u200d' + heart + '\u200d\ud83d\udc8B\u200d\ud83d\udc68', + hashKeycap = '#' + emojiVar + '\u20e3', leafs = '\ud83c\udf42', + noMic = '\ud83c\udf99\u20e0', raisedHand = '\u270B' + emojiVar, rocket = '\ud83d\ude80', - thumbsUp = '\ud83d\udc4d', - comboGlyph = '\ud83d\udc68\u200d' + heart + '\u200d\ud83d\udc8B\u200d\ud83d\udc68', - keycapHash = '#' + emojiVar + '\u20e3', - oneFitzpatrick = '\ud83c\udfff', - twoFitzpatrick = oneFitzpatrick + oneFitzpatrick; + thumbsUp = '\ud83d\udc4d'; QUnit.test('should account for astral symbols', function(assert) { - assert.expect(27); + assert.expect(26); var allHearts = _.repeat(hearts, 10), chars = hearts + comboGlyph, @@ -21264,10 +21263,7 @@ assert.strictEqual(_.truncate(string, { 'length': 6 }), 'A ' + leafs + '...'); assert.deepEqual(_.words(string), ['A', leafs, comboGlyph, 'and', rocket]); - - assert.deepEqual(_.toArray(keycapHash), [keycapHash]); - - assert.deepEqual(_.toArray(twoFitzpatrick), [oneFitzpatrick, oneFitzpatrick]); + assert.deepEqual(_.toArray(hashKeycap), [hashKeycap]); lodashStable.times(2, function(index) { var separator = index ? RegExp(hearts) : hearts, @@ -21283,15 +21279,40 @@ }); }); - QUnit.test('should match lone surrogates', function(assert) { - assert.expect(3); + QUnit.test('should account for combining diacritical marks', function(assert) { + assert.expect(1); - var pair = hearts.split(''), - surrogates = pair[0] + ' ' + pair[1]; + var values = lodashStable.map(comboMarks, function(mark) { + return 'o' + mark; + }); - assert.strictEqual(_.size(surrogates), 3); - assert.deepEqual(_.toArray(surrogates), [pair[0], ' ', pair[1]]); - assert.deepEqual(_.words(surrogates), []); + var expected = lodashStable.map(values, function(value) { + return [1, [value], [value]]; + }); + + var actual = lodashStable.map(values, function(value) { + return [_.size(value), _.toArray(value), _.words(value)]; + }); + + assert.deepEqual(actual, expected); + }); + + QUnit.test('should account for fitzpatrick modifiers', function(assert) { + assert.expect(1); + + var values = lodashStable.map(fitzModifiers, function(modifier) { + return thumbsUp + modifier; + }); + + var expected = lodashStable.map(values, function(value) { + return [1, [value], [value]]; + }); + + var actual = lodashStable.map(values, function(value) { + return [_.size(value), _.toArray(value), _.words(value)]; + }); + + assert.deepEqual(actual, expected); }); QUnit.test('should account for regional symbols', function(assert) { @@ -21318,11 +21339,11 @@ assert.deepEqual(_.words(heart), [heart]); }); - QUnit.test('should account for modifiers', function(assert) { + QUnit.test('should account for variation selectors with fitzpatrick modifiers', function(assert) { assert.expect(1); - var values = lodashStable.map(emojiModifiers, function(modifier) { - return thumbsUp + modifier; + var values = lodashStable.map(fitzModifiers, function(modifier) { + return raisedHand + modifier; }); var expected = lodashStable.map(values, function(value) { @@ -21336,40 +21357,22 @@ assert.deepEqual(actual, expected); }); - QUnit.test('should account for variation selectors with modifiers', function(assert) { - assert.expect(1); - - var values = lodashStable.map(emojiModifiers, function(modifier) { - return raisedHand + modifier; - }); - - var expected = lodashStable.map(values, function(value) { - return [1, [value], [value]]; - }); + QUnit.test('should match lone surrogates', function(assert) { + assert.expect(3); - var actual = lodashStable.map(values, function(value) { - return [_.size(value), _.toArray(value), _.words(value)]; - }); + var pair = hearts.split(''), + surrogates = pair[0] + ' ' + pair[1]; - assert.deepEqual(actual, expected); + assert.strictEqual(_.size(surrogates), 3); + assert.deepEqual(_.toArray(surrogates), [pair[0], ' ', pair[1]]); + assert.deepEqual(_.words(surrogates), []); }); - QUnit.test('should account for combining diacritical marks', function(assert) { + QUnit.test('should match side by side fitzpatrick modifiers separately ', function(assert) { assert.expect(1); - var values = lodashStable.map(comboMarks, function(mark) { - return 'o' + mark; - }); - - var expected = lodashStable.map(values, function(value) { - return [1, [value], [value]]; - }); - - var actual = lodashStable.map(values, function(value) { - return [_.size(value), _.toArray(value), _.words(value)]; - }); - - assert.deepEqual(actual, expected); + var string = fitzModifiers[0] + fitzModifiers[0]; + assert.deepEqual(_.toArray(string), [fitzModifiers[0], fitzModifiers[0]]); }); }()); From 4b801f423bedba7a3a9a5c8f9b1a766bf987a817 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 14 Jan 2016 22:11:48 -0800 Subject: [PATCH 32/90] Update fp mapping to include `uniqWith`. [closes #1800] --- lib/fp/mapping.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index 46f87c4a28..f9d39a46f1 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -3,8 +3,8 @@ module.exports = { /** Used to map method names to their aliases. */ 'alias': { 'ary': ['nAry'], - 'overEvery': ['allPass'], - 'overSome': ['somePass'], + 'assignIn': ['extend'], + 'assignInWith': ['extendWith'], 'filter': ['whereEq'], 'flatten': ['unnest'], 'flow': ['pipe'], @@ -19,8 +19,10 @@ module.exports = { 'isEqual': ['equals'], 'mapValues': ['mapObj'], 'matchesProperty': ['pathEq'], - 'overArgs': ['useWith'], 'omit': ['dissoc', 'omitAll'], + 'overArgs': ['useWith'], + 'overEvery': ['allPass'], + 'overSome': ['somePass'], 'pick': ['pickAll'], 'property': ['get'], 'propertyOf': ['propOf'], @@ -33,12 +35,12 @@ module.exports = { /** Used to map method names to their iteratee ary. */ 'aryIteratee': { 'assignWith': 2, + 'assignInWith': 2, 'cloneDeepWith': 1, 'cloneWith': 1, 'dropRightWhile': 1, 'dropWhile': 1, 'every': 1, - 'extendWith': 2, 'filter': 1, 'find': 1, 'findIndex': 1, @@ -88,11 +90,12 @@ module.exports = { 'pullAt,random,range,rangeRight,rearg,reject,remove,repeat,result,sampleSize,' + 'some,sortBy,sortedIndexBy,sortedLastIndexBy,sortedUniqBy,split,startsWith,' + 'subtract,sumBy,take,takeRight,takeRightWhile,takeWhile,throttle,times,' + - 'truncate,union,uniqBy,without,wrap,xor,zip,zipObject').split(','), + 'truncate,union,uniqBy,uniqWith,without,wrap,xor,zip,zipObject').split(','), 3: ( - 'assignWith,clamp,differenceBy,extendWith,getOr,inRange,intersectionBy,' + - 'isEqualWith,isMatchWith,mergeWith,omitBy,pickBy,pullAllBy,reduce,' + - 'reduceRight,replace,set,slice,transform,unionBy,xorBy,zipWith').split(','), + 'assignWith,assignInWith,clamp,differenceBy,differenceWith,getOr,inRange,' + + 'intersectionBy,intersectionWith,isEqualWith,isMatchWith,mergeWith,omitBy,' + + 'pickBy,pullAllBy,reduce,reduceRight,replace,set,slice,transform,unionBy,' + + 'unionWith,xorBy,xorWith,zipWith').split(','), 4: ['fill', 'setWith'] }, @@ -138,11 +141,11 @@ module.exports = { }, 'object': { 'assign': true, + 'assignIn': true, + 'assignInWith': true, 'assignWith': true, 'defaults': true, 'defaultsDeep': true, - 'extend': true, - 'extendWith': true, 'merge': true, 'mergeWith': true }, @@ -169,7 +172,6 @@ module.exports = { 'defaults': true, 'defaultsDeep': true, 'difference': true, - 'extend': true, 'matchesProperty': true, 'merge': true, 'random': true, From 1d54d868e3e93234a5400aa93783a8ef14c79551 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 00:43:38 -0800 Subject: [PATCH 33/90] Fix merging functions and avoid augmenting sources. [closes #1794, #1801] --- lodash.js | 52 +++++++++++++++++++++++++++++++++------------------- test/test.js | 45 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 76 insertions(+), 21 deletions(-) diff --git a/lodash.js b/lodash.js index def0470ebc..670dfae07e 100644 --- a/lodash.js +++ b/lodash.js @@ -2954,10 +2954,11 @@ * @private * @param {Object} object The destination object. * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged counterparts. */ - function baseMerge(object, source, customizer, stack) { + function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } @@ -2969,7 +2970,7 @@ } if (isObject(srcValue)) { stack || (stack = new Stack); - baseMergeDeep(object, source, key, baseMerge, customizer, stack); + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(object[key], srcValue, (key + ''), object, source, stack) : undefined; @@ -2990,11 +2991,12 @@ * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged counterparts. */ - function baseMergeDeep(object, source, key, mergeFunc, customizer, stack) { + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = object[key], srcValue = source[key], stacked = stack.get(srcValue) || stack.get(objValue); @@ -3009,24 +3011,36 @@ if (isCommon) { newValue = srcValue; if (isArray(srcValue) || isTypedArray(srcValue)) { - newValue = isArray(objValue) - ? objValue - : ((isArrayLikeObject(objValue)) ? copyArray(objValue) : baseClone(srcValue)); + if (isArray(objValue)) { + newValue = srcIndex ? copyArray(objValue) : objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else { + newValue = baseClone(srcValue); + } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = isArguments(objValue) - ? toPlainObject(objValue) - : (isObject(objValue) ? objValue : baseClone(srcValue)); + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { + newValue = baseClone(srcValue); + } + else { + newValue = srcIndex ? baseClone(objValue) : objValue; + } } else { - isCommon = isFunction(srcValue); + isCommon = false; } } stack.set(srcValue, newValue); if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). - mergeFunc(newValue, srcValue, customizer, stack); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); } assignMergeValue(object, key, newValue); } @@ -3878,7 +3892,7 @@ while (++index < length) { var source = sources[index]; if (source) { - assigner(object, source, customizer); + assigner(object, source, index, customizer); } } return object; @@ -5105,7 +5119,7 @@ function mergeDefaults(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, mergeDefaults, stack); + baseMerge(objValue, srcValue, undefined, mergeDefaults, stack); } return objValue === undefined ? baseClone(srcValue, undefined, undefined, key, object) @@ -10438,7 +10452,7 @@ * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - var assignInWith = createAssigner(function(object, source, customizer) { + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { copyObjectWith(source, keysIn(source), object, customizer); }); @@ -10468,7 +10482,7 @@ * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - var assignWith = createAssigner(function(object, source, customizer) { + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { copyObjectWith(source, keys(source), object, customizer); }); @@ -11148,8 +11162,8 @@ * _.merge(users, ages); * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } */ - var merge = createAssigner(function(object, source) { - baseMerge(object, source); + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); }); /** @@ -11187,8 +11201,8 @@ * _.mergeWith(object, other, customizer); * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } */ - var mergeWith = createAssigner(function(object, source, customizer) { - baseMerge(object, source, customizer); + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); }); /** diff --git a/test/test.js b/test/test.js index 523bd21bd1..e554f069f0 100644 --- a/test/test.js +++ b/test/test.js @@ -13086,7 +13086,7 @@ assert.deepEqual(actual, expected); }); - QUnit.test('should work with a function for `object`', function(assert) { + QUnit.test('should merge onto function `object` values', function(assert) { assert.expect(2); function Foo() {} @@ -13098,7 +13098,28 @@ assert.strictEqual(Foo.a, 1); }); - QUnit.test('should work with a non-plain `object`', function(assert) { + QUnit.test('should not merge onto nested function values', function(assert) { + assert.expect(3); + + var source1 = { 'a': function() {} }, + source2 = { 'a': { 'b': 1 } }, + actual = _.merge({}, source1, source2), + expected = { 'a': { 'b': 1 } }; + + assert.deepEqual(actual, expected); + + source1 = { 'a': function() {} }; + source2 = { 'a': { 'b': 1 } }; + + expected = { 'a': function() {} }; + expected.a.b = 1; + + actual = _.merge(source1, source2); + assert.strictEqual(typeof actual.a, 'function'); + assert.strictEqual(actual.a.b, 1); + }); + + QUnit.test('should merge onto non-plain `object` values', function(assert) { assert.expect(2); function Foo() {} @@ -13233,6 +13254,26 @@ assert.deepEqual(actual, expected); }); + QUnit.test('should not augment source objects', function(assert) { + assert.expect(6); + + var source1 = { 'a': [{ 'a': 1 }] }, + source2 = { 'a': [{ 'b': 2 }] }, + actual = _.merge({}, source1, source2); + + assert.deepEqual(source1.a, [{ 'a': 1 }]); + assert.deepEqual(source2.a, [{ 'b': 2 }]); + assert.deepEqual(actual.a, [{ 'a': 1, 'b': 2 }]); + + var source1 = { 'a': [[1, 2, 3]] }, + source2 = { 'a': [[3, 4]] }, + actual = _.merge({}, source1, source2); + + assert.deepEqual(source1.a, [[1, 2, 3]]); + assert.deepEqual(source2.a, [[3, 4]]); + assert.deepEqual(actual.a, [[3, 4, 3]]); + }); + QUnit.test('should shallow clone array/typed-array/plain-object sources', function(assert) { assert.expect(1); From f31fb8bd34babe8aa4e3c91a33cc61f788b61e8f Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 01:02:30 -0800 Subject: [PATCH 34/90] Add `_.isEqual` test for unordered object comparisons. --- test/test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/test.js b/test/test.js index e554f069f0..59a544a5dd 100644 --- a/test/test.js +++ b/test/test.js @@ -8157,6 +8157,15 @@ assert.strictEqual(_.isEqual(object1, object2), false); }); + QUnit.test('should compare objects regardless of key order', function(assert) { + assert.expect(1); + + var object1 = { 'a': 1, 'b': 2, 'c': 3 }, + object2 = { 'c': 3, 'a': 1, 'b': 2 }; + + assert.strictEqual(_.isEqual(object1, object2), true); + }); + QUnit.test('should compare nested objects', function(assert) { assert.expect(1); From 1df18a3e10b003a8380f5bb2a2ac26bd25570289 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 01:15:31 -0800 Subject: [PATCH 35/90] Make `_.omitBy` and `_.pickBy` pass a `key` param to iteratees. --- lodash.js | 10 +++++----- test/test.js | 9 ++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lodash.js b/lodash.js index 670dfae07e..0725e9f127 100644 --- a/lodash.js +++ b/lodash.js @@ -3104,7 +3104,7 @@ function basePickBy(object, predicate) { var result = {}; baseForIn(object, function(value, key) { - if (predicate(value)) { + if (predicate(value, key)) { result[key] = value; } }); @@ -11250,9 +11250,9 @@ * // => { 'b': '2' } */ function omitBy(object, predicate) { - predicate = getIteratee(predicate); - return basePickBy(object, function(value) { - return !predicate(value); + predicate = getIteratee(predicate, 2); + return basePickBy(object, function(value, key) { + return !predicate(value, key); }); } @@ -11295,7 +11295,7 @@ * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { - return object == null ? {} : basePickBy(object, getIteratee(predicate)); + return object == null ? {} : basePickBy(object, getIteratee(predicate, 2)); } /** diff --git a/test/test.js b/test/test.js index 59a544a5dd..850a898698 100644 --- a/test/test.js +++ b/test/test.js @@ -5785,6 +5785,7 @@ func = _[methodName], isBy = /(^partition|By)$/.test(methodName), isFind = /^find/.test(methodName), + isOmitPick = /^(?:omit|pick)By$/.test(methodName), isSome = methodName == 'some'; QUnit.test('`_.' + methodName + '` should provide the correct iteratee arguments', function(assert) { @@ -5806,7 +5807,7 @@ expected[1] += ''; } if (isBy) { - expected.length = 1; + expected.length = isOmitPick ? 2 : 1; } assert.deepEqual(args, expected); } @@ -5822,11 +5823,13 @@ var array = [1]; array[2] = 3; - var expected = [[1, 0, array], [undefined, 1, array], [3, 2, array]]; + var expected = lodashStable.includes(objectMethods, methodName) + ? [[1, '0', array], [undefined, '1', array], [3, '2', array]] + : [[1, 0, array], [undefined, 1, array], [3, 2, array]]; if (isBy) { expected = lodashStable.map(expected, function(args) { - return args.slice(0, 1); + return args.slice(0, isOmitPick ? 2 : 1); }); } else if (lodashStable.includes(objectMethods, methodName)) { From 42e01fd37b8c69aa86c222ffa93b5f9cce3947f1 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 01:21:59 -0800 Subject: [PATCH 36/90] Add fp tests to `npm test`. --- package.json | 2 +- test/test-fp.js | 2 ++ test/test.js | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 80a1210b56..28600c2212 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,6 @@ "scripts": { "build": "node lib/main/build.js && node lib/fp/build.js", "style": "jscs lodash.js lib/**/*.js", - "test": "node test/test" + "test": "npm run build && node test/test && node test/test-fp" } } diff --git a/test/test-fp.js b/test/test-fp.js index 293fb39930..3ee4e07e31 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -65,6 +65,8 @@ /*--------------------------------------------------------------------------*/ + console.log('Running lodash/fp tests.'); + QUnit.module('method aliases'); (function() { diff --git a/test/test.js b/test/test.js index 850a898698..eb2eb35e18 100644 --- a/test/test.js +++ b/test/test.js @@ -628,6 +628,8 @@ /*--------------------------------------------------------------------------*/ + console.log('Running lodash tests.'); + if (params) { console.log('test.js invoked with arguments: ' + JSON.stringify(slice.call(params))); } From 6b19ca1c11e6b9b1457ce90bbe933983c2e96268 Mon Sep 17 00:00:00 2001 From: Jeroen Engels Date: Fri, 15 Jan 2016 10:48:58 +0100 Subject: [PATCH 37/90] Update contributing.md about how to launch tests. [ci skip] --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 245c18b5b6..2082fd817c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ Include updated unit tests in the `test` directory as part of your pull request. Don’t worry about regenerating the documentation, lodash.js, or lodash.min.js. Before running the unit tests you’ll need to install, `npm i`, [development dependencies](https://docs.npmjs.com/files/package.json#devdependencies). -Run unit tests from the command-line via `node test/test`, or open `test/index.html` in a web browser. +Run unit tests from the command-line via `npm test`, or open `test/index.html` and `test/fp.html` in a web browser. The [Backbone](http://backbonejs.org/) & [Underscore](http://underscorejs.org/) test suites are included as well. ## Contributor License Agreement From e752b26f9ec308b251eb01298c64f12dc4e970fb Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 02:13:23 -0800 Subject: [PATCH 38/90] Clarify max size of `_.sampleSize`. [ci skp] [closes #1802] --- lodash.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index 0725e9f127..8b3f5cbc05 100644 --- a/lodash.js +++ b/lodash.js @@ -7921,7 +7921,8 @@ } /** - * Gets `n` random elements from `collection`. + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. * * @static * @memberOf _ @@ -7931,8 +7932,11 @@ * @returns {Array} Returns the random elements. * @example * - * _.sampleSize([1, 2, 3, 4], 2); + * _.sampleSize([1, 2, 3], 2); * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] */ function sampleSize(collection, n) { var index = -1, From efc61ea70d004427e23f66799c28d3e0d7bdcffa Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 02:13:46 -0800 Subject: [PATCH 39/90] Correct arg count typo in `_.cloneWith` docs. [ci skip] --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 8b3f5cbc05..34fa23a02e 100644 --- a/lodash.js +++ b/lodash.js @@ -9100,7 +9100,7 @@ * This method is like `_.clone` except that it accepts `customizer` which * is invoked to produce the cloned value. If `customizer` returns `undefined` * cloning is handled by the method instead. The `customizer` is invoked with - * up to five arguments; (value [, index|key, object, stack]). + * up to four arguments; (value [, index|key, object, stack]). * * @static * @memberOf _ From 6cfe7fa5ea928d6ad9bc6adbd3f88b358cd55526 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 02:21:56 -0800 Subject: [PATCH 40/90] Move `forEach` and friends to the non-chaining section of the `lodash` doc note. [ci skip] --- lodash.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lodash.js b/lodash.js index 34fa23a02e..bd39d38791 100644 --- a/lodash.js +++ b/lodash.js @@ -1376,8 +1376,7 @@ * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`, - * `flowRight`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, - * `forOwnRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, + * `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invokeMap`, * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`, @@ -1397,22 +1396,23 @@ * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`, * `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, - * `findLast`, `findLastIndex`, `findLastKey`, `floor`, `get`, `gt`, `gte`, - * `has`, `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, - * `invoke`, `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, - * `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, - * `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, - * `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, - * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, - * `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`, `last`, - * `lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, - * `mean`, `min`, `minBy`, `noConflict`, `noop`, `now`, `pad`, `padEnd`, - * `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, - * `result`, `round`, `runInContext`, `sample`, `shift`, `size`, `snakeCase`, - * `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, - * `startCase`, `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, - * `toLower`, `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, - * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, + * `findLast`, `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, + * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, + * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, `isMatchWith`, + * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`, + * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isString`, `isUndefined`, + * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, + * `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, + * `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`, + * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, + * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, + * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, + * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toLower`, + * `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, + * `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, * `upperCase`, `upperFirst`, `value`, and `words` * * @name _ From 96bbf74207e003ff4ae94d66fb32ec33976866bd Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 07:54:39 -0800 Subject: [PATCH 41/90] Add `has` and `hasIn` to fp mapping. [closes #1805] --- lib/fp/mapping.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index f9d39a46f1..b3df474f0b 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -83,14 +83,15 @@ module.exports = { 'curryN,curryRightN,debounce,defaults,defaultsDeep,delay,difference,drop,' + 'dropRight,dropRightWhile,dropWhile,endsWith,eq,every,extend,filter,find,' + 'find,findIndex,findKey,findLast,findLastIndex,findLastKey,flatMap,forEach,' + - 'forEachRight,forIn,forInRight,forOwn,forOwnRight,get,groupBy,gt,gte,includes,' + - 'indexBy,indexOf,intersection,invoke,invokeMap,isEqual,isMatch,lastIndexOf,' + - 'lt,lte,map,mapKeys,mapValues,matchesProperty,maxBy,mean,minBy,merge,omit,' + - 'orderBy,overArgs,pad,padLeft,padRight,parseInt,partition,pick,pull,pullAll,' + - 'pullAt,random,range,rangeRight,rearg,reject,remove,repeat,result,sampleSize,' + - 'some,sortBy,sortedIndexBy,sortedLastIndexBy,sortedUniqBy,split,startsWith,' + - 'subtract,sumBy,take,takeRight,takeRightWhile,takeWhile,throttle,times,' + - 'truncate,union,uniqBy,uniqWith,without,wrap,xor,zip,zipObject').split(','), + 'forEachRight,forIn,forInRight,forOwn,forOwnRight,get,groupBy,gt,gte,has,' + + 'hasIn,includes,indexBy,indexOf,intersection,invoke,invokeMap,isEqual,' + + 'isMatch,lastIndexOf,lt,lte,map,mapKeys,mapValues,matchesProperty,maxBy,' + + 'mean,minBy,merge,omit,orderBy,overArgs,pad,padLeft,padRight,parseInt,' + + 'partition,pick,pull,pullAll,pullAt,random,range,rangeRight,rearg,reject,' + + 'remove,repeat,result,sampleSize,some,sortBy,sortedIndexBy,sortedLastIndexBy,' + + 'sortedUniqBy,split,startsWith,subtract,sumBy,take,takeRight,takeRightWhile,' + + 'takeWhile,throttle,times,truncate,union,uniqBy,uniqWith,without,wrap,xor,' + + 'zip,zipObject').split(','), 3: ( 'assignWith,assignInWith,clamp,differenceBy,differenceWith,getOr,inRange,' + 'intersectionBy,intersectionWith,isEqualWith,isMatchWith,mergeWith,omitBy,' + From a62d70e80c541afe2477dea89893d6e7466abb68 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 16:18:42 -0800 Subject: [PATCH 42/90] Add jsdoc name tag for `flatMap`. [closes #1811] --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index bd39d38791..1c14a71116 100644 --- a/lodash.js +++ b/lodash.js @@ -7133,7 +7133,7 @@ /** * This method is the wrapper version of `_.flatMap`. * - * @static + * @name flatMap * @memberOf _ * @category Seq * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. From 0a3d7e7cbc316010a404d7dc6fd50cfda6c4fbe5 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 18:37:45 -0800 Subject: [PATCH 43/90] Revert lodash dev dep bump. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 28600c2212..319a10c589 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "istanbul": "0.4.2", "jquery": "^2.2.0", "jscs": "^2.8.0", - "lodash": "^4.0.0", + "lodash": "^3.10.1", "platform": "^1.3.1", "qunit-extras": "^1.4.5", "qunitjs": "~1.20.0", From 17b9646c0b1f5371cc04835e312567176d9301fd Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 20:41:53 -0800 Subject: [PATCH 44/90] Add test warning about the lodash dependency. --- test/test.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/test.js b/test/test.js index eb2eb35e18..8bb1cfdf9d 100644 --- a/test/test.js +++ b/test/test.js @@ -217,10 +217,18 @@ var QUnit = root.QUnit || (root.QUnit = load('../node_modules/qunitjs/qunit/qunit.js')); /** Load stable Lodash and QUnit Extras. */ - var lodashStable = root.lodashStable || load('../node_modules/lodash/lodash.js').noConflict(); - if (lodashStable) { - lodashStable = lodashStable.runInContext(root); + var lodashStable = root.lodashStable; + if (!lodashStable) { + try { + lodashStable = load('../node_modules/lodash/index.js'); + } catch (e) { + console.log('Error: The stable lodash dev dependency should be at least a version behind master branch.'); + return; + } + lodashStable = lodashStable.noConflict(); } + lodashStable = lodashStable.runInContext(root); + var QUnitExtras = load('../node_modules/qunit-extras/qunit-extras.js'); if (QUnitExtras) { QUnitExtras.runInContext(root); From 2e02636fc110e71c7793979c9451828c58b17ffe Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 21:29:44 -0800 Subject: [PATCH 45/90] Revert lodash path in test/index.html. --- test/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/index.html b/test/index.html index 047437f2b4..00cadc6068 100644 --- a/test/index.html +++ b/test/index.html @@ -22,7 +22,7 @@ }; } - + From fdea9a447f5f6ef2805af64fb0a0c9310057c715 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 21:43:53 -0800 Subject: [PATCH 46/90] Revert`_Symbol` rename. --- lodash.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lodash.js b/lodash.js index 1c14a71116..41e1581cfb 100644 --- a/lodash.js +++ b/lodash.js @@ -1284,14 +1284,14 @@ ); /** Built-in value references. */ - var _Symbol = context.Symbol, - Reflect = context.Reflect, + var Reflect = context.Reflect, + Symbol = context.Symbol, Uint8Array = context.Uint8Array, clearTimeout = context.clearTimeout, enumerate = Reflect ? Reflect.enumerate : undefined, getPrototypeOf = Object.getPrototypeOf, getOwnPropertySymbols = Object.getOwnPropertySymbols, - iteratorSymbol = typeof (iteratorSymbol = _Symbol && _Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined, + iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined, propertyIsEnumerable = objectProto.propertyIsEnumerable, setTimeout = context.setTimeout, splice = arrayProto.splice; @@ -1322,9 +1322,9 @@ setCtorString = Set ? funcToString.call(Set) : ''; /** Used to convert symbols to primitives and strings. */ - var symbolProto = _Symbol ? _Symbol.prototype : undefined, - symbolValueOf = _Symbol ? symbolProto.valueOf : undefined, - symbolToString = _Symbol ? symbolProto.toString : undefined; + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = Symbol ? symbolProto.valueOf : undefined, + symbolToString = Symbol ? symbolProto.toString : undefined; /** Used to lookup unminified function names. */ var realNames = {}; @@ -3689,7 +3689,7 @@ * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { - return _Symbol ? Object(symbolValueOf.call(symbol)) : {}; + return Symbol ? Object(symbolValueOf.call(symbol)) : {}; } /** @@ -4577,7 +4577,7 @@ equalFunc(convert(object), convert(other), customizer, bitmask | UNORDERED_COMPARE_FLAG); case symbolTag: - return !!_Symbol && (symbolValueOf.call(object) == symbolValueOf.call(other)); + return !!Symbol && (symbolValueOf.call(object) == symbolValueOf.call(other)); } return false; } @@ -10354,7 +10354,7 @@ return ''; } if (isSymbol(value)) { - return _Symbol ? symbolToString.call(value) : ''; + return Symbol ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; From f6c6de40f1c9b229fe7f369af98a96c19fa4c6fc Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 22:42:08 -0800 Subject: [PATCH 47/90] Update fp mapping with a test to catch potentially missed wrappers. --- lib/fp/baseConvert.js | 5 +++- lib/fp/mapping.js | 63 +++++++++++++++++++++++++------------------ test/test-fp.js | 16 +++++++++++ 3 files changed, 57 insertions(+), 27 deletions(-) diff --git a/lib/fp/baseConvert.js b/lib/fp/baseConvert.js index 3c50222b33..5d9c305c89 100644 --- a/lib/fp/baseConvert.js +++ b/lib/fp/baseConvert.js @@ -99,7 +99,10 @@ function baseConvert(util, name, func) { var wrappers = { 'iteratee': function(iteratee) { - return function(func, arity) { + return function() { + var func = arguments[0], + arity = arguments[1]; + arity = arity > 2 ? (arity - 2) : 1; func = iteratee(func); var length = func.length; diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index b3df474f0b..916a5b92a5 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -74,31 +74,42 @@ module.exports = { /** Used to map ary to method names. */ 'aryMethod': { - 1: ( - 'attempt,ceil,create,curry,curryRight,floor,fromPairs,iteratee,invert,over,' + - 'overEvery,overSome,memoize,method,methodOf,mixin,rest,reverse,round,' + - 'runInContext,template,trim,trimLeft,trimRight,uniqueId,words').split(','), - 2: ( - 'add,ary,assign,at,bind,bindKey,chunk,cloneDeepWith,cloneWith,concat,countBy,', - 'curryN,curryRightN,debounce,defaults,defaultsDeep,delay,difference,drop,' + - 'dropRight,dropRightWhile,dropWhile,endsWith,eq,every,extend,filter,find,' + - 'find,findIndex,findKey,findLast,findLastIndex,findLastKey,flatMap,forEach,' + - 'forEachRight,forIn,forInRight,forOwn,forOwnRight,get,groupBy,gt,gte,has,' + - 'hasIn,includes,indexBy,indexOf,intersection,invoke,invokeMap,isEqual,' + - 'isMatch,lastIndexOf,lt,lte,map,mapKeys,mapValues,matchesProperty,maxBy,' + - 'mean,minBy,merge,omit,orderBy,overArgs,pad,padLeft,padRight,parseInt,' + - 'partition,pick,pull,pullAll,pullAt,random,range,rangeRight,rearg,reject,' + - 'remove,repeat,result,sampleSize,some,sortBy,sortedIndexBy,sortedLastIndexBy,' + - 'sortedUniqBy,split,startsWith,subtract,sumBy,take,takeRight,takeRightWhile,' + - 'takeWhile,throttle,times,truncate,union,uniqBy,uniqWith,without,wrap,xor,' + - 'zip,zipObject').split(','), - 3: ( - 'assignWith,assignInWith,clamp,differenceBy,differenceWith,getOr,inRange,' + - 'intersectionBy,intersectionWith,isEqualWith,isMatchWith,mergeWith,omitBy,' + - 'pickBy,pullAllBy,reduce,reduceRight,replace,set,slice,transform,unionBy,' + - 'unionWith,xorBy,xorWith,zipWith').split(','), - 4: - ['fill', 'setWith'] + 1:[ + 'attempt', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'fromPairs', + 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin', 'over', + 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext', + 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'unset', 'words' + ], + 2:[ + 'add', 'after', 'ary', 'assign', 'at', 'before', 'bind', 'bindKey', + 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', + 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', + 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', + 'every', 'extend', 'filter', 'find', 'find', 'findIndex', 'findKey', + 'findLast', 'findLastIndex', 'findLastKey', 'flatMap', 'forEach', + 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', + 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', + 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', + 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', + 'mean', 'merge', 'minBy', 'omit', 'orderBy', 'overArgs', 'pad', 'padEnd', + 'padStart', 'parseInt', 'partition', 'pick', 'pull', 'pullAll', 'pullAt', + 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', 'repeat', + 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', + 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', 'split', 'startsWith', + 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', + 'tap', 'throttle', 'thru', 'times', 'truncate', 'union', 'uniqBy', 'uniqWith', + 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject' + ], + 3:[ + 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', + 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith', + 'isMatchWith', 'mergeWith', 'omitBy', 'pickBy', 'pullAllBy', 'reduce', + 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', + 'transform', 'unionBy', 'unionWith', 'xorBy', 'xorWith', 'zipWith' + ], + 4:[ + 'fill', 'setWith' + ] }, /** Used to map ary to rearg configs by method ary. */ @@ -119,7 +130,7 @@ module.exports = { 'transform': [2, 0, 1] }, - /** Used to iterate `mapping.aryMethodMap` keys. */ + /** Used to iterate `mapping.aryMethod` keys. */ 'caps': [1, 2, 3, 4], /** Used to map keys to other keys. */ diff --git a/test/test-fp.js b/test/test-fp.js index 3ee4e07e31..e602236264 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -67,6 +67,22 @@ console.log('Running lodash/fp tests.'); + QUnit.module('method arity checks'); + + (function() { + QUnit.test('should wrap methods with an arity > `1`', function(assert) { + assert.expect(1); + + var methodNames = _.filter(_.functions(fp), function(methodName) { + return fp[methodName].length > 1; + }); + + assert.deepEqual(methodNames, []); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('method aliases'); (function() { From 6949f715164bca24d216467488c253645bb097be Mon Sep 17 00:00:00 2001 From: Steven Sojka Date: Fri, 15 Jan 2016 13:29:02 -0600 Subject: [PATCH 48/90] Ensure `getFuncName` works when checking methods that shadow `Object.prototype`. --- lodash.js | 2 +- test/test.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 41e1581cfb..f63d1ee180 100644 --- a/lodash.js +++ b/lodash.js @@ -4678,7 +4678,7 @@ function getFuncName(func) { var result = (func.name + ''), array = realNames[result], - length = array ? array.length : 0; + length = hasOwnProperty.call(realNames, result) ? array.length : 0; while (length--) { var data = array[length], diff --git a/test/test.js b/test/test.js index 8bb1cfdf9d..d79e128b0c 100644 --- a/test/test.js +++ b/test/test.js @@ -3475,6 +3475,18 @@ assert.deepEqual(c(3), expected); assert.deepEqual(d(), expected); }); + + QUnit.test('should work when a function name matches function name on Object.prototype', function(assert) { + assert.expect(1); + + var curried = _.curry(function hasOwnProperty(a, b, c) { + return [a, b, c]; + }); + + var expected = [1, 2, 3]; + + assert.deepEqual(curried(1)(2)(3), expected); + }); }()); /*--------------------------------------------------------------------------*/ From 6bc0aba800a9313f337de7e7d3e236de9989b28e Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 22:56:38 -0800 Subject: [PATCH 49/90] Avoid chatty console.log. --- test/test-fp.js | 5 ++++- test/test.js | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/test-fp.js b/test/test-fp.js index e602236264..a7f791bb54 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -15,6 +15,7 @@ /** Method and object shortcuts. */ var phantom = root.phantom, amd = root.define && define.amd, + argv = root.process && process.argv, document = !phantom && root.document, noop = function() {}, slice = arrayProto.slice, @@ -65,7 +66,9 @@ /*--------------------------------------------------------------------------*/ - console.log('Running lodash/fp tests.'); + if (argv) { + console.log('Running lodash/fp tests.'); + } QUnit.module('method arity checks'); diff --git a/test/test.js b/test/test.js index d79e128b0c..6ed4e38572 100644 --- a/test/test.js +++ b/test/test.js @@ -636,9 +636,8 @@ /*--------------------------------------------------------------------------*/ - console.log('Running lodash tests.'); - if (params) { + console.log('Running lodash tests.'); console.log('test.js invoked with arguments: ' + JSON.stringify(slice.call(params))); } From c0a6f051fcc5a49820e36f41539e1927bbc2d7b4 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 22:57:35 -0800 Subject: [PATCH 50/90] Move `getFuncName` test. --- test/test.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/test.js b/test/test.js index 6ed4e38572..04ae0a5659 100644 --- a/test/test.js +++ b/test/test.js @@ -3474,18 +3474,6 @@ assert.deepEqual(c(3), expected); assert.deepEqual(d(), expected); }); - - QUnit.test('should work when a function name matches function name on Object.prototype', function(assert) { - assert.expect(1); - - var curried = _.curry(function hasOwnProperty(a, b, c) { - return [a, b, c]; - }); - - var expected = [1, 2, 3]; - - assert.deepEqual(curried(1)(2)(3), expected); - }); }()); /*--------------------------------------------------------------------------*/ @@ -3663,6 +3651,18 @@ assert.deepEqual(actual, expected); }); }); + + QUnit.test('`_.' + methodName + '` should work for function names that shadow those on `Object.prototype`', function(assert) { + assert.expect(1); + + var curried = _.curry(function hasOwnProperty(a, b, c) { + return [a, b, c]; + }); + + var expected = [1, 2, 3]; + + assert.deepEqual(curried(1)(2)(3), expected); + }); }); /*--------------------------------------------------------------------------*/ From 6ecc6756708fd86da54ec0a6da27bf3fe4b48616 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 23:36:29 -0800 Subject: [PATCH 51/90] Ensure Backbone test only adds missing methods. --- test/backbone.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/backbone.html b/test/backbone.html index 02687d0f65..d41900edbf 100644 --- a/test/backbone.html +++ b/test/backbone.html @@ -41,7 +41,7 @@ return function(_) { lodash.defaultsDeep(_, { 'templateSettings': lodash.templateSettings }); - lodash.mixin(_, lodash.pick(lodash, [ + lodash.mixin(_, lodash.pick(lodash, lodash.difference([ 'countBy', 'debounce', 'difference', @@ -58,7 +58,7 @@ 'reject', 'sample', 'without' - ])); + ], lodash.functions(_)))); lodash.forOwn(keyMap, function(realName, otherName) { _[otherName] = lodash[realName]; From 0edbd96bb582c155edd19d75e658f136fd28cbfa Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 23:36:56 -0800 Subject: [PATCH 52/90] Ensure `mixinPrereqs` is called before Backbone is loaded. --- test/backbone.html | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/test/backbone.html b/test/backbone.html index d41900edbf..78682abdbf 100644 --- a/test/backbone.html +++ b/test/backbone.html @@ -145,24 +145,22 @@ QUnit.config.autostart = false; - require(getConfig(), ['underscore', 'backbone'], function(lodash) { + require(getConfig(), ['underscore'], function(lodash) { mixinPrereqs(lodash); - - if (ui.isModularize) { - window._ = lodash; - } - require(getConfig(), [ - 'test/setup/dom-setup', - 'test/setup/environment', - 'test/noconflict', - 'test/events', - 'test/model', - 'test/collection', - 'test/router', - 'test/view', - 'test/sync' - ], function() { - QUnit.start(); + require(getConfig(), ['backbone'], function() { + require(getConfig(), [ + 'test/setup/dom-setup', + 'test/setup/environment', + 'test/noconflict', + 'test/events', + 'test/model', + 'test/collection', + 'test/router', + 'test/view', + 'test/sync' + ], function() { + QUnit.start(); + }); }); }); }()); From 6bc58a16f604600a987d56d46418b9e37d5e4232 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 23:38:42 -0800 Subject: [PATCH 53/90] Remove conditional exposure. --- test/index.html | 5 ++--- test/underscore.html | 4 ---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/test/index.html b/test/index.html index 00cadc6068..26ad54d9fa 100644 --- a/test/index.html +++ b/test/index.html @@ -282,9 +282,8 @@ underscoreModule = underscore.result(underscore, 'noConflict') || underscore; underscoreModule.moduleName = 'underscore'; } - if (ui.isModularize) { - window._ = lodash; - } + window._ = lodash; + if (ui.isModularize) { require(getConfig(), [ 'lodash/internal/baseEach', diff --git a/test/underscore.html b/test/underscore.html index 468fef3ecc..c9d95f23e5 100644 --- a/test/underscore.html +++ b/test/underscore.html @@ -455,10 +455,6 @@ require(getConfig(), [moduleId], function(lodash) { mixinPrereqs(lodash); - - if (ui.isModularize) { - window._ = lodash; - } require(getConfig(), [ 'test/collections', 'test/arrays', From b77248c97546615a06fe1375cf051d2672eb2203 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 23:46:59 -0800 Subject: [PATCH 54/90] Minor cleanup of contributing.md. [ci skip] --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2082fd817c..a4b7ddda1b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,10 +6,10 @@ your issue may have already been discussed or fixed in `master`. To contribute, ## Tests Include updated unit tests in the `test` directory as part of your pull request. -Don’t worry about regenerating the documentation, lodash.js, or lodash.min.js. +Don’t worry about regenerating the `dist/` or `doc/` files. Before running the unit tests you’ll need to install, `npm i`, [development dependencies](https://docs.npmjs.com/files/package.json#devdependencies). -Run unit tests from the command-line via `npm test`, or open `test/index.html` and `test/fp.html` in a web browser. +Run unit tests from the command-line via `npm test`, or open `test/index.html` & `test/fp.html` in a web browser. The [Backbone](http://backbonejs.org/) & [Underscore](http://underscorejs.org/) test suites are included as well. ## Contributor License Agreement From 67cd43d97a321177d97ba6bc54b1fb118cf7532f Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 16 Jan 2016 00:30:55 -0800 Subject: [PATCH 55/90] Reduce description mentions of `eachFunc`. [ci skip] --- lodash.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lodash.js b/lodash.js index f63d1ee180..f7287f25d8 100644 --- a/lodash.js +++ b/lodash.js @@ -693,7 +693,7 @@ /** * The base implementation of methods like `_.find` and `_.findKey`, without * support for iteratee shorthands, which iterates over `collection` using - * the provided `eachFunc`. + * `eachFunc`. * * @private * @param {Array|Object} collection The collection to search. @@ -761,8 +761,7 @@ /** * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using the provided - * `eachFunc`. + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. * * @private * @param {Array|Object} collection The collection to iterate over. From 473d059efd21a86655b615e81193a646c21b18e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Mej=C3=ADa?= Date: Sat, 16 Jan 2016 14:31:16 +0100 Subject: [PATCH 56/90] Fix `_.map` doc example. [ci skip] --- lodash.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lodash.js b/lodash.js index f7287f25d8..1501f1f5ba 100644 --- a/lodash.js +++ b/lodash.js @@ -7690,11 +7690,11 @@ * return n * n; * } * - * _.map([1, 2], square); - * // => [3, 6] + * _.map([4, 8], square); + * // => [16, 64] * - * _.map({ 'a': 1, 'b': 2 }, square); - * // => [3, 6] (iteration order is not guaranteed) + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) * * var users = [ * { 'user': 'barney' }, From 2fb778413b5dd0494dc5598b60d694cd7d8b5ed4 Mon Sep 17 00:00:00 2001 From: think2011 <452125301@qq.com> Date: Sun, 17 Jan 2016 12:08:35 +0800 Subject: [PATCH 57/90] Fix returns tag typo in `_.toLength` docs. [ci skip] --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 1501f1f5ba..4f3d046b27 100644 --- a/lodash.js +++ b/lodash.js @@ -10214,7 +10214,7 @@ * @memberOf _ * @category Lang * @param {*} value The value to convert. - * @return {number} Returns the converted integer. + * @returns {number} Returns the converted integer. * @example * * _.toLength(3); From 759a44e2b807557d4b254141da0c6c9d0bfd0b63 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 24 Jan 2016 15:05:49 -0800 Subject: [PATCH 58/90] Move `omitBy` and `pickBy` to `aryMethod[2]` mapping. [closes #1819] --- lib/fp/mapping.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index 916a5b92a5..6e3af7d750 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -91,19 +91,19 @@ module.exports = { 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', - 'mean', 'merge', 'minBy', 'omit', 'orderBy', 'overArgs', 'pad', 'padEnd', - 'padStart', 'parseInt', 'partition', 'pick', 'pull', 'pullAll', 'pullAt', - 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', 'repeat', - 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', - 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', 'split', 'startsWith', - 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', - 'tap', 'throttle', 'thru', 'times', 'truncate', 'union', 'uniqBy', 'uniqWith', - 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject' + 'mean', 'merge', 'minBy', 'omit', 'omitBy', 'orderBy', 'overArgs', 'pad', + 'padEnd', 'padStart', 'parseInt', 'partition', 'pick', 'pickBy', 'pull', + 'pullAll', 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', + 'remove', 'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', + 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', + 'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', + 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'truncate', 'union', 'uniqBy', + 'uniqWith', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject' ], 3:[ 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith', - 'isMatchWith', 'mergeWith', 'omitBy', 'pickBy', 'pullAllBy', 'reduce', + 'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'xorBy', 'xorWith', 'zipWith' ], From cacae31af343be51897b8c7703e45a2bbcddc5f2 Mon Sep 17 00:00:00 2001 From: Benjamin Tan Date: Sun, 17 Jan 2016 20:36:02 +0800 Subject: [PATCH 59/90] Minor documentation fixes for `stringSize`, `_.cond`, `_.intersection`, and `_.reverse`. [ci skip] --- lodash.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 4f3d046b27..2c026490c2 100644 --- a/lodash.js +++ b/lodash.js @@ -1168,6 +1168,7 @@ /** * Gets the number of symbols in `string`. * + * @private * @param {string} string The string to inspect. * @returns {number} Returns the string size. */ @@ -5858,6 +5859,7 @@ * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of shared values. * @example + * * _.intersection([2, 1], [4, 2], [1, 2]); * // => [2] */ @@ -6174,6 +6176,7 @@ * **Note:** This method mutates `array` and is based on * [`Array#reverse`](https://mdn.io/Array/reverse). * + * @static * @memberOf _ * @category Array * @returns {Array} Returns `array`. @@ -12857,7 +12860,7 @@ * [_.matches({ 'a': 1 }), _.constant('matches A')], * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], * [_.constant(true), _.constant('no match')] - * ]) + * ]); * * func({ 'a': 1, 'b': 2 }); * // => 'matches A' From 9d033247e961bdda09a9295910fc647bd32b1b65 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 17 Jan 2016 23:08:58 -0600 Subject: [PATCH 60/90] Correct arg count in `_.isEqualWit` doc note. [ci skip] --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 2c026490c2..062a45d17e 100644 --- a/lodash.js +++ b/lodash.js @@ -9496,7 +9496,7 @@ /** * This method is like `_.isEqual` except that it accepts `customizer` which is * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: + * handled by the method instead. The `customizer` is invoked with up to six arguments: * (objValue, othValue [, index|key, object, other, stack]). * * @static From 8858cdbe8c8b94b9cb67cf38a37e4d36b9a28e82 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 18 Jan 2016 00:15:08 -0600 Subject: [PATCH 61/90] Move position of `_.keyBy` doc example. [ci skip] --- lodash.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lodash.js b/lodash.js index 062a45d17e..8df06c244d 100644 --- a/lodash.js +++ b/lodash.js @@ -7655,13 +7655,13 @@ * { 'dir': 'right', 'code': 100 } * ]; * - * _.keyBy(keyData, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - * * _.keyBy(keyData, function(o) { * return String.fromCharCode(o.code); * }); * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(keyData, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ var keyBy = createAggregator(function(result, value, key) { result[key] = value; From aa311bd7923aaa3c3c206a03523415f353c91428 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 24 Jan 2016 15:07:04 -0800 Subject: [PATCH 62/90] Move `unset` to `aryMethod[2]` mapping. --- lib/fp/mapping.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index 6e3af7d750..4297f06463 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -78,7 +78,7 @@ module.exports = { 'attempt', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext', - 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'unset', 'words' + 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words' ], 2:[ 'add', 'after', 'ary', 'assign', 'at', 'before', 'bind', 'bindKey', @@ -98,7 +98,7 @@ module.exports = { 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', 'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'truncate', 'union', 'uniqBy', - 'uniqWith', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject' + 'uniqWith', 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject' ], 3:[ 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', From 0c4595709628b5b3ef598a6ebb9e91b33646c9be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Mart=C3=ADn?= Date: Mon, 18 Jan 2016 18:32:10 +0100 Subject: [PATCH 63/90] Fix `iteratee` arg count in `_.partition` docs. [ci skip] If I am not mistaken, the docs for `partition` are wrong. It is only invoked with an argument, not three. See this fiddle https://jsfiddle.net/y8fcwa6m/ --- doc/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/README.md b/doc/README.md index 2846617923..7ffbc6aee7 100644 --- a/doc/README.md +++ b/doc/README.md @@ -2627,7 +2627,7 @@ _.orderBy(users, ['user', 'age'], ['asc', 'desc']); Creates an array of elements split into two groups, the first of which contains elements `predicate` returns truthy for, while the second of which contains elements `predicate` returns falsey for. The predicate is invoked -with three arguments: (value, index|key, collection). +with one argument: (value). #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. From 6d58fe912d2354755e3e73177bea9366b436b799 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 18 Jan 2016 22:09:01 -0600 Subject: [PATCH 64/90] Ensure `_.words` captures all caped words. [closes #1833] --- lodash.js | 1 + test/test.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 8df06c244d..109398f13b 100644 --- a/lodash.js +++ b/lodash.js @@ -221,6 +221,7 @@ rsUpper + '?' + rsLower + '+(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsUpperMisc + '+(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', rsUpper + '?' + rsLowerMisc + '+', + rsUpper + '+', rsDigits + '(?:' + rsLowerMisc + '+)?', rsEmoji ].join('|'), 'g'); diff --git a/test/test.js b/test/test.js index 04ae0a5659..c2683a4ade 100644 --- a/test/test.js +++ b/test/test.js @@ -22144,10 +22144,11 @@ }); QUnit.test('should work with compound words', function(assert) { - assert.expect(7); + assert.expect(8); assert.deepEqual(_.words('12Feet'), ['12', 'Feet']); assert.deepEqual(_.words('enable 24h format'), ['enable', '24h', 'format']); + assert.deepEqual(_.words('isISO8601'), ['is', 'ISO', '8601']); assert.deepEqual(_.words('tooLegit2Quit'), ['too', 'Legit', '2', 'Quit']); assert.deepEqual(_.words('walk500Miles'), ['walk', '500', 'Miles']); assert.deepEqual(_.words('xhr2Request'), ['xhr', '2', 'Request']); From 6296afd279b25831c692bd8f3f8f62d9561d5d98 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 18 Jan 2016 22:33:48 -0600 Subject: [PATCH 65/90] Ensure `_.words` treats all-lower and all-upper postfixs as separate words. --- lodash.js | 2 +- test/test.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lodash.js b/lodash.js index 109398f13b..ccef18956e 100644 --- a/lodash.js +++ b/lodash.js @@ -222,7 +222,7 @@ rsUpperMisc + '+(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', rsUpper + '?' + rsLowerMisc + '+', rsUpper + '+', - rsDigits + '(?:' + rsLowerMisc + '+)?', + rsDigits, rsEmoji ].join('|'), 'g'); diff --git a/test/test.js b/test/test.js index c2683a4ade..d1eaaa37ac 100644 --- a/test/test.js +++ b/test/test.js @@ -2048,9 +2048,9 @@ var actual = lodashStable.reduce(funcs, function(result, func) { return func(result); - }, 'enable 24h format'); + }, 'enable 6h format'); - assert.strictEqual(actual, 'enable24hFormat'); + assert.strictEqual(actual, 'enable6HFormat'); }); }()); @@ -2060,10 +2060,11 @@ (function() { QUnit.test('should work with numbers', function(assert) { - assert.expect(5); + assert.expect(6); assert.strictEqual(_.camelCase('12 feet'), '12Feet'); - assert.strictEqual(_.camelCase('enable 24h format'), 'enable24hFormat'); + assert.strictEqual(_.camelCase('enable 6h format'), 'enable6HFormat'); + assert.strictEqual(_.camelCase('enable 24H format'), 'enable24HFormat'); assert.strictEqual(_.camelCase('too legit 2 quit'), 'tooLegit2Quit'); assert.strictEqual(_.camelCase('walk 500 miles'), 'walk500Miles'); assert.strictEqual(_.camelCase('xhr2 request'), 'xhr2Request'); @@ -22144,10 +22145,11 @@ }); QUnit.test('should work with compound words', function(assert) { - assert.expect(8); + assert.expect(9); assert.deepEqual(_.words('12Feet'), ['12', 'Feet']); - assert.deepEqual(_.words('enable 24h format'), ['enable', '24h', 'format']); + assert.deepEqual(_.words('enable 6h format'), ['enable', '6', 'h', 'format']); + assert.deepEqual(_.words('enable 24H format'), ['enable', '24', 'H', 'format']); assert.deepEqual(_.words('isISO8601'), ['is', 'ISO', '8601']); assert.deepEqual(_.words('tooLegit2Quit'), ['too', 'Legit', '2', 'Quit']); assert.deepEqual(_.words('walk500Miles'), ['walk', '500', 'Miles']); From 68e0c78602a4d6e129e4252c6562cab340d1c0a1 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 19 Jan 2016 04:46:19 -0600 Subject: [PATCH 66/90] Remove `baseClone` use from `mergeDefaults`. --- lodash.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lodash.js b/lodash.js index ccef18956e..14bced1128 100644 --- a/lodash.js +++ b/lodash.js @@ -5122,9 +5122,7 @@ stack.set(srcValue, objValue); baseMerge(objValue, srcValue, undefined, mergeDefaults, stack); } - return objValue === undefined - ? baseClone(srcValue, undefined, undefined, key, object) - : objValue; + return objValue; } /** From bae497ec5ae4279b7f59eb9f016f5a65a9bf3b67 Mon Sep 17 00:00:00 2001 From: Billy Janitsch Date: Wed, 20 Jan 2016 18:23:44 -0500 Subject: [PATCH 67/90] Update fp `property` and `get` aliases. --- lib/fp/mapping.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index 4297f06463..e91a61144b 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -11,7 +11,7 @@ module.exports = { 'flowRight': ['compose'], 'forEach': ['each'], 'forEachRight': ['eachRight'], - 'get': ['path'], + 'get': ['path', 'prop'], 'getOr': ['pathOr'], 'head': ['first'], 'includes': ['contains'], @@ -24,7 +24,6 @@ module.exports = { 'overEvery': ['allPass'], 'overSome': ['somePass'], 'pick': ['pickAll'], - 'property': ['get'], 'propertyOf': ['propOf'], 'rest': ['unapply'], 'some': ['all'], From 01819e7a5a7829917ee8cf24bb1b3ea1d43b830a Mon Sep 17 00:00:00 2001 From: Billy Janitsch Date: Wed, 20 Jan 2016 18:26:38 -0500 Subject: [PATCH 68/90] Disable fp concat rearg. --- lib/fp/mapping.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index e91a61144b..daa122552a 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -180,6 +180,7 @@ module.exports = { 'skipRearg': { 'assign': true, 'assignIn': true, + 'concat': true, 'defaults': true, 'defaultsDeep': true, 'difference': true, From 9aa56630ab32c926113ba6f7b3a4fec810bc012a Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 20 Jan 2016 23:13:18 -0600 Subject: [PATCH 69/90] Ensure `_.noConflict` only restores `_` if `lodash` is the current `_` value. --- lodash.js | 4 +++- test/test.js | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 14bced1128..f511c67d6a 100644 --- a/lodash.js +++ b/lodash.js @@ -13230,7 +13230,9 @@ * var lodash = _.noConflict(); */ function noConflict() { - root._ = oldDash; + if (root._ === this) { + root._ = oldDash; + } return this; } diff --git a/test/test.js b/test/test.js index d1eaaa37ac..ff1f771f8a 100644 --- a/test/test.js +++ b/test/test.js @@ -14297,6 +14297,20 @@ } }); + QUnit.test('should restore `_` only if `lodash` is the current `_` value', function(assert) { + assert.expect(2); + + if (!isModularize) { + var object = root._ = {}; + assert.strictEqual(_.noConflict(), oldDash); + assert.strictEqual(root._, object); + root._ = oldDash; + } + else { + skipTest(assert, 2); + } + }); + QUnit.test('should work with a `root` of `this`', function(assert) { assert.expect(2); From a46169329d72e29ae0a6d6ed0741a3ee54d6ee99 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 20 Jan 2016 23:49:27 -0600 Subject: [PATCH 70/90] Fix fp test fails. --- test/test-fp.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/test-fp.js b/test/test-fp.js index a7f791bb54..2666ab4efe 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -44,8 +44,14 @@ QUnitExtras.runInContext(root); } - var convert = root.fp || load('../lib/fp/convert.js'), - mapping = root.mapping || load('../lib/fp/mapping.js'), + var convert = root.fp || (function() { + var baseConvert = load('../fp/_baseConvert.js'); + return function(name, func) { + return baseConvert(_, name, func); + }; + }()); + + var mapping = root.mapping || load('../fp/_mapping.js'), fp = convert(_.runInContext()); /*--------------------------------------------------------------------------*/ From 7544c8fac8b24c3cb275c2dcdd42b6704098726d Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 21 Jan 2016 00:46:55 -0600 Subject: [PATCH 71/90] Add `propOr` fp alias. --- lib/fp/mapping.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index daa122552a..ad6b68a0b4 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -12,7 +12,7 @@ module.exports = { 'forEach': ['each'], 'forEachRight': ['eachRight'], 'get': ['path', 'prop'], - 'getOr': ['pathOr'], + 'getOr': ['pathOr', 'propOr'], 'head': ['first'], 'includes': ['contains'], 'initial': ['init'], From 741a7b9caaa92ce42831ce1c619ac33ccf6cc71f Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 21 Jan 2016 01:03:05 -0600 Subject: [PATCH 72/90] Remove `mean` from fp `aryMethod` map. --- lib/fp/mapping.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index ad6b68a0b4..898188527d 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -90,10 +90,10 @@ module.exports = { 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', - 'mean', 'merge', 'minBy', 'omit', 'omitBy', 'orderBy', 'overArgs', 'pad', - 'padEnd', 'padStart', 'parseInt', 'partition', 'pick', 'pickBy', 'pull', - 'pullAll', 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', - 'remove', 'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', + 'merge', 'minBy', 'omit', 'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd', + 'padStart', 'parseInt', 'partition', 'pick', 'pickBy', 'pull', 'pullAll', + 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', + 'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', 'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'truncate', 'union', 'uniqBy', From 345746f7ab8b9ed1e9e2112315d8c087e23cc8a2 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 21 Jan 2016 01:05:11 -0600 Subject: [PATCH 73/90] Add another test to help catch incorrect fp mapping. --- test/test-fp.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/test-fp.js b/test/test-fp.js index 2666ab4efe..f76763de81 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -88,6 +88,23 @@ assert.deepEqual(methodNames, []); }); + + QUnit.test('should have >= arity of `aryMethod` designation', function(assert) { + assert.expect(4); + + _.times(4, function(index) { + var aryCap = index + 1; + + var methodNames = _.filter(mapping.aryMethod[aryCap], function(methodName) { + var key = _.result(mapping.key, methodName, methodName), + arity = _[key].length; + + return arity != 0 && arity < aryCap; + }); + + assert.deepEqual(methodNames, [], '`aryMethod[' + aryCap + ']`'); + }); + }); }()); /*--------------------------------------------------------------------------*/ From 78982f3074cbb1c9522ac8b9e3ebec269f94018c Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 21 Jan 2016 01:13:21 -0600 Subject: [PATCH 74/90] Ensure `_.concat` returns an empty array for nullish `array` values. [closes #1856] --- lodash.js | 3 +++ test/test.js | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lodash.js b/lodash.js index f511c67d6a..abded307b5 100644 --- a/lodash.js +++ b/lodash.js @@ -5336,6 +5336,9 @@ * // => [1] */ var concat = rest(function(array, values) { + if (array == null) { + return []; + } values = baseFlatten(values); return arrayConcat(isArray(array) ? array : [Object(array)], values); }); diff --git a/test/test.js b/test/test.js index ff1f771f8a..c3256fada1 100644 --- a/test/test.js +++ b/test/test.js @@ -2827,6 +2827,21 @@ assert.deepEqual(array, [1]); }); + QUnit.test('should return an empty array when `array` is nullish', function(assert) { + assert.expect(1); + + var values = [, null, undefined], + expected = lodashStable.map(values, alwaysEmptyArray); + + var actual = lodashStable.map(values, function(value, index) { + try { + return index ? _.concat(value) : _.concat(); + } catch (e) {} + }); + + assert.deepEqual(actual, expected); + }); + QUnit.test('should treat sparse arrays as dense', function(assert) { assert.expect(3); From 6cbd2c4188f42ccddc1a09ae24115132b77815ff Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 21 Jan 2016 11:15:37 -0600 Subject: [PATCH 75/90] Ensure `_.concat` treats nullish values as empty arrays. --- lodash.js | 6 +++--- test/test.js | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lodash.js b/lodash.js index abded307b5..e51356bfcd 100644 --- a/lodash.js +++ b/lodash.js @@ -5336,11 +5336,11 @@ * // => [1] */ var concat = rest(function(array, values) { - if (array == null) { - return []; + if (!isArray(array)) { + array = array == null ? [] : [Object(array)]; } values = baseFlatten(values); - return arrayConcat(isArray(array) ? array : [Object(array)], values); + return arrayConcat(array, values); }); /** diff --git a/test/test.js b/test/test.js index c3256fada1..605125d929 100644 --- a/test/test.js +++ b/test/test.js @@ -2842,6 +2842,21 @@ assert.deepEqual(actual, expected); }); + QUnit.test('should treat nullish `array` values as empty arrays', function(assert) { + assert.expect(1); + + var values = [null, undefined], + expected = lodashStable.map(values, lodashStable.constant([1, 2, [3]])); + + var actual = lodashStable.map(values, function(value) { + try { + return _.concat(value, 1, [2], [[3]]); + } catch (e) {} + }); + + assert.deepEqual(actual, expected); + }); + QUnit.test('should treat sparse arrays as dense', function(assert) { assert.expect(3); From 82b4f4147e35f96274e3543ce8857ac61dac3ad6 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 21 Jan 2016 11:47:44 -0600 Subject: [PATCH 76/90] Add fp `customizer` test for `_.setWith`. --- test/test-fp.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/test-fp.js b/test/test-fp.js index f76763de81..f8baa07510 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -904,7 +904,7 @@ object = { 'a': 1 }; QUnit.test('should provide the correct `customizer` arguments', function(assert) { - assert.expect(3); + assert.expect(4); var args, value = _.clone(object); @@ -939,6 +939,14 @@ args[5] = _.omitBy(args[5], _.isFunction); assert.deepEqual(args, expected, 'fp.mergeWith'); + + args = undefined; + value = _.clone(object); + actual = fp.setWith(function() { + args || (args = _.map(arguments, _.cloneDeep)); + }, 'b.c', 2, value); + + assert.deepEqual(args, [undefined, 'b', { 'a': 1 }], 'fp.setWith'); }); }()); From 68d023804496695c20ec3e5ffa9d300f7669eb7a Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 21 Jan 2016 11:48:12 -0600 Subject: [PATCH 77/90] Remove `omitBy` and `pickBy` from `funcMethods`. --- test/test-fp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test-fp.js b/test/test-fp.js index f8baa07510..0f9821c970 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -191,8 +191,8 @@ assert.expect(1); var funcMethods = [ - 'assignWith', 'extendWith', 'isEqualWith', 'isMatchWith', 'omitBy', - 'pickBy', 'reduce', 'reduceRight', 'transform', 'zipWith' + 'assignWith', 'extendWith', 'isEqualWith', 'isMatchWith', 'reduce', + 'reduceRight', 'transform', 'zipWith' ]; var expected = _.map(mapping.aryMethod[3], _.constant(true)); From b13b17e801dc1be3349bb1102beb6dde8c3f8052 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 21 Jan 2016 23:15:52 -0600 Subject: [PATCH 78/90] Ensure fp key methods provide the `key` argument to their iteratees. [closes #1842] --- lib/fp/baseConvert.js | 34 ++++++++++++++++++++-------------- lib/fp/mapping.js | 17 ++++++++++++----- test/test-fp.js | 31 +++++++++++++++++++++++-------- 3 files changed, 55 insertions(+), 27 deletions(-) diff --git a/lib/fp/baseConvert.js b/lib/fp/baseConvert.js index 5d9c305c89..ee3f7c6973 100644 --- a/lib/fp/baseConvert.js +++ b/lib/fp/baseConvert.js @@ -40,21 +40,16 @@ function baseConvert(util, name, func) { keys = _.keys, rearg = _.rearg; - var baseAry = function(func, n) { - return function() { - var args = arguments, - length = Math.min(args.length, n); + var baseArity = function(func, n) { + return n == 2 + ? function(a, b) { return func.apply(undefined, arguments); } + : function(a) { return func.apply(undefined, arguments); }; + }; - switch (length) { - case 1: return func(args[0]); - case 2: return func(args[0], args[1]); - } - args = Array(length); - while (length--) { - args[length] = arguments[length]; - } - return func.apply(undefined, args); - }; + var baseAry = function(func, n) { + return n == 2 + ? function(a, b) { return func(a, b); } + : function(a) { return func(a); }; }; var cloneArray = function(array) { @@ -83,6 +78,13 @@ function baseConvert(util, name, func) { }); }; + var iterateeRearg = function(func, indexes) { + return overArg(func, function(func) { + var n = indexes.length; + return baseArity(rearg(baseAry(func, n), indexes), n); + }); + }; + var overArg = function(func, iteratee, retArg) { return function() { var length = arguments.length, @@ -172,6 +174,10 @@ function baseConvert(util, name, func) { if (n) { result = iterateeAry(result, n); } + var indexes = mapping.iterateeRearg[name]; + if (indexes) { + result = iterateeRearg(result, indexes); + } if (cap > 1) { result = curry(result, cap); } diff --git a/lib/fp/mapping.js b/lib/fp/mapping.js index 898188527d..4f1e607ee0 100644 --- a/lib/fp/mapping.js +++ b/lib/fp/mapping.js @@ -102,23 +102,30 @@ module.exports = { 3:[ 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith', - 'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', - 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', - 'transform', 'unionBy', 'unionWith', 'xorBy', 'xorWith', 'zipWith' + 'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace', + 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', + 'unionWith', 'xorBy', 'xorWith', 'zipWith' ], 4:[ 'fill', 'setWith' ] }, - /** Used to map ary to rearg configs by method ary. */ + /** Used to map ary to rearg configs. */ 'aryRearg': { 2: [1, 0], 3: [2, 1, 0], 4: [3, 2, 0, 1] }, - /** Used to map ary to rearg configs by method names. */ + /** Used to map method names to iteratee rearg configs. */ + 'iterateeRearg': { + 'findKey': [1], + 'findLastKey': [1], + 'mapKeys': [1] + }, + + /** Used to map method names to rearg configs. */ 'methodRearg': { 'clamp': [2, 0, 1], 'reduce': [2, 0, 1], diff --git a/test/test-fp.js b/test/test-fp.js index 0f9821c970..41ff5d0b83 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -773,6 +773,26 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('key methods'); + + (function() { + var object = { 'a': 1 }; + + QUnit.test('should provide the correct `iteratee` arguments', function(assert) { + assert.expect(1); + + var args; + + var actual = fp.findKey(function() { + args || (args = _.map(arguments, _.cloneDeep)); + }, object); + + assert.deepEqual(args, ['a'], 'fp.findKey'); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('mutation methods'); (function() { @@ -909,18 +929,16 @@ var args, value = _.clone(object); - var actual = fp.assignWith(function(objValue, srcValue) { + var actual = fp.assignWith(function() { args || (args = _.map(arguments, _.cloneDeep)); - return srcValue; }, { 'b': 2 }, value); assert.deepEqual(args, [undefined, 2, 'b', { 'a': 1 }, { 'b': 2 }], 'fp.assignWith'); args = undefined; value = _.clone(object); - actual = fp.extendWith(function(objValue, srcValue) { + actual = fp.extendWith(function() { args || (args = _.map(arguments, _.cloneDeep)); - return srcValue; }, { 'b': 2 }, value); assert.deepEqual(args, [undefined, 2, 'b', { 'a': 1 }, { 'b': 2 }], 'fp.extendWith'); @@ -930,11 +948,8 @@ args = undefined; value = { 'a': [1] }; - actual = fp.mergeWith(function(objValue, srcValue) { + actual = fp.mergeWith(function() { args || (args = _.map(arguments, _.cloneDeep)); - if (_.isArray(objValue)) { - return objValue.concat(srcValue); - } }, { 'a': [2, 3] }, value); args[5] = _.omitBy(args[5], _.isFunction); From 42a4e09f916ab5cc1e7cd96556decc6acf6fa066 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 21 Jan 2016 23:16:10 -0600 Subject: [PATCH 79/90] Minor capitalization nit in readme. [ci skip] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cbcf3cce86..fa841b059e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ $ lodash core -o ./dist/lodash.core.js ## Module formats -lodash is also available in a variety of other builds & module formats. +Lodash is also available in a variety of other builds & module formats. * [lodash](https://www.npmjs.com/package/lodash) & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) packages * [lodash-amd](https://github.com/lodash/lodash/tree/4.0.0-amd) From 4e35d970af1ee4b91a32075ae75e7f0edc8c8c85 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 22 Jan 2016 00:17:24 -0600 Subject: [PATCH 80/90] Avoid setting ary twice. --- lib/fp/baseConvert.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/fp/baseConvert.js b/lib/fp/baseConvert.js index ee3f7c6973..7a187b9247 100644 --- a/lib/fp/baseConvert.js +++ b/lib/fp/baseConvert.js @@ -166,17 +166,17 @@ function baseConvert(util, name, func) { each(mapping.caps, function(cap) { each(mapping.aryMethod[cap], function(otherName) { if (name == otherName) { + var indexes = mapping.iterateeRearg[name], + n = !isLib && mapping.aryIteratee[name]; + result = ary(func, cap); if (cap > 1 && !mapping.skipRearg[name]) { result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[cap]); } - var n = !isLib && mapping.aryIteratee[name]; - if (n) { - result = iterateeAry(result, n); - } - var indexes = mapping.iterateeRearg[name]; if (indexes) { result = iterateeRearg(result, indexes); + } else if (n) { + result = iterateeAry(result, n); } if (cap > 1) { result = curry(result, cap); From 880ffcb1f6458be41220d34059abfe2e23d33645 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 22 Jan 2016 23:54:40 -0600 Subject: [PATCH 81/90] Add more fp tests for key methods. --- test/test-fp.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/test-fp.js b/test/test-fp.js index 41ff5d0b83..79e960150e 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -779,15 +779,17 @@ var object = { 'a': 1 }; QUnit.test('should provide the correct `iteratee` arguments', function(assert) { - assert.expect(1); + assert.expect(3); - var args; + _.each(['findKey', 'findLastKey', 'mapKeys'], function(methodName) { + var args; - var actual = fp.findKey(function() { - args || (args = _.map(arguments, _.cloneDeep)); - }, object); + var actual = fp[methodName](function() { + args || (args = slice.call(arguments)); + }, object); - assert.deepEqual(args, ['a'], 'fp.findKey'); + assert.deepEqual(args, ['a'], 'fp.' + methodName); + }); }); }()); From 5a9ca34a92ed66fb740892a9f88ffcc7338ec980 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 23 Jan 2016 20:01:58 -0800 Subject: [PATCH 82/90] Rename `initFromArray` and `initFromCollection` vars to `initAccum`. --- lodash.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lodash.js b/lodash.js index e51356bfcd..9909eefa0e 100644 --- a/lodash.js +++ b/lodash.js @@ -603,14 +603,14 @@ * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. - * @param {boolean} [initFromArray] Specify using the first element of `array` as the initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. * @returns {*} Returns the accumulated value. */ - function arrayReduce(array, iteratee, accumulator, initFromArray) { + function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array.length; - if (initFromArray && length) { + if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { @@ -627,12 +627,12 @@ * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. - * @param {boolean} [initFromArray] Specify using the last element of `array` as the initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as the initial value. * @returns {*} Returns the accumulated value. */ - function arrayReduceRight(array, iteratee, accumulator, initFromArray) { + function arrayReduceRight(array, iteratee, accumulator, initAccum) { var length = array.length; - if (initFromArray && length) { + if (initAccum && length) { accumulator = array[--length]; } while (length--) { @@ -768,14 +768,14 @@ * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. - * @param {boolean} initFromCollection Specify using the first or last element of `collection` as the initial value. + * @param {boolean} initAccum Specify using the first or last element of `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ - function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) { + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index, collection) { - accumulator = initFromCollection - ? (initFromCollection = false, value) + accumulator = initAccum + ? (initAccum = false, value) : iteratee(accumulator, value, index, collection); }); return accumulator; @@ -7832,9 +7832,9 @@ */ function reduce(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduce : baseReduce, - initFromCollection = arguments.length < 3; + initAccum = arguments.length < 3; - return func(collection, getIteratee(iteratee, 4), accumulator, initFromCollection, baseEach); + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); } /** @@ -7859,9 +7859,9 @@ */ function reduceRight(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduceRight : baseReduce, - initFromCollection = arguments.length < 3; + initAccum = arguments.length < 3; - return func(collection, getIteratee(iteratee, 4), accumulator, initFromCollection, baseEachRight); + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); } /** From 627e92e7e0e28968b3e0c3fa17d19e98ad7c2f54 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 23 Jan 2016 20:09:38 -0800 Subject: [PATCH 83/90] Remove empty line in `baseInvoke` jsdoc. [ci skip] --- lodash.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lodash.js b/lodash.js index 9909eefa0e..c7466d33fe 100644 --- a/lodash.js +++ b/lodash.js @@ -2673,7 +2673,6 @@ * The base implementation of `_.invoke` without support for individual * method arguments. * - * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. From e2280db917bd67656c6373c9915b86d8276dc260 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 24 Jan 2016 09:47:57 -0800 Subject: [PATCH 84/90] Fix documented iteratee arg count of `_.partition`. [ci skip] --- lodash.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lodash.js b/lodash.js index c7466d33fe..77914a788e 100644 --- a/lodash.js +++ b/lodash.js @@ -7757,9 +7757,9 @@ /** * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, while the second of which - * contains elements `predicate` returns falsey for. The predicate is invoked - * with three arguments: (value, index|key, collection). + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). * * @static * @memberOf _ From 3f1fd98bef797b8ff82b95c0b40a33851610e14d Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 24 Jan 2016 09:48:56 -0800 Subject: [PATCH 85/90] Doc cleanup of aggregator methods. [ci skip] --- lodash.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lodash.js b/lodash.js index 77914a788e..5915052334 100644 --- a/lodash.js +++ b/lodash.js @@ -7311,7 +7311,7 @@ * @memberOf _ * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * @@ -7535,14 +7535,14 @@ /** * Creates an object composed of keys generated from the results of running * each element of `collection` through `iteratee`. The corresponding value - * of each key is an array of the elements responsible for generating the key. + * of each key is an array of elements responsible for generating the key. * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * @@ -7647,7 +7647,7 @@ * @memberOf _ * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * From fcb80e926ddfcb13c3fba12b59777a11afcfc66c Mon Sep 17 00:00:00 2001 From: Esa-Matti Suuronen Date: Wed, 13 Jan 2016 23:01:03 +0200 Subject: [PATCH 86/90] Add precompile script for fp modules. --- lib/fp/convert.js | 2 +- lib/fp/{util.js => fp-util.js} | 0 lib/fp/precompile.js | 95 ++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 1 deletion(-) rename lib/fp/{util.js => fp-util.js} (100%) create mode 100644 lib/fp/precompile.js diff --git a/lib/fp/convert.js b/lib/fp/convert.js index 09626d8ebf..baee05bdb3 100644 --- a/lib/fp/convert.js +++ b/lib/fp/convert.js @@ -1,6 +1,6 @@ var _ = require('lodash'), baseConvert = require('./baseConvert.js'), - util = require('./util.js'); + util = require('./fp-util.js'); /** * Converts `func` of `name` to an auto-curried iteratee-first data-last version. diff --git a/lib/fp/util.js b/lib/fp/fp-util.js similarity index 100% rename from lib/fp/util.js rename to lib/fp/fp-util.js diff --git a/lib/fp/precompile.js b/lib/fp/precompile.js new file mode 100644 index 0000000000..f510f24264 --- /dev/null +++ b/lib/fp/precompile.js @@ -0,0 +1,95 @@ +var path = require('path'); +var Module = require('module'); +var _ = require('lodash/fp'); +var mutatingAssign = require('lodash').assign; +var fs = require('fs'); + +var collectionModules = [ + 'array.js', + 'collection.js', + 'date.js', + 'function.js', + 'lang.js', + 'math.js', + 'number.js', + 'object.js', + 'string.js', + 'util.js' +]; + +var utilityModules = [ + 'util.js', // XXX: Remove! Not actually an utility but a collection module but it interferes testing with the current releases... + 'lodash.js', + 'fp.js', + 'chain.js' +]; + +var lodashPath = path.dirname(Module._resolveFilename('lodash', mutatingAssign(new Module, { + 'paths': Module._nodeModulePaths(process.cwd()) +}))); + +var mapping = require(lodashPath + '/fp/mapping'); +var singleArgFns = mapping.aryMethodMap[1]; + +var extPattern = /\.js$/; +var isJSfile = extPattern.test.bind(extPattern); + +var removeJSExt = function(filename) { + return filename.replace(extPattern, ''); +}; + +var isCollectionModule = _.includes(_, collectionModules); +var isNotUtilityModule = _.negate(_.includes(_, utilityModules)); +var isSingleArgFn = _.includes(_, singleArgFns); + +var lodashModules = fs.readdirSync(lodashPath) + .filter(isJSfile) + .filter(isNotUtilityModule) + .map(removeJSExt); + +var convertTemplate = _.template( + "var convert = require('./convert');\n" + + "module.exports = convert('<%= name %>', require('../<%= name %>'));\n" +); + +var collectionTemplate = _.template( + "var convert = require('./convert');\n" + + "module.exports = convert(require('../<%= name %>'));\n" +); + +var passThroughTemplate = _.template( + "module.exports = require('../<%= name %>');\n" +); + +var moduleTemplate = function(name) { + var context = {name: name}; + + if (isCollectionModule(name + '.js')) { + return collectionTemplate(context); + } + if (isSingleArgFn(name)) { + return passThroughTemplate(context); + } + + return convertTemplate(context); +}; + +function precompileFpWrappers(target) { + _.forEach(function(moduleName) { + fs.writeFileSync( + path.join(target, moduleName + '.js'), + moduleTemplate(moduleName) + ); + }, lodashModules); + + _.forEach(function(aliases, origName) { + _.forEach(function aliasName() { + fs.writeFileSync( + path.join(target, aliasName + '.js'), + moduleTemplate(origName) + ); + }, aliases); + }, mapping.aliasMap); +} + +module.exports = precompileFpWrappers; From f555cd2303ed1c202ca2725a4097172c080cee1f Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 15 Jan 2016 01:15:47 -0800 Subject: [PATCH 87/90] Update map references in precompile.js. --- lib/fp/precompile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fp/precompile.js b/lib/fp/precompile.js index f510f24264..1923c5fcde 100644 --- a/lib/fp/precompile.js +++ b/lib/fp/precompile.js @@ -29,7 +29,7 @@ var lodashPath = path.dirname(Module._resolveFilename('lodash', mutatingAssign(n }))); var mapping = require(lodashPath + '/fp/mapping'); -var singleArgFns = mapping.aryMethodMap[1]; +var singleArgFns = mapping.aryMethod[1]; var extPattern = /\.js$/; var isJSfile = extPattern.test.bind(extPattern); @@ -89,7 +89,7 @@ function precompileFpWrappers(target) { moduleTemplate(origName) ); }, aliases); - }, mapping.aliasMap); + }, mapping.alias); } module.exports = precompileFpWrappers; From 9d2d4f39bc1af93809563a5f5555c6275bcce76a Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 16 Jan 2016 11:18:56 -0800 Subject: [PATCH 88/90] Reorg build, fp, and lib files. --- lib/fp/baseConvert.js => fp/_baseConvert.js | 2 +- fp/_convertBrowser.js | 13 +++ lib/fp/mapping.js => fp/_mapping.js | 0 lib/fp/{build.js => build-dist.js} | 6 +- lib/fp/convert.browser.js | 13 --- lib/fp/convert.js | 21 ----- lib/fp/convert.node.js | 16 ---- lib/fp/fp-util.js | 10 --- lib/fp/precompile.js | 95 --------------------- lib/fp/template/_util.jst | 10 +++ lib/fp/template/convert.jst | 16 ++++ lib/main/{build.js => build-dist.js} | 0 package.json | 3 +- 13 files changed, 45 insertions(+), 160 deletions(-) rename lib/fp/baseConvert.js => fp/_baseConvert.js (99%) create mode 100644 fp/_convertBrowser.js rename lib/fp/mapping.js => fp/_mapping.js (100%) rename lib/fp/{build.js => build-dist.js} (87%) delete mode 100644 lib/fp/convert.browser.js delete mode 100644 lib/fp/convert.js delete mode 100644 lib/fp/convert.node.js delete mode 100644 lib/fp/fp-util.js delete mode 100644 lib/fp/precompile.js create mode 100644 lib/fp/template/_util.jst create mode 100644 lib/fp/template/convert.jst rename lib/main/{build.js => build-dist.js} (100%) diff --git a/lib/fp/baseConvert.js b/fp/_baseConvert.js similarity index 99% rename from lib/fp/baseConvert.js rename to fp/_baseConvert.js index 7a187b9247..10a7d70bc1 100644 --- a/lib/fp/baseConvert.js +++ b/fp/_baseConvert.js @@ -1,4 +1,4 @@ -var mapping = require('./mapping.js'), +var mapping = require('./_mapping'), mutateMap = mapping.mutate, placeholder = {}; diff --git a/fp/_convertBrowser.js b/fp/_convertBrowser.js new file mode 100644 index 0000000000..b076778a4a --- /dev/null +++ b/fp/_convertBrowser.js @@ -0,0 +1,13 @@ +var baseConvert = require('./_baseConvert'); + +/** + * Converts `lodash` to an immutable auto-curried iteratee-first data-last version. + * + * @param {Function} lodash The lodash function. + * @returns {Function} Returns the converted `lodash`. + */ +function browserConvert(lodash) { + return baseConvert(lodash, lodash); +} + +module.exports = browserConvert; diff --git a/lib/fp/mapping.js b/fp/_mapping.js similarity index 100% rename from lib/fp/mapping.js rename to fp/_mapping.js diff --git a/lib/fp/build.js b/lib/fp/build-dist.js similarity index 87% rename from lib/fp/build.js rename to lib/fp/build-dist.js index db3fbe40bd..c88dd4e5c2 100644 --- a/lib/fp/build.js +++ b/lib/fp/build-dist.js @@ -2,7 +2,6 @@ var _ = require('lodash'), async = require('async'), - fs = require('fs-extra'), path = require('path'), webpack = require('webpack'); @@ -10,10 +9,11 @@ var minify = require('../common/minify.js'); var basePath = path.join(__dirname, '..', '..'), distPath = path.join(basePath, 'dist'), + fpPath = path.join(basePath, 'fp'), filename = 'lodash.fp.js'; var fpConfig = { - 'entry': path.join(__dirname, 'convert.browser.js'), + 'entry': path.join(fpPath, '_convertBrowser.js'), 'output': { 'path': distPath, 'filename': filename, @@ -27,7 +27,7 @@ var fpConfig = { }; var mappingConfig = { - 'entry': path.join(__dirname, 'mapping.js'), + 'entry': path.join(fpPath, '_mapping.js'), 'output': { 'path': distPath, 'filename': 'mapping.fp.js', diff --git a/lib/fp/convert.browser.js b/lib/fp/convert.browser.js deleted file mode 100644 index 6855f34f8a..0000000000 --- a/lib/fp/convert.browser.js +++ /dev/null @@ -1,13 +0,0 @@ -var baseConvert = require('./baseConvert.js'); - -/** - * Converts `lodash` to an auto-curried iteratee-first data-last version. - * - * @param {Function} lodash The lodash function. - * @returns {Function} Returns the converted lodash function. - */ -function browserConvert(lodash) { - return baseConvert(lodash, lodash); -} - -module.exports = browserConvert; diff --git a/lib/fp/convert.js b/lib/fp/convert.js deleted file mode 100644 index baee05bdb3..0000000000 --- a/lib/fp/convert.js +++ /dev/null @@ -1,21 +0,0 @@ -var _ = require('lodash'), - baseConvert = require('./baseConvert.js'), - util = require('./fp-util.js'); - -/** - * Converts `func` of `name` to an auto-curried iteratee-first data-last version. - * If `name` is an object, the methods on it will be converted and the object returned. - * - * @param {string} [name] The name of the function to wrap. - * @param {Function} [func] The function to wrap. - * @returns {Function|Object} Returns the converted function or object. - */ -function convert() { - var args = arguments, - name = args.length ? args[0] : _.noConflict().runInContext(), - func = args[1]; - - return baseConvert(util, name, func); -} - -module.exports = convert; diff --git a/lib/fp/convert.node.js b/lib/fp/convert.node.js deleted file mode 100644 index ef26d5cbfe..0000000000 --- a/lib/fp/convert.node.js +++ /dev/null @@ -1,16 +0,0 @@ -var baseConvert = require('./baseConvert.js'), - util = require('./util.js'); - -/** - * Converts `func` of `name` to an auto-curried iteratee-first data-last version. - * If `name` is an object, the methods on it will be converted and the object returned. - * - * @param {string} name The name of the function to wrap. - * @param {Function} func The function to wrap. - * @returns {Function|Object} Returns the converted function or object. - */ -function nodeConvert(name, func) { - return baseConvert(util, name, func); -} - -module.exports = nodeConvert; diff --git a/lib/fp/fp-util.js b/lib/fp/fp-util.js deleted file mode 100644 index 1ba696938d..0000000000 --- a/lib/fp/fp-util.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - 'ary': require('lodash/ary'), - 'cloneDeep': require('lodash/cloneDeep'), - 'curry': require('lodash/curry'), - 'forEach': require('lodash/internal/arrayEach'), - 'isFunction': require('lodash/isFunction'), - 'iteratee': require('lodash/iteratee'), - 'keys': require('lodash/internal/baseKeys'), - 'rearg': require('lodash/rearg') -}; diff --git a/lib/fp/precompile.js b/lib/fp/precompile.js deleted file mode 100644 index 1923c5fcde..0000000000 --- a/lib/fp/precompile.js +++ /dev/null @@ -1,95 +0,0 @@ -var path = require('path'); -var Module = require('module'); -var _ = require('lodash/fp'); -var mutatingAssign = require('lodash').assign; -var fs = require('fs'); - -var collectionModules = [ - 'array.js', - 'collection.js', - 'date.js', - 'function.js', - 'lang.js', - 'math.js', - 'number.js', - 'object.js', - 'string.js', - 'util.js' -]; - -var utilityModules = [ - 'util.js', // XXX: Remove! Not actually an utility but a collection module but it interferes testing with the current releases... - 'lodash.js', - 'fp.js', - 'chain.js' -]; - -var lodashPath = path.dirname(Module._resolveFilename('lodash', mutatingAssign(new Module, { - 'paths': Module._nodeModulePaths(process.cwd()) -}))); - -var mapping = require(lodashPath + '/fp/mapping'); -var singleArgFns = mapping.aryMethod[1]; - -var extPattern = /\.js$/; -var isJSfile = extPattern.test.bind(extPattern); - -var removeJSExt = function(filename) { - return filename.replace(extPattern, ''); -}; - -var isCollectionModule = _.includes(_, collectionModules); -var isNotUtilityModule = _.negate(_.includes(_, utilityModules)); -var isSingleArgFn = _.includes(_, singleArgFns); - -var lodashModules = fs.readdirSync(lodashPath) - .filter(isJSfile) - .filter(isNotUtilityModule) - .map(removeJSExt); - -var convertTemplate = _.template( - "var convert = require('./convert');\n" + - "module.exports = convert('<%= name %>', require('../<%= name %>'));\n" -); - -var collectionTemplate = _.template( - "var convert = require('./convert');\n" + - "module.exports = convert(require('../<%= name %>'));\n" -); - -var passThroughTemplate = _.template( - "module.exports = require('../<%= name %>');\n" -); - -var moduleTemplate = function(name) { - var context = {name: name}; - - if (isCollectionModule(name + '.js')) { - return collectionTemplate(context); - } - if (isSingleArgFn(name)) { - return passThroughTemplate(context); - } - - return convertTemplate(context); -}; - -function precompileFpWrappers(target) { - _.forEach(function(moduleName) { - fs.writeFileSync( - path.join(target, moduleName + '.js'), - moduleTemplate(moduleName) - ); - }, lodashModules); - - _.forEach(function(aliases, origName) { - _.forEach(function aliasName() { - fs.writeFileSync( - path.join(target, aliasName + '.js'), - moduleTemplate(origName) - ); - }, aliases); - }, mapping.alias); -} - -module.exports = precompileFpWrappers; diff --git a/lib/fp/template/_util.jst b/lib/fp/template/_util.jst new file mode 100644 index 0000000000..1fb05e435b --- /dev/null +++ b/lib/fp/template/_util.jst @@ -0,0 +1,10 @@ +module.exports = { + 'ary': require('../ary'), + 'cloneDeep': require('../cloneDeep'), + 'curry': require('../curry'), + 'forEach': require('../internal/arrayEach'), + 'isFunction': require('../isFunction'), + 'iteratee': require('../iteratee'), + 'keys': require('../internal/baseKeys'), + 'rearg': require('../rearg') +}; diff --git a/lib/fp/template/convert.jst b/lib/fp/template/convert.jst new file mode 100644 index 0000000000..85f3b7535e --- /dev/null +++ b/lib/fp/template/convert.jst @@ -0,0 +1,16 @@ +var baseConvert = require('./_baseConvert'), + util = require('./_util'); + +/** + * Converts `func` of `name` to an immutable auto-curried iteratee-first data-last + * version. If `name` is an object its methods will be converted. + * + * @param {string} name The name of the function to wrap. + * @param {Function} [func] The function to wrap. + * @returns {Function|Object} Returns the converted function or object. + */ +function convert(name, func) { + return baseConvert(util, name, func); +} + +module.exports = convert; diff --git a/lib/main/build.js b/lib/main/build-dist.js similarity index 100% rename from lib/main/build.js rename to lib/main/build-dist.js diff --git a/package.json b/package.json index 319a10c589..e832b98b0d 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "dojo": "^1.10.4", "ecstatic": "^1.4.0", "fs-extra": "~0.26.4", + "glob": "^6.0.4", "istanbul": "0.4.2", "jquery": "^2.2.0", "jscs": "^2.8.0", @@ -27,7 +28,7 @@ "webpack": "^1.12.11" }, "scripts": { - "build": "node lib/main/build.js && node lib/fp/build.js", + "build": "node lib/main/build-dist.js && node lib/fp/build-dist.js", "style": "jscs lodash.js lib/**/*.js", "test": "npm run build && node test/test && node test/test-fp" } From 59de939c1d27381e12d36159207e8618f138ddf7 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 24 Jan 2016 16:48:21 -0800 Subject: [PATCH 89/90] Rebuild lodash and docs. --- README.md | 6 +- dist/lodash.core.js | 84 ++-- dist/lodash.core.min.js | 18 +- dist/lodash.fp.js | 195 +++++---- dist/lodash.fp.min.js | 19 +- dist/lodash.js | 276 +++++++------ dist/lodash.min.js | 121 +++--- dist/mapping.fp.js | 126 ++++-- doc/README.md | 861 ++++++++++++++++++++-------------------- lodash.js | 4 +- 10 files changed, 912 insertions(+), 798 deletions(-) diff --git a/README.md b/README.md index fa841b059e..5edbd55c39 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lodash v4.0.0 +# lodash v4.0.1 The [lodash](https://lodash.com/) library exported as a [UMD](https://github.com/umdjs/umd) module. @@ -18,8 +18,8 @@ $ lodash core -o ./dist/lodash.core.js Lodash is also available in a variety of other builds & module formats. * [lodash](https://www.npmjs.com/package/lodash) & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) packages - * [lodash-amd](https://github.com/lodash/lodash/tree/4.0.0-amd) - * [lodash-es](https://github.com/lodash/lodash/tree/4.0.0-es) + * [lodash-amd](https://github.com/lodash/lodash/tree/4.0.1-amd) + * [lodash-es](https://github.com/lodash/lodash/tree/4.0.1-es) ## Further Reading diff --git a/dist/lodash.core.js b/dist/lodash.core.js index 7985e3df5c..9aa3e4df8c 100644 --- a/dist/lodash.core.js +++ b/dist/lodash.core.js @@ -1,6 +1,6 @@ /** * @license - * lodash 4.0.0 (Custom Build) + * lodash 4.0.1 (Custom Build) * Build: `lodash core -o ./dist/lodash.core.js` * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 @@ -13,7 +13,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.0.0'; + var VERSION = '4.0.1'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -159,7 +159,7 @@ /** * The base implementation of methods like `_.find` and `_.findKey`, without * support for iteratee shorthands, which iterates over `collection` using - * the provided `eachFunc`. + * `eachFunc`. * * @private * @param {Array|Object} collection The collection to search. @@ -181,21 +181,20 @@ /** * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using the provided - * `eachFunc`. + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. - * @param {boolean} initFromCollection Specify using the first or last element of `collection` as the initial value. + * @param {boolean} initAccum Specify using the first or last element of `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ - function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) { + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index, collection) { - accumulator = initFromCollection - ? (initFromCollection = false, value) + accumulator = initAccum + ? (initAccum = false, value) : iteratee(accumulator, value, index, collection); }); return accumulator; @@ -362,8 +361,8 @@ var oldDash = root._; /** Built-in value references. */ - var _Symbol = root.Symbol, - Reflect = root.Reflect, + var Reflect = root.Reflect, + Symbol = root.Symbol, Uint8Array = root.Uint8Array, enumerate = Reflect ? Reflect.enumerate : undefined, propertyIsEnumerable = objectProto.propertyIsEnumerable; @@ -416,13 +415,12 @@ * The chainable wrapper methods are: * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, * `at`, `before`, `bind`, `bindAll`, `bindKey`, `chain`, `chunk`, `commit`, - * `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`, + * `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`, * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, - * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, + * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`, - * `flowRight`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, - * `forOwnRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, - * `intersection`, `intersectionBy`, `intersectionWith`, invert`, `invokeMap`, + * `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, + * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invokeMap`, * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`, * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, @@ -441,22 +439,23 @@ * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`, * `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, - * `findLast`, `findLastIndex`, `findLastKey`, `floor`, `get`, `gt`, `gte`, - * `has`, `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, - * `invoke`, `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, - * `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, - * `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, - * `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, - * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, - * `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`, `last`, - * `lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, - * `mean`, `min`, `minBy`, `noConflict`, `noop`, `now`, `pad`, `padEnd`, - * `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, - * `result`, `round`, `runInContext`, `sample`, `shift`, `size`, `snakeCase`, - * `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, - * `startCase`, `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, - * `toLower`, `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, - * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, + * `findLast`, `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, + * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, + * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, `isMatchWith`, + * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`, + * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isString`, `isUndefined`, + * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, + * `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, + * `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`, + * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, + * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, + * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, + * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toLower`, + * `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, + * `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, * `upperCase`, `upperFirst`, `value`, and `words` * * @name _ @@ -1058,7 +1057,7 @@ while (++index < length) { var source = sources[index]; if (source) { - assigner(object, source, customizer); + assigner(object, source, index, customizer); } } return object; @@ -1446,8 +1445,11 @@ * // => [1] */ var concat = rest(function(array, values) { + if (!isArray(array)) { + array = array == null ? [] : [Object(array)]; + } values = baseFlatten(values); - return arrayConcat(isArray(array) ? array : [Object(array)], values); + return arrayConcat(array, values); }); /** @@ -1925,11 +1927,11 @@ * return n * n; * } * - * _.map([1, 2], square); - * // => [3, 6] + * _.map([4, 8], square); + * // => [16, 64] * - * _.map({ 'a': 1, 'b': 2 }, square); - * // => [3, 6] (iteration order is not guaranteed) + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) * * var users = [ * { 'user': 'barney' }, @@ -3132,7 +3134,7 @@ * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - var assignInWith = createAssigner(function(object, source, customizer) { + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { copyObjectWith(source, keysIn(source), object, customizer); }); @@ -3606,7 +3608,9 @@ * var lodash = _.noConflict(); */ function noConflict() { - root._ = oldDash; + if (root._ === this) { + root._ = oldDash; + } return this; } diff --git a/dist/lodash.core.min.js b/dist/lodash.core.min.js index 95e9723817..fd454cbef1 100644 --- a/dist/lodash.core.min.js +++ b/dist/lodash.core.min.js @@ -1,6 +1,6 @@ /** * @license - * lodash 4.0.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + * lodash 4.0.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE * Build: `lodash core -o ./dist/lodash.core.js` */ ;(function(){function n(n,t){for(var r=-1,e=t.length,u=n.length;++rt&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e1?r[u-1]:ln,o=typeof o=="function"?(u--,o):ln;for(t=Object(t);++e1?r[u-1]:ln,o=typeof o=="function"?(u--,o):ln;for(t=Object(t);++ef))return false;for(a=true;++iarguments.length,$n)}function P(n){return null==n?0:(n=Q(n)?n:un(n),n.length)}function U(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function"); @@ -19,12 +19,12 @@ return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=ln) }function fn(n){return n}function an(t,r,e){var u=un(r),o=g(r,u);null!=e||Y(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=g(r,un(r)));var i=Y(e)&&"chain"in e?e.chain:true,c=W(t);return $n(o,function(e){var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=k(this.__actions__)).push({func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var ln,pn=/[&<>"'`]/g,sn=RegExp(pn.source),hn=/^(?:0|[1-9]\d*)$/,vn={ "&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},yn={"function":true,object:true},_n=yn[typeof exports]&&exports&&!exports.nodeType?exports:null,gn=yn[typeof module]&&module&&!module.nodeType?module:null,bn=o(yn[typeof self]&&self),jn=o(yn[typeof window]&&window),mn=gn&&gn.exports===_n?_n:null,dn=o(yn[typeof this]&&this),wn=o(_n&&gn&&typeof global=="object"&&global)||jn!==(dn&&dn.window)&&jn||bn||dn||Function("return this")(),On=Array.prototype,xn=Object.prototype,En=xn.hasOwnProperty,An=0,kn=xn.toString,Nn=wn._,Sn=wn.f,Tn=Sn?Sn.g:ln,Fn=xn.propertyIsEnumerable,Bn=wn.isFinite,Dn=Object.keys,Rn=Math.max,In=function(){ function n(){}return function(t){if(Y(t)){n.prototype=t;var r=new n;n.prototype=ln}return r||{}}}(),$n=function(n,t){return function(r,e){if(null==r)return r;if(!Q(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++oe&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return Q(n)?n.length?k(n):[]:cn(n)},a.values=cn,a.extend=Qn,an(a,a),a.clone=function(n){return Y(n)?Vn(n)?k(n):T(n,un(n)):n},a.escape=function(n){return(n=en(n))&&sn.test(n)?n.replace(pn,i):n}, -a.every=function(n,t,r){return t=r?ln:t,h(n,m(t))},a.find=C,a.forEach=G,a.has=function(n,t){return null!=n&&En.call(n,t)},a.head=z,a.identity=fn,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?Rn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++re&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return Q(n)?n.length?k(n):[]:cn(n)},a.values=cn,a.extend=Qn,an(a,a),a.clone=function(n){return Y(n)?Vn(n)?k(n):T(n,un(n)):n},a.escape=function(n){ +return(n=en(n))&&sn.test(n)?n.replace(pn,i):n},a.every=function(n,t,r){return t=r?ln:t,h(n,m(t))},a.find=C,a.forEach=G,a.has=function(n,t){return null!=n&&En.call(n,t)},a.head=z,a.identity=fn,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?Rn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r 2 ? (arity - 2) : 1; func = iteratee(func); var length = func.length; @@ -233,14 +239,18 @@ return /******/ (function(modules) { // webpackBootstrap } var result; each(mapping.caps, function(cap) { - each(mapping.aryMethodMap[cap], function(otherName) { + each(mapping.aryMethod[cap], function(otherName) { if (name == otherName) { + var indexes = mapping.iterateeRearg[name], + n = !isLib && mapping.aryIteratee[name]; + result = ary(func, cap); - if (cap > 1 && !mapping.skipReargMap[name]) { - result = rearg(result, mapping.methodReargMap[name] || mapping.aryReargMap[cap]); + if (cap > 1 && !mapping.skipRearg[name]) { + result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[cap]); } - var n = !isLib && mapping.aryIterateeMap[name]; - if (n) { + if (indexes) { + result = iterateeRearg(result, indexes); + } else if (n) { result = iterateeAry(result, n); } if (cap > 1) { @@ -251,7 +261,12 @@ return /******/ (function(modules) { // webpackBootstrap }); return !result; }); - return result || func; + + result || (result = func); + if (mapping.placeholder[name]) { + result.placeholder = placeholder; + } + return result; }; if (!isLib) { @@ -260,8 +275,8 @@ return /******/ (function(modules) { // webpackBootstrap // Iterate over methods for the current ary cap. var pairs = []; each(mapping.caps, function(cap) { - each(mapping.aryMethodMap[cap], function(key) { - var func = _[mapping.keyMap[key] || key]; + each(mapping.aryMethod[cap], function(key) { + var func = _[mapping.key[key] || key]; if (func) { pairs.push([key, wrap(key, func)]); } @@ -275,7 +290,7 @@ return /******/ (function(modules) { // webpackBootstrap // Wrap the lodash method and its aliases. each(keys(_), function(key) { - each(mapping.aliasMap[key] || [], function(alias) { + each(mapping.alias[key] || [], function(alias) { _[alias] = _[key]; }); }); @@ -293,28 +308,29 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = { /** Used to map method names to their aliases. */ - 'aliasMap': { + 'alias': { 'ary': ['nAry'], - 'overEvery': ['allPass'], - 'overSome': ['somePass'], + 'assignIn': ['extend'], + 'assignInWith': ['extendWith'], 'filter': ['whereEq'], 'flatten': ['unnest'], 'flow': ['pipe'], 'flowRight': ['compose'], 'forEach': ['each'], 'forEachRight': ['eachRight'], - 'get': ['path'], - 'getOr': ['pathOr'], + 'get': ['path', 'prop'], + 'getOr': ['pathOr', 'propOr'], 'head': ['first'], 'includes': ['contains'], 'initial': ['init'], 'isEqual': ['equals'], 'mapValues': ['mapObj'], 'matchesProperty': ['pathEq'], - 'overArgs': ['useWith'], 'omit': ['dissoc', 'omitAll'], + 'overArgs': ['useWith'], + 'overEvery': ['allPass'], + 'overSome': ['somePass'], 'pick': ['pickAll'], - 'property': ['prop'], 'propertyOf': ['propOf'], 'rest': ['unapply'], 'some': ['all'], @@ -323,14 +339,14 @@ return /******/ (function(modules) { // webpackBootstrap }, /** Used to map method names to their iteratee ary. */ - 'aryIterateeMap': { + 'aryIteratee': { 'assignWith': 2, + 'assignInWith': 2, 'cloneDeepWith': 1, 'cloneWith': 1, 'dropRightWhile': 1, 'dropWhile': 1, 'every': 1, - 'extendWith': 2, 'filter': 1, 'find': 1, 'findIndex': 1, @@ -363,61 +379,82 @@ return /******/ (function(modules) { // webpackBootstrap }, /** Used to map ary to method names. */ - 'aryMethodMap': { - 1: ( - 'attempt,ceil,create,curry,curryRight,floor,fromPairs,iteratee,invert,over,' + - 'overEvery,overSome,memoize,method,methodOf,mixin,rest,reverse,round,' + - 'runInContext,template,trim,trimLeft,trimRight,uniqueId,words').split(','), - 2: ( - 'add,ary,assign,at,bind,bindKey,cloneDeepWith,cloneWith,concat,countBy,curryN,' + - 'curryRightN,debounce,defaults,defaultsDeep,delay,difference,drop,dropRight,' + - 'dropRightWhile,dropWhile,endsWith,eq,every,extend,filter,find,find,findIndex,' + - 'findKey,findLast,findLastIndex,findLastKey,flatMap,forEach,forEachRight,' + - 'forIn,forInRight,forOwn,forOwnRight,get,groupBy,includes,indexBy,indexOf,' + - 'intersection,invoke,invokeMap,isMatch,lastIndexOf,map,mapKeys,mapValues,' + - 'matchesProperty,maxBy,mean,minBy,merge,omit,orderBy,overArgs,pad,padLeft,' + - 'padRight,parseInt,partition,pick,pull,pullAll,pullAt,random,range,rangeRight,' + - 'rearg,reject,remove,repeat,result,sampleSize,some,sortBy,sortedIndexBy,' + - 'sortedLastIndexBy,sortedUniqBy,startsWith,subtract,sumBy,take,takeRight,' + - 'takeRightWhile,takeWhile,throttle,times,truncate,union,uniqBy,without,wrap,' + - 'xor,zip,zipObject').split(','), - 3: ( - 'assignWith,clamp,differenceBy,extendWith,getOr,inRange,intersectionBy,' + - 'isEqualWith,isMatchWith,mergeWith,omitBy,pickBy,pullAllBy,reduce,' + - 'reduceRight,set,slice,transform,unionBy,xorBy,zipWith').split(','), - 4: - ['fill', 'setWith'] + 'aryMethod': { + 1:[ + 'attempt', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'fromPairs', + 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin', 'over', + 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext', + 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words' + ], + 2:[ + 'add', 'after', 'ary', 'assign', 'at', 'before', 'bind', 'bindKey', + 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', + 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', + 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', + 'every', 'extend', 'filter', 'find', 'find', 'findIndex', 'findKey', + 'findLast', 'findLastIndex', 'findLastKey', 'flatMap', 'forEach', + 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', + 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', + 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', + 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', + 'merge', 'minBy', 'omit', 'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd', + 'padStart', 'parseInt', 'partition', 'pick', 'pickBy', 'pull', 'pullAll', + 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', + 'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', + 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', + 'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', + 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'truncate', 'union', 'uniqBy', + 'uniqWith', 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject' + ], + 3:[ + 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', + 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith', + 'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace', + 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', + 'unionWith', 'xorBy', 'xorWith', 'zipWith' + ], + 4:[ + 'fill', 'setWith' + ] }, - /** Used to map ary to rearg configs by method ary. */ - 'aryReargMap': { + /** Used to map ary to rearg configs. */ + 'aryRearg': { 2: [1, 0], 3: [2, 1, 0], 4: [3, 2, 0, 1] }, - /** Used to map ary to rearg configs by method names. */ - 'methodReargMap': { + /** Used to map method names to iteratee rearg configs. */ + 'iterateeRearg': { + 'findKey': [1], + 'findLastKey': [1], + 'mapKeys': [1] + }, + + /** Used to map method names to rearg configs. */ + 'methodRearg': { 'clamp': [2, 0, 1], 'reduce': [2, 0, 1], 'reduceRight': [2, 0, 1], - 'setWith': [3, 2, 1, 0], + 'set': [2, 0, 1], + 'setWith': [3, 1, 2, 0], 'slice': [2, 0, 1], 'transform': [2, 0, 1] }, - /** Used to iterate `mapping.aryMethodMap` keys. */ + /** Used to iterate `mapping.aryMethod` keys. */ 'caps': [1, 2, 3, 4], /** Used to map keys to other keys. */ - 'keyMap': { + 'key': { 'curryN': 'curry', 'curryRightN': 'curryRight', 'getOr': 'get' }, /** Used to identify methods which mutate arrays or objects. */ - 'mutateMap': { + 'mutate': { 'array': { 'fill': true, 'pull': true, @@ -429,11 +466,11 @@ return /******/ (function(modules) { // webpackBootstrap }, 'object': { 'assign': true, + 'assignIn': true, + 'assignInWith': true, 'assignWith': true, 'defaults': true, 'defaultsDeep': true, - 'extend': true, - 'extendWith': true, 'merge': true, 'mergeWith': true }, @@ -443,10 +480,26 @@ return /******/ (function(modules) { // webpackBootstrap } }, + /** Used to track methods with placeholder support */ + 'placeholder': { + 'bind': true, + 'bindKey': true, + 'curry': true, + 'curryRight': true, + 'partial': true, + 'partialRight': true + }, + /** Used to track methods that skip `_.rearg`. */ - 'skipReargMap': { + 'skipRearg': { + 'assign': true, + 'assignIn': true, + 'concat': true, + 'defaults': true, + 'defaultsDeep': true, 'difference': true, 'matchesProperty': true, + 'merge': true, 'random': true, 'range': true, 'rangeRight': true, diff --git a/dist/lodash.fp.min.js b/dist/lodash.fp.min.js index dae46c257c..741fe45c1c 100644 --- a/dist/lodash.fp.min.js +++ b/dist/lodash.fp.min.js @@ -1,10 +1,11 @@ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.fp=t():e.fp=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){function n(e){return i(e,e)}var i=r(1);e.exports=n},function(e,t,r){function n(e,t,r){ -if("function"!=typeof r&&(r=t,t=void 0),null==r)throw new TypeError;var o=void 0===t&&"string"==typeof r.VERSION,p=o?r:{ary:e.ary,cloneDeep:e.cloneDeep,curry:e.curry,forEach:e.forEach,isFunction:e.isFunction,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg},u=p.ary,s=p.cloneDeep,c=p.curry,f=p.forEach,l=p.isFunction,h=p.keys,d=p.rearg,y=function(e,t){return function(){var r=arguments,n=Math.min(r.length,t);switch(n){case 1:return e(r[0]);case 2:return e(r[0],r[1])}for(r=Array(n);n--;)r[n]=arguments[n]; -return e.apply(void 0,r)}},g=function(e){for(var t=e?e.length:0,r=Array(t);t--;)r[t]=e[t];return r},m=function(e){return function(t){return e({},t)}},v=function(e,t){return x(e,t,!0)},R=function(e,t){return x(e,function(e){return y(e,t)})},x=function(e,t,r){return function(){for(var n=arguments.length,i=Array(n);n--;)i[n]=arguments[n];i[0]=t(i[0]);var a=e.apply(void 0,i);return r?i[0]:a}},W={iteratee:function(e){return function(t,r){r=r>2?r-2:1,t=e(t);var n=t.length;return n&&r>=n?t:y(t,r)}},mixin:function(e){ -return function(t){var r=this;if(!l(r))return e(r,Object(t));var n=[],i=[];return f(h(t),function(e){var a=t[e];l(a)&&(i.push(e),n.push(r.prototype[e]))}),e(r,Object(t)),f(i,function(e,t){var i=n[t];l(i)?r.prototype[e]=i:delete r.prototype[e]}),r}},runInContext:function(t){return function(r){return n(e,t(r))}}},M=function(e,t){var r=W[e];if(r)return r(t);a.array[e]?t=v(t,g):a.object[e]?t=v(t,m(t)):a.set[e]&&(t=v(t,s));var n;return f(i.caps,function(r){return f(i.aryMethodMap[r],function(a){if(e==a){ -n=u(t,r),r>1&&!i.skipReargMap[e]&&(n=d(n,i.methodReargMap[e]||i.aryReargMap[r]));var p=!o&&i.aryIterateeMap[e];return p&&(n=R(n,p)),r>1&&(n=c(n,r)),!1}}),!n}),n||t};if(!o)return M(t,r);var O=[];return f(i.caps,function(e){f(i.aryMethodMap[e],function(e){var t=p[i.keyMap[e]||e];t&&O.push([e,M(e,t)])})}),f(O,function(e){p[e[0]]=e[1]}),f(h(p),function(e){f(i.aliasMap[e]||[],function(t){p[t]=p[e]})}),p}var i=r(2),a=i.mutateMap;e.exports=n},function(e,t){e.exports={aliasMap:{ary:["nAry"],overEvery:["allPass"], -overSome:["somePass"],filter:["whereEq"],flatten:["unnest"],flow:["pipe"],flowRight:["compose"],forEach:["each"],forEachRight:["eachRight"],get:["path"],getOr:["pathOr"],head:["first"],includes:["contains"],initial:["init"],isEqual:["equals"],mapValues:["mapObj"],matchesProperty:["pathEq"],overArgs:["useWith"],omit:["dissoc","omitAll"],pick:["pickAll"],property:["prop"],propertyOf:["propOf"],rest:["unapply"],some:["all"],spread:["apply"],zipObject:["zipObj"]},aryIterateeMap:{assignWith:2,cloneDeepWith:1, -cloneWith:1,dropRightWhile:1,dropWhile:1,every:1,extendWith:2,filter:1,find:1,findIndex:1,findKey:1,findLast:1,findLastIndex:1,findLastKey:1,flatMap:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,isEqualWith:2,isMatchWith:2,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},aryMethodMap:{1:"attempt,ceil,create,curry,curryRight,floor,fromPairs,iteratee,invert,over,overEvery,overSome,memoize,method,methodOf,mixin,rest,reverse,round,runInContext,template,trim,trimLeft,trimRight,uniqueId,words".split(","), -2:"add,ary,assign,at,bind,bindKey,cloneDeepWith,cloneWith,concat,countBy,curryN,curryRightN,debounce,defaults,defaultsDeep,delay,difference,drop,dropRight,dropRightWhile,dropWhile,endsWith,eq,every,extend,filter,find,find,findIndex,findKey,findLast,findLastIndex,findLastKey,flatMap,forEach,forEachRight,forIn,forInRight,forOwn,forOwnRight,get,groupBy,includes,indexBy,indexOf,intersection,invoke,invokeMap,isMatch,lastIndexOf,map,mapKeys,mapValues,matchesProperty,maxBy,mean,minBy,merge,omit,orderBy,overArgs,pad,padLeft,padRight,parseInt,partition,pick,pull,pullAll,pullAt,random,range,rangeRight,rearg,reject,remove,repeat,result,sampleSize,some,sortBy,sortedIndexBy,sortedLastIndexBy,sortedUniqBy,startsWith,subtract,sumBy,take,takeRight,takeRightWhile,takeWhile,throttle,times,truncate,union,uniqBy,without,wrap,xor,zip,zipObject".split(","), -3:"assignWith,clamp,differenceBy,extendWith,getOr,inRange,intersectionBy,isEqualWith,isMatchWith,mergeWith,omitBy,pickBy,pullAllBy,reduce,reduceRight,set,slice,transform,unionBy,xorBy,zipWith".split(","),4:["fill","setWith"]},aryReargMap:{2:[1,0],3:[2,1,0],4:[3,2,0,1]},methodReargMap:{clamp:[2,0,1],reduce:[2,0,1],reduceRight:[2,0,1],setWith:[3,2,1,0],slice:[2,0,1],transform:[2,0,1]},caps:[1,2,3,4],keyMap:{curryN:"curry",curryRightN:"curryRight",getOr:"get"},mutateMap:{array:{fill:!0,pull:!0,pullAll:!0, -pullAllBy:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignWith:!0,defaults:!0,defaultsDeep:!0,extend:!0,extendWith:!0,merge:!0,mergeWith:!0},set:{set:!0,setWith:!0}},skipReargMap:{difference:!0,matchesProperty:!0,random:!0,range:!0,rangeRight:!0,zip:!0,zipObject:!0}}}])}); \ No newline at end of file +if("function"!=typeof r&&(r=t,t=void 0),null==r)throw new TypeError;var u=void 0===t&&"string"==typeof r.VERSION,s=u?r:{ary:e.ary,cloneDeep:e.cloneDeep,curry:e.curry,forEach:e.forEach,isFunction:e.isFunction,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg},c=s.ary,f=s.cloneDeep,p=s.curry,l=s.forEach,h=s.isFunction,d=s.keys,y=s.rearg,g=function(e,t){return 2==t?function(t,r){return e.apply(void 0,arguments)}:function(t){return e.apply(void 0,arguments)}},m=function(e,t){return 2==t?function(t,r){return e(t,r); +}:function(t){return e(t)}},v=function(e){for(var t=e?e.length:0,r=Array(t);t--;)r[t]=e[t];return r},W=function(e){return function(t){return e({},t)}},R=function(e,t){return O(e,t,!0)},x=function(e,t){return O(e,function(e){return m(e,t)})},I=function(e,t){return O(e,function(e){var r=t.length;return g(y(m(e,r),t),r)})},O=function(e,t,r){return function(){for(var n=arguments.length,i=Array(n);n--;)i[n]=arguments[n];i[0]=t(i[0]);var a=e.apply(void 0,i);return r?i[0]:a}},k={iteratee:function(e){return function(){ +var t=arguments[0],r=arguments[1];r=r>2?r-2:1,t=e(t);var n=t.length;return n&&r>=n?t:m(t,r)}},mixin:function(e){return function(t){var r=this;if(!h(r))return e(r,Object(t));var n=[],i=[];return l(d(t),function(e){var a=t[e];h(a)&&(i.push(e),n.push(r.prototype[e]))}),e(r,Object(t)),l(i,function(e,t){var i=n[t];h(i)?r.prototype[e]=i:delete r.prototype[e]}),r}},runInContext:function(t){return function(r){return n(e,t(r))}}},E=function(e,t){var r=k[e];if(r)return r(t);a.array[e]?t=R(t,v):a.object[e]?t=R(t,W(t)):a.set[e]&&(t=R(t,f)); +var n;return l(i.caps,function(r){return l(i.aryMethod[r],function(a){if(e==a){var o=i.iterateeRearg[e],s=!u&&i.aryIteratee[e];return n=c(t,r),r>1&&!i.skipRearg[e]&&(n=y(n,i.methodRearg[e]||i.aryRearg[r])),o?n=I(n,o):s&&(n=x(n,s)),r>1&&(n=p(n,r)),!1}}),!n}),n||(n=t),i.placeholder[e]&&(n.placeholder=o),n};if(!u)return E(t,r);var B=[];return l(i.caps,function(e){l(i.aryMethod[e],function(e){var t=s[i.key[e]||e];t&&B.push([e,E(e,t)])})}),l(B,function(e){s[e[0]]=e[1]}),l(d(s),function(e){l(i.alias[e]||[],function(t){ +s[t]=s[e]})}),s}var i=r(2),a=i.mutate,o={};e.exports=n},function(e,t){e.exports={alias:{ary:["nAry"],assignIn:["extend"],assignInWith:["extendWith"],filter:["whereEq"],flatten:["unnest"],flow:["pipe"],flowRight:["compose"],forEach:["each"],forEachRight:["eachRight"],get:["path","prop"],getOr:["pathOr","propOr"],head:["first"],includes:["contains"],initial:["init"],isEqual:["equals"],mapValues:["mapObj"],matchesProperty:["pathEq"],omit:["dissoc","omitAll"],overArgs:["useWith"],overEvery:["allPass"], +overSome:["somePass"],pick:["pickAll"],propertyOf:["propOf"],rest:["unapply"],some:["all"],spread:["apply"],zipObject:["zipObj"]},aryIteratee:{assignWith:2,assignInWith:2,cloneDeepWith:1,cloneWith:1,dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findIndex:1,findKey:1,findLast:1,findLastIndex:1,findLastKey:1,flatMap:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,isEqualWith:2,isMatchWith:2,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1, +some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},aryMethod:{1:["attempt","ceil","create","curry","curryRight","floor","fromPairs","invert","iteratee","memoize","method","methodOf","mixin","over","overEvery","overSome","rest","reverse","round","runInContext","template","trim","trimEnd","trimStart","uniqueId","words"],2:["add","after","ary","assign","at","before","bind","bindKey","chunk","cloneDeepWith","cloneWith","concat","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","delay","difference","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","extend","filter","find","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","merge","minBy","omit","omitBy","orderBy","overArgs","pad","padEnd","padStart","parseInt","partition","pick","pickBy","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject"], +3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","getOr","inRange","intersectionBy","intersectionWith","isEqualWith","isMatchWith","mergeWith","pullAllBy","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","xorBy","xorWith","zipWith"],4:["fill","setWith"]},aryRearg:{2:[1,0],3:[2,1,0],4:[3,2,0,1]},iterateeRearg:{findKey:[1],findLastKey:[1],mapKeys:[1]},methodRearg:{clamp:[2,0,1],reduce:[2,0,1],reduceRight:[2,0,1], +set:[2,0,1],setWith:[3,1,2,0],slice:[2,0,1],transform:[2,0,1]},caps:[1,2,3,4],key:{curryN:"curry",curryRightN:"curryRight",getOr:"get"},mutate:{array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignIn:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsDeep:!0,merge:!0,mergeWith:!0},set:{set:!0,setWith:!0}},placeholder:{bind:!0,bindKey:!0,curry:!0,curryRight:!0,partial:!0,partialRight:!0},skipRearg:{assign:!0,assignIn:!0,concat:!0,defaults:!0,defaultsDeep:!0, +difference:!0,matchesProperty:!0,merge:!0,random:!0,range:!0,rangeRight:!0,zip:!0,zipObject:!0}}}])}); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index 20f807b745..bcbae62efd 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -1,6 +1,6 @@ /** * @license - * lodash 4.0.0 (Custom Build) + * lodash 4.0.1 (Custom Build) * Build: `lodash -o ./dist/lodash.js` * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 @@ -13,7 +13,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.0.0'; + var VERSION = '4.0.1'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -163,7 +163,8 @@ /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', - rsComboRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', rsDingbatRange = '\\u2700-\\u27bf', rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', @@ -177,12 +178,13 @@ /** Used to compose unicode capture groups. */ var rsAstral = '[' + rsAstralRange + ']', rsBreak = '[' + rsBreakRange + ']', - rsCombo = '[' + rsComboRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', rsDigits = '\\d+', rsDingbat = '[' + rsDingbatRange + ']', rsLower = '[' + rsLowerRange + ']', rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', - rsModifier = '(?:\\ud83c[\\udffb-\\udfff])', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', @@ -199,14 +201,17 @@ rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */ + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ var reComboMark = RegExp(rsCombo, 'g'); /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ - var reComplexSymbol = RegExp(rsSymbol + rsSeq, 'g'); + var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ - var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); /** Used to match non-compound words composed of alphanumeric characters. */ var reBasicWord = /[a-zA-Z0-9]+/g; @@ -216,7 +221,8 @@ rsUpper + '?' + rsLower + '+(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsUpperMisc + '+(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', rsUpper + '?' + rsLowerMisc + '+', - rsDigits + '(?:' + rsLowerMisc + '+)?', + rsUpper + '+', + rsDigits, rsEmoji ].join('|'), 'g'); @@ -597,14 +603,14 @@ * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. - * @param {boolean} [initFromArray] Specify using the first element of `array` as the initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. * @returns {*} Returns the accumulated value. */ - function arrayReduce(array, iteratee, accumulator, initFromArray) { + function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array.length; - if (initFromArray && length) { + if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { @@ -621,12 +627,12 @@ * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. - * @param {boolean} [initFromArray] Specify using the last element of `array` as the initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as the initial value. * @returns {*} Returns the accumulated value. */ - function arrayReduceRight(array, iteratee, accumulator, initFromArray) { + function arrayReduceRight(array, iteratee, accumulator, initAccum) { var length = array.length; - if (initFromArray && length) { + if (initAccum && length) { accumulator = array[--length]; } while (length--) { @@ -688,7 +694,7 @@ /** * The base implementation of methods like `_.find` and `_.findKey`, without * support for iteratee shorthands, which iterates over `collection` using - * the provided `eachFunc`. + * `eachFunc`. * * @private * @param {Array|Object} collection The collection to search. @@ -756,21 +762,20 @@ /** * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using the provided - * `eachFunc`. + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. - * @param {boolean} initFromCollection Specify using the first or last element of `collection` as the initial value. + * @param {boolean} initAccum Specify using the first or last element of `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ - function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) { + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index, collection) { - accumulator = initFromCollection - ? (initFromCollection = false, value) + accumulator = initAccum + ? (initAccum = false, value) : iteratee(accumulator, value, index, collection); }); return accumulator; @@ -1164,6 +1169,7 @@ /** * Gets the number of symbols in `string`. * + * @private * @param {string} string The string to inspect. * @returns {number} Returns the string size. */ @@ -1279,14 +1285,14 @@ ); /** Built-in value references. */ - var _Symbol = context.Symbol, - Reflect = context.Reflect, + var Reflect = context.Reflect, + Symbol = context.Symbol, Uint8Array = context.Uint8Array, clearTimeout = context.clearTimeout, enumerate = Reflect ? Reflect.enumerate : undefined, getPrototypeOf = Object.getPrototypeOf, getOwnPropertySymbols = Object.getOwnPropertySymbols, - iteratorSymbol = typeof (iteratorSymbol = _Symbol && _Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined, + iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined, propertyIsEnumerable = objectProto.propertyIsEnumerable, setTimeout = context.setTimeout, splice = arrayProto.splice; @@ -1317,9 +1323,9 @@ setCtorString = Set ? funcToString.call(Set) : ''; /** Used to convert symbols to primitives and strings. */ - var symbolProto = _Symbol ? _Symbol.prototype : undefined, - symbolValueOf = _Symbol ? symbolProto.valueOf : undefined, - symbolToString = _Symbol ? symbolProto.toString : undefined; + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = Symbol ? symbolProto.valueOf : undefined, + symbolToString = Symbol ? symbolProto.toString : undefined; /** Used to lookup unminified function names. */ var realNames = {}; @@ -1367,13 +1373,12 @@ * The chainable wrapper methods are: * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, * `at`, `before`, `bind`, `bindAll`, `bindKey`, `chain`, `chunk`, `commit`, - * `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`, + * `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`, * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, - * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, + * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`, - * `flowRight`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, - * `forOwnRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, - * `intersection`, `intersectionBy`, `intersectionWith`, invert`, `invokeMap`, + * `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, + * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invokeMap`, * `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, * `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`, * `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, @@ -1392,22 +1397,23 @@ * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`, * `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, - * `findLast`, `findLastIndex`, `findLastKey`, `floor`, `get`, `gt`, `gte`, - * `has`, `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, - * `invoke`, `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, - * `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, - * `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, - * `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, - * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, - * `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`, `last`, - * `lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, - * `mean`, `min`, `minBy`, `noConflict`, `noop`, `now`, `pad`, `padEnd`, - * `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, - * `result`, `round`, `runInContext`, `sample`, `shift`, `size`, `snakeCase`, - * `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, - * `startCase`, `startsWith`, `subtract`, `sum`, sumBy`, `template`, `times`, - * `toLower`, `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, toString`, - * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, + * `findLast`, `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, + * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, + * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, `isMatchWith`, + * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`, + * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isString`, `isUndefined`, + * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, + * `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, + * `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`, + * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, + * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, + * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, + * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toLower`, + * `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, + * `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, * `upperCase`, `upperFirst`, `value`, and `words` * * @name _ @@ -2667,7 +2673,6 @@ * The base implementation of `_.invoke` without support for individual * method arguments. * - * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. @@ -2810,7 +2815,10 @@ var stack = new Stack, result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined; - if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) { + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { return false; } } @@ -2946,10 +2954,11 @@ * @private * @param {Object} object The destination object. * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged counterparts. */ - function baseMerge(object, source, customizer, stack) { + function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } @@ -2961,7 +2970,7 @@ } if (isObject(srcValue)) { stack || (stack = new Stack); - baseMergeDeep(object, source, key, baseMerge, customizer, stack); + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(object[key], srcValue, (key + ''), object, source, stack) : undefined; @@ -2982,11 +2991,12 @@ * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged counterparts. */ - function baseMergeDeep(object, source, key, mergeFunc, customizer, stack) { + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = object[key], srcValue = source[key], stacked = stack.get(srcValue) || stack.get(objValue); @@ -3001,24 +3011,36 @@ if (isCommon) { newValue = srcValue; if (isArray(srcValue) || isTypedArray(srcValue)) { - newValue = isArray(objValue) - ? objValue - : ((isArrayLikeObject(objValue)) ? copyArray(objValue) : baseClone(srcValue)); + if (isArray(objValue)) { + newValue = srcIndex ? copyArray(objValue) : objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else { + newValue = baseClone(srcValue); + } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = isArguments(objValue) - ? toPlainObject(objValue) - : (isObject(objValue) ? objValue : baseClone(srcValue)); + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { + newValue = baseClone(srcValue); + } + else { + newValue = srcIndex ? baseClone(objValue) : objValue; + } } else { - isCommon = isFunction(srcValue); + isCommon = false; } } stack.set(srcValue, newValue); if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). - mergeFunc(newValue, srcValue, customizer, stack); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); } assignMergeValue(object, key, newValue); } @@ -3082,7 +3104,7 @@ function basePickBy(object, predicate) { var result = {}; baseForIn(object, function(value, key) { - if (predicate(value)) { + if (predicate(value, key)) { result[key] = value; } }); @@ -3667,7 +3689,7 @@ * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { - return _Symbol ? Object(symbolValueOf.call(symbol)) : {}; + return Symbol ? Object(symbolValueOf.call(symbol)) : {}; } /** @@ -3870,7 +3892,7 @@ while (++index < length) { var source = sources[index]; if (source) { - assigner(object, source, customizer); + assigner(object, source, index, customizer); } } return object; @@ -4555,7 +4577,7 @@ equalFunc(convert(object), convert(other), customizer, bitmask | UNORDERED_COMPARE_FLAG); case symbolTag: - return !!_Symbol && (symbolValueOf.call(object) == symbolValueOf.call(other)); + return !!Symbol && (symbolValueOf.call(object) == symbolValueOf.call(other)); } return false; } @@ -4575,7 +4597,6 @@ */ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { var isPartial = bitmask & PARTIAL_COMPARE_FLAG, - isUnordered = bitmask & UNORDERED_COMPARE_FLAG, objProps = keys(object), objLength = objProps.length, othProps = keys(other), @@ -4587,8 +4608,7 @@ var index = objLength; while (index--) { var key = objProps[index]; - if (!(isPartial ? key in other : baseHas(other, key)) || - !(isUnordered || key == othProps[index])) { + if (!(isPartial ? key in other : baseHas(other, key))) { return false; } } @@ -4658,7 +4678,7 @@ function getFuncName(func) { var result = (func.name + ''), array = realNames[result], - length = array ? array.length : 0; + length = hasOwnProperty.call(realNames, result) ? array.length : 0; while (length--) { var data = array[length], @@ -5099,9 +5119,9 @@ function mergeDefaults(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, mergeDefaults, stack); + baseMerge(objValue, srcValue, undefined, mergeDefaults, stack); } - return objValue === undefined ? baseClone(srcValue) : objValue; + return objValue; } /** @@ -5315,8 +5335,11 @@ * // => [1] */ var concat = rest(function(array, values) { + if (!isArray(array)) { + array = array == null ? [] : [Object(array)]; + } values = baseFlatten(values); - return arrayConcat(isArray(array) ? array : [Object(array)], values); + return arrayConcat(array, values); }); /** @@ -5748,7 +5771,7 @@ while (++index < length) { var pair = pairs[index]; - baseSet(result, pair[0], pair[1]); + result[pair[0]] = pair[1]; } return result; } @@ -5837,6 +5860,7 @@ * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of shared values. * @example + * * _.intersection([2, 1], [4, 2], [1, 2]); * // => [2] */ @@ -6029,7 +6053,7 @@ * * var array = [1, 2, 3, 1, 2, 3]; * - * _.pull(array, [2, 3]); + * _.pullAll(array, [2, 3]); * console.log(array); * // => [1, 1] */ @@ -6153,6 +6177,7 @@ * **Note:** This method mutates `array` and is based on * [`Array#reverse`](https://mdn.io/Array/reverse). * + * @static * @memberOf _ * @category Array * @returns {Array} Returns `array`. @@ -7111,7 +7136,7 @@ /** * This method is the wrapper version of `_.flatMap`. * - * @static + * @name flatMap * @memberOf _ * @category Seq * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. @@ -7262,7 +7287,7 @@ * * @name value * @memberOf _ - * @alias run, toJSON, valueOf + * @alias toJSON, valueOf * @category Seq * @returns {*} Returns the resolved unwrapped value. * @example @@ -7286,7 +7311,7 @@ * @memberOf _ * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * @@ -7510,14 +7535,14 @@ /** * Creates an object composed of keys generated from the results of running * each element of `collection` through `iteratee`. The corresponding value - * of each key is an array of the elements responsible for generating the key. + * of each key is an array of elements responsible for generating the key. * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * @@ -7622,7 +7647,7 @@ * @memberOf _ * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * @@ -7631,13 +7656,13 @@ * { 'dir': 'right', 'code': 100 } * ]; * - * _.keyBy(keyData, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - * * _.keyBy(keyData, function(o) { * return String.fromCharCode(o.code); * }); * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(keyData, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ var keyBy = createAggregator(function(result, value, key) { result[key] = value; @@ -7669,11 +7694,11 @@ * return n * n; * } * - * _.map([1, 2], square); - * // => [3, 6] + * _.map([4, 8], square); + * // => [16, 64] * - * _.map({ 'a': 1, 'b': 2 }, square); - * // => [3, 6] (iteration order is not guaranteed) + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) * * var users = [ * { 'user': 'barney' }, @@ -7732,9 +7757,9 @@ /** * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, while the second of which - * contains elements `predicate` returns falsey for. The predicate is invoked - * with three arguments: (value, index|key, collection). + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). * * @static * @memberOf _ @@ -7806,9 +7831,9 @@ */ function reduce(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduce : baseReduce, - initFromCollection = arguments.length < 3; + initAccum = arguments.length < 3; - return func(collection, getIteratee(iteratee, 4), accumulator, initFromCollection, baseEach); + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); } /** @@ -7833,9 +7858,9 @@ */ function reduceRight(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduceRight : baseReduce, - initFromCollection = arguments.length < 3; + initAccum = arguments.length < 3; - return func(collection, getIteratee(iteratee, 4), accumulator, initFromCollection, baseEachRight); + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); } /** @@ -7899,7 +7924,8 @@ } /** - * Gets `n` random elements from `collection`. + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. * * @static * @memberOf _ @@ -7909,8 +7935,11 @@ * @returns {Array} Returns the random elements. * @example * - * _.sampleSize([1, 2, 3, 4], 2); + * _.sampleSize([1, 2, 3], 2); * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] */ function sampleSize(collection, n) { var index = -1, @@ -9074,7 +9103,7 @@ * This method is like `_.clone` except that it accepts `customizer` which * is invoked to produce the cloned value. If `customizer` returns `undefined` * cloning is handled by the method instead. The `customizer` is invoked with - * up to five arguments; (value [, index|key, object, stack]). + * up to four arguments; (value [, index|key, object, stack]). * * @static * @memberOf _ @@ -9090,7 +9119,7 @@ * } * } * - * var el = _.clone(document.body, customizer); + * var el = _.cloneWith(document.body, customizer); * * console.log(el === document.body); * // => false @@ -9140,7 +9169,7 @@ * } * } * - * var el = _.cloneDeep(document.body, customizer); + * var el = _.cloneDeepWith(document.body, customizer); * * console.log(el === document.body); * // => false @@ -9468,7 +9497,7 @@ /** * This method is like `_.isEqual` except that it accepts `customizer` which is * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: + * handled by the method instead. The `customizer` is invoked with up to six arguments: * (objValue, othValue [, index|key, object, other, stack]). * * @static @@ -9718,7 +9747,7 @@ /** * This method is like `_.isMatch` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three + * are handled by the method instead. The `customizer` is invoked with five * arguments: (objValue, srcValue, index|key, object, source). * * @static @@ -10189,7 +10218,7 @@ * @memberOf _ * @category Lang * @param {*} value The value to convert. - * @return {number} Returns the converted integer. + * @returns {number} Returns the converted integer. * @example * * _.toLength(3); @@ -10328,7 +10357,7 @@ return ''; } if (isSymbol(value)) { - return _Symbol ? symbolToString.call(value) : ''; + return Symbol ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; @@ -10430,7 +10459,7 @@ * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - var assignInWith = createAssigner(function(object, source, customizer) { + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { copyObjectWith(source, keysIn(source), object, customizer); }); @@ -10460,7 +10489,7 @@ * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - var assignWith = createAssigner(function(object, source, customizer) { + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { copyObjectWith(source, keys(source), object, customizer); }); @@ -11140,8 +11169,8 @@ * _.merge(users, ages); * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } */ - var merge = createAssigner(function(object, source) { - baseMerge(object, source); + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); }); /** @@ -11179,8 +11208,8 @@ * _.mergeWith(object, other, customizer); * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } */ - var mergeWith = createAssigner(function(object, source, customizer) { - baseMerge(object, source, customizer); + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); }); /** @@ -11228,9 +11257,9 @@ * // => { 'b': '2' } */ function omitBy(object, predicate) { - predicate = getIteratee(predicate); - return basePickBy(object, function(value) { - return !predicate(value); + predicate = getIteratee(predicate, 2); + return basePickBy(object, function(value, key) { + return !predicate(value, key); }); } @@ -11273,7 +11302,7 @@ * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { - return object == null ? {} : basePickBy(object, getIteratee(predicate)); + return object == null ? {} : basePickBy(object, getIteratee(predicate, 2)); } /** @@ -12040,7 +12069,7 @@ * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, * in which case a `radix` of `16` is used. * - * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E) + * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#x15.1.2.2) * of `parseInt`. * * @static @@ -12832,7 +12861,7 @@ * [_.matches({ 'a': 1 }), _.constant('matches A')], * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], * [_.constant(true), _.constant('no match')] - * ]) + * ]); * * func({ 'a': 1, 'b': 2 }); * // => 'matches A' @@ -13203,7 +13232,9 @@ * var lodash = _.noConflict(); */ function noConflict() { - root._ = oldDash; + if (root._ === this) { + root._ = oldDash; + } return this; } @@ -13368,8 +13399,7 @@ * Creates an array of numbers (positive and/or negative) progressing from * `start` up to, but not including, `end`. A step of `-1` is used if a negative * `start` is specified without an `end` or `step`. If `end` is not specified - * it's set to `start` with `start` then set to `0`. If `end` is less than - * `start` a zero-length range is created unless a negative `step` is specified. + * it's set to `start` with `start` then set to `0`. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. @@ -13637,7 +13667,7 @@ * * var objects = [{ 'n': 1 }, { 'n': 2 }]; * - * _.maxBy(objects, function(o) { return o.a; }); + * _.maxBy(objects, function(o) { return o.n; }); * // => { 'n': 2 } * * // using the `_.property` iteratee shorthand @@ -13705,7 +13735,7 @@ * * var objects = [{ 'n': 1 }, { 'n': 2 }]; * - * _.minBy(objects, function(o) { return o.a; }); + * _.minBy(objects, function(o) { return o.n; }); * // => { 'n': 1 } * * // using the `_.property` iteratee shorthand @@ -13989,8 +14019,6 @@ lodash.zipWith = zipWith; // Add aliases. - lodash.each = forEach; - lodash.eachRight = forEachRight; lodash.extend = assignIn; lodash.extendWith = assignInWith; @@ -14133,6 +14161,8 @@ lodash.upperFirst = upperFirst; // Add aliases. + lodash.each = forEach; + lodash.eachRight = forEachRight; lodash.first = head; mixin(lodash, (function() { diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 00e69af1d3..a9d10fb1dc 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -1,33 +1,33 @@ /** * @license - * lodash 4.0.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + * lodash 4.0.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE * Build: `lodash -o ./dist/lodash.js` */ ;(function(){function n(n,t){return n.set(t[0],t[1]),n}function t(n,t){return n.add(t),n}function r(n,t,r){switch(r?r.length:0){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function e(n,t){for(var r=-1,e=n.length;++rt&&!o||!u||r&&!i&&f||e&&f)return 1;if(t>n&&!r||!f||o&&!e&&u||i&&u)return-1}return 0}function I(n){return Un[n]}function R(n){return zn[n]}function S(n){return"\\"+$n[n]}function W(n,t,r){var e=n.length;for(t+=r?0:-1;r?t--:++t-1&&0==n%1&&(null==t?9007199254740991:t)>n}function z(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}function B(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function L(n,t){for(var r=-1,e=n.length,u=-1,o=[];++rr?false:(r==n.length-1?n.pop():du.call(n,r,1), +return r}function E(n){return n&&n.Object===Object?n:null}function k(n,t){if(n!==t){var r=null===n,e=n===Z,u=n===n,o=null===t,i=t===Z,f=t===t;if(n>t&&!o||!u||r&&!i&&f||e&&f)return 1;if(t>n&&!r||!f||o&&!e&&u||i&&u)return-1}return 0}function I(n){return Un[n]}function R(n){return Bn[n]}function S(n){return"\\"+$n[n]}function W(n,t,r){var e=n.length;for(t+=r?0:-1;r?t--:++t-1&&0==n%1&&(null==t?9007199254740991:t)>n}function B(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}function z(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function L(n,t){for(var r=-1,e=n.length,u=-1,o=[];++rr?false:(r==n.length-1?n.pop():du.call(n,r,1), !0)}function Zn(n,t){var r=Dn(n,t);return 0>r?Z:n[r][1]}function Dn(n,t){for(var r=n.length;r--;)if(ue(n[r][0],t))return r;return-1}function qn(n,t,r){var e=Dn(n,t);0>e?n.push([t,r]):n[e][1]=r}function Pn(n,t,r,e){return n===Z||ue(n,Xe[r])&&!tu.call(e,r)?t:n}function Tn(n,t,r){(r!==Z&&!ue(n[t],r)||typeof t=="number"&&r===Z&&!(t in n))&&(n[t]=r)}function Vn(n,t,r){var e=n[t];(!ue(e,r)||ue(e,Xe[t])&&!tu.call(n,t)||r===Z&&!(t in n))&&(n[t]=r)}function Jn(n,t){return n&&Tt(t,Ce(t),n)}function Yn(n,t){ for(var r=-1,e=null==n,u=t.length,o=Array(u);++rr?r:n),t!==Z&&(n=t>n?t:n)),n}function Qn(n,t,r,u,o,i){var f;if(r&&(f=o?r(n,u,o,i):r(n)),f!==Z)return f;if(!pe(n))return n;if(u=Wo(n)){if(f=mr(n),!t)return Pt(n,f)}else{var c=br(n),a="[object Function]"==c||"[object GeneratorFunction]"==c;if("[object Object]"!=c&&"[object Arguments]"!=c&&(!a||o))return Cn[c]?wr(n,c,t):o?n:{};if(C(n))return o?n:{};if(f=jr(a?{}:n),!t)return Gt(n,Jn(f,n)); }return i||(i=new $n),(o=i.get(n))?o:(i.set(n,f),(u?e:it)(n,function(e,u){Vn(f,u,Qn(e,t,r,u,n,i))}),u?f:Gt(n,f))}function Xn(n){var t=Ce(n),r=t.length;return function(e){if(null==e)return!r;for(var u=r;u--;){var o=t[u],i=n[o],f=e[o];if(f===Z&&!(o in Object(e))||!i(f))return false}return true}}function nt(n,t,r){if(typeof n!="function")throw new He("Expected a function");return vu(function(){n.apply(Z,r)},t)}function tt(n,t,r,e){var u=-1,o=i,a=true,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=c(t,j(r))), -e?(o=f,a=false):t.length>=200&&(o=Ln,a=false,t=new Bn(t));n:for(;++ur;)n=n[t[r++]];return r&&r==e?n:Z}function lt(n,t){return tu.call(n,t)||typeof n=="object"&&t in n&&null===hu(n)}function st(n,t){return t in Object(n)}function ht(n,t,r){for(var e=r?f:i,u=n.length,o=u,a=Array(u),l=[];o--;){var s=n[o];o&&t&&(s=c(s,j(t))),a[o]=r||!t&&120>s.length?Z:new Bn(o&&s); +e?(o=f,a=false):t.length>=200&&(o=Ln,a=false,t=new zn(t));n:for(;++ur;)n=n[t[r++]];return r&&r==e?n:Z}function lt(n,t){return tu.call(n,t)||typeof n=="object"&&t in n&&null===hu(n)}function st(n,t){return t in Object(n)}function ht(n,t,r){for(var e=r?f:i,u=n.length,o=u,a=Array(u),l=[];o--;){var s=n[o];o&&t&&(s=c(s,j(t))),a[o]=r||!t&&120>s.length?Z:new zn(o&&s); }var s=n[0],h=-1,p=s.length,_=a[0];n:for(;++he?c*("desc"==r[e]?-1:1):c;break n}}e=n.b-t.b}return e})}function wt(n,t){return n=Object(n),l(t,function(t,r){return r in n&&(t[r]=n[r]), -t},{})}function At(n,t){var r={};return ot(n,function(n,e){t(n)&&(r[e]=n)}),r}function Ot(n){return function(t){return null==t?Z:t[n]}}function Et(n){return function(t){return at(t,n)}}function kt(n,t,r){var e=-1,u=t.length,o=n;for(r&&(o=c(n,function(n){return r(n)}));++ee?c*("desc"==r[e]?-1:1):c;break n}}e=n.b-t.b}return e})}function wt(n,t){return n=Object(n),l(t,function(t,r){return r in n&&(t[r]=n[r]), +t},{})}function At(n,t){var r={};return ot(n,function(n,e){t(n,e)&&(r[e]=n)}),r}function Ot(n){return function(t){return null==t?Z:t[n]}}function Et(n){return function(t){return at(t,n)}}function kt(n,t,r){var e=-1,u=t.length,o=n;for(r&&(o=c(n,function(n){return r(n)}));++et&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e=u){for(;u>e;){var o=e+u>>>1,i=n[o];(r?t>=i:t>i)&&null!==i?e=o+1:u=o}return u}return zt(n,t,Ne,r)}function zt(n,t,r,e){t=r(t);for(var u=0,o=n?n.length:0,i=t!==t,f=null===t,c=t===Z;o>u;){var a=bu((u+o)/2),l=r(n[a]),s=l!==Z,h=l===l;(i?h||e:f?h&&s&&(e||null!=l):c?h&&(e||s):null==l?0:e?t>=l:t>l)?u=a+1:o=a}return Au(o,4294967294)}function Bt(n,t){for(var r=0,e=n.length,u=n[0],o=t?t(u):u,i=o,f=0,c=[u];++r=u){for(;u>e;){var o=e+u>>>1,i=n[o];(r?t>=i:t>i)&&null!==i?e=o+1:u=o}return u}return Bt(n,t,Ne,r)}function Bt(n,t,r,e){t=r(t);for(var u=0,o=n?n.length:0,i=t!==t,f=null===t,c=t===Z;o>u;){var a=bu((u+o)/2),l=r(n[a]),s=l!==Z,h=l===l;(i?h||e:f?h&&s&&(e||null!=l):c?h&&(e||s):null==l?0:e?t>=l:t>l)?u=a+1:o=a}return Au(o,4294967294)}function zt(n,t){for(var r=0,e=n.length,u=n[0],o=t?t(u):u,i=o,f=0,c=[u];++r1?r[u-1]:Z,i=u>2?r[2]:Z,o=typeof o=="function"?(u--,o):Z;for(i&&Or(r[0],r[1],i)&&(o=3>u?Z:o,u=1),t=Object(t);++e1?r[u-1]:Z,i=u>2?r[2]:Z,o=typeof o=="function"?(u--,o):Z;for(i&&Or(r[0],r[1],i)&&(o=3>u?Z:o,u=1),t=Object(t);++ei&&c[0]!==l&&c[i-1]!==l?[]:L(c,l),i-=f.length,e>i?ar(n,t,ur,l,Z,c,f,Z,Z,e-i):r(a,this,c)}var o=tr(n);return u}function er(n){return ee(function(t){t=ut(t);var r=t.length,e=r,u=jn.prototype.thru;for(n&&t.reverse();e--;){var o=t[e];if(typeof o!="function")throw new He("Expected a function");if(u&&!i&&"wrapper"==gr(o))var i=new jn([],true)}for(e=i?e:r;++e=o[7].length||384==n&&h[8]>=h[7].length&&8==r,131>t||e)&&(1&n&&(o[2]=h[2],t|=1&r?0:4),(r=h[3])&&(e=o[3],o[3]=e?Dt(e,r,h[4]):Pt(r),o[4]=e?L(o[3],"__lodash_placeholder__"):Pt(h[4])),(r=h[5])&&(e=o[5],o[5]=e?qt(e,r,h[6]):Pt(r),o[6]=e?L(o[5],"__lodash_placeholder__"):Pt(h[6])),(r=h[7])&&(o[7]=Pt(r)),128&n&&(o[8]=null==o[8]?h[8]:Au(o[8],h[8])), null==o[9]&&(o[9]=h[9]),o[0]=h[0],o[1]=t),n=o[0],t=o[1],r=o[2],e=o[3],u=o[4],f=o[9]=null==o[9]?c?0:n.length:wu(o[9]-a,0),!f&&24&t&&(t&=-25),(h?Pu:Ju)(t&&1!=t?8==t||16==t?rr(n,t,f):32!=t&&33!=t||u.length?ur.apply(Z,o):fr(n,t,r,e):Qt(n,t,r),o)}function hr(n,t,r,e,u,o){var i=-1,f=2&u,c=1&u,a=n.length,l=t.length;if(!(a==l||f&&l>a))return false;if(l=o.get(n))return l==t;for(l=true,o.set(n,t);++it?0:t,e)):[]}function $r(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:Ae(t),t=e-t,Wt(n,0,0>t?0:t)):[]}function Fr(n){return n?n[0]:Z; +return Zt(r);case"[object Boolean]":case"[object Date]":return new o(+r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return e=r.buffer,new r.constructor(u?Zt(e):e,r.byteOffset,r.length);case"[object Map]":return u=r.constructor,l(z(r),n,new u);case"[object Number]":case"[object String]":return new o(r); +case"[object RegExp]":return u=new r.constructor(r.source,sn.exec(r)),u.lastIndex=r.lastIndex,u;case"[object Set]":return u=r.constructor,l($(r),t,new u);case"[object Symbol]":return cu?Object(Lu.call(r)):{}}}function Ar(n){var t=n?n.length:Z;return he(t)&&(Wo(n)||be(n)||ie(n))?x(t,String):null}function Or(n,t,r){if(!pe(r))return false;var e=typeof t;return("number"==e?fe(r)&&U(t,r.length):"string"==e&&t in r)?ue(r[t],n):false}function Er(n,t){return typeof n=="number"?true:!Wo(n)&&(tn.test(n)||!nn.test(n)||null!=t&&n in Object(t)); +}function kr(n){var t=typeof n;return"number"==t||"boolean"==t||"string"==t&&"__proto__"!==n||null==n}function Ir(n){var t=gr(n),r=dn[t];return typeof r=="function"&&t in wn.prototype?n===r?true:(t=Ku(r),!!t&&n===t[0]):false}function Rr(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||Xe)}function Sr(n,t,r,e,u,o){return pe(n)&&pe(t)&&(o.set(t,n),mt(n,t,Z,Sr,o)),n}function Wr(n,t){return 1==t.length?n:Re(n,Wt(t,0,-1))}function Cr(n){var t=[];return Ie(n).replace(rn,function(n,r,e,u){ +t.push(e?u.replace(an,"$1"):r||n)}),t}function Ur(n){return ce(n)?n:[]}function Br(n){return typeof n=="function"?n:Ne}function zr(n){if(n instanceof wn)return n.clone();var t=new jn(n.__wrapped__,n.__chain__);return t.__actions__=Pt(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}function Lr(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:Ae(t),Wt(n,0>t?0:t,e)):[]}function $r(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:Ae(t),t=e-t,Wt(n,0,0>t?0:t)):[]}function Fr(n){return n?n[0]:Z; }function Mr(n){var t=n?n.length:0;return t?n[t-1]:Z}function Nr(n,t){return n&&n.length&&t&&t.length?kt(n,t):n}function Zr(n){return n?ku.call(n):n}function Dr(n){if(!n||!n.length)return[];var t=0;return n=o(n,function(n){return ce(n)?(t=wu(n.length,t),true):void 0}),x(t,function(t){return c(n,Ot(t))})}function qr(n,t){if(!n||!n.length)return[];var e=Dr(n);return null==t?e:c(e,function(n){return r(t,Z,n)})}function Pr(n){return n=dn(n),n.__chain__=true,n}function Tr(n,t){return t(n)}function Kr(){return this; -}function Gr(n,t){return typeof t=="function"&&Wo(n)?e(n,t):Nu(n,zr(t))}function Vr(n,t){var r;if(typeof t=="function"&&Wo(n)){for(r=n.length;r--&&false!==t(n[r],r,n););r=n}else r=Zu(n,zr(t));return r}function Jr(n,t){var r=-1,e=we(n),u=e.length,o=u-1;for(t=Hn(Ae(t),0,u);++r=n&&(t=Z),r}}function Xr(n,t,r){return t=r?Z:t,n=sr(n,8,Z,Z,Z,Z,Z,t),n.placeholder=Xr.placeholder,n}function ne(n,t,r){return t=r?Z:t,n=sr(n,16,Z,Z,Z,Z,Z,t),n.placeholder=ne.placeholder,n}function te(n,t,r){function e(){p&&lu(p),a&&lu(a),g=0,c=a=h=p=_=Z}function u(t,r){r&&lu(r),a=p=_=Z,t&&(g=jo(),l=n.apply(h,c),p||a||(c=h=Z))}function o(){var n=t-(jo()-s); 0>=n||n>t?u(_,a):p=vu(o,n)}function i(){u(y,p)}function f(){if(c=arguments,s=jo(),h=this,_=y&&(p||!v),false===d)var r=v&&!p;else{a||v||(g=s);var e=d-(s-g),u=0>=e||e>d;u?(a&&(a=lu(a)),g=s,l=n.apply(h,c)):a||(a=vu(i,e))}return u&&p?p=lu(p):p||t===d||(p=vu(o,t)),r&&(u=true,l=n.apply(h,c)),!u||p||a||(c=h=Z),l}var c,a,l,s,h,p,_,g=0,v=false,d=false,y=true;if(typeof n!="function")throw new He("Expected a function");return t=Ee(t)||0,pe(r)&&(v=!!r.leading,d="maxWait"in r&&wu(Ee(r.maxWait)||0,t),y="trailing"in r?!!r.trailing:y), f.cancel=e,f.flush=function(){return(p&&_||a&&y)&&(l=n.apply(h,c)),e(),l},f}function re(n,t){function r(){var e=arguments,u=t?t.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=n.apply(this,e),r.cache=o.set(u,e),e)}if(typeof n!="function"||t&&typeof t!="function")throw new He("Expected a function");return r.cache=new re.Cache,r}function ee(n,t){if(typeof n!="function")throw new He("Expected a function");return t=wu(t===Z?n.length-1:Ae(t),0),function(){for(var e=arguments,u=-1,o=wu(e.length-t,0),i=Array(o);++ut}function ie(n){return ce(n)&&tu.call(n,"callee")&&(!gu.call(n,"callee")||"[object Arguments]"==uu.call(n))}function fe(n){return null!=n&&!(typeof n=="function"&&le(n))&&he(Gu(n))}function ce(n){return _e(n)&&fe(n)}function ae(n){return _e(n)&&typeof n.message=="string"&&"[object Error]"==uu.call(n); }function le(n){return n=pe(n)?uu.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function se(n){return typeof n=="number"&&n==Ae(n)}function he(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function pe(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function _e(n){return!!n&&typeof n=="object"}function ge(n){return null==n?false:le(n)?iu.test(nu.call(n)):_e(n)&&(C(n)?iu:gn).test(n)}function ve(n){return typeof n=="number"||_e(n)&&"[object Number]"==uu.call(n); }function de(n){if(!_e(n)||"[object Object]"!=uu.call(n)||C(n))return false;var t=Xe;return typeof n.constructor=="function"&&(t=hu(n)),null===t?true:(n=t.constructor,typeof n=="function"&&n instanceof n&&nu.call(n)==eu)}function ye(n){return pe(n)&&"[object RegExp]"==uu.call(n)}function be(n){return typeof n=="string"||!Wo(n)&&_e(n)&&"[object String]"==uu.call(n)}function xe(n){return typeof n=="symbol"||_e(n)&&"[object Symbol]"==uu.call(n)}function me(n){return _e(n)&&he(n.length)&&!!Wn[uu.call(n)]}function je(n,t){ -return t>n}function we(n){if(!n)return[];if(fe(n))return be(n)?n.match(On):Pt(n);if(_u&&n[_u])return z(n[_u]());var t=br(n);return("[object Map]"==t?B:"[object Set]"==t?$:Be)(n)}function Ae(n){if(!n)return 0===n?n:0;if(n=Ee(n),n===D||n===-D)return 1.7976931348623157e308*(0>n?-1:1);var t=n%1;return n===n?t?n-t:n:0}function Oe(n){return n?Hn(Ae(n),0,4294967295):0}function Ee(n){if(pe(n)&&(n=le(n.valueOf)?n.valueOf():n,n=pe(n)?n+"":n),typeof n!="string")return 0===n?n:+n;n=n.replace(on,"");var t=_n.test(n); -return t||vn.test(n)?Mn(n.slice(2),t?2:8):pn.test(n)?q:+n}function ke(n){return Tt(n,Ue(n))}function Ie(n){if(typeof n=="string")return n;if(null==n)return"";if(xe(n))return fu?$u.call(n):"";var t=n+"";return"0"==t&&1/n==-D?"-0":t}function Re(n,t,r){return n=null==n?Z:at(n,t),n===Z?r:n}function Se(n,t){return xr(n,t,lt)}function We(n,t){return xr(n,t,st)}function Ce(n){var t=Rr(n);if(!t&&!fe(n))return ju(Object(n));var r,e=Ar(n),u=!!e,e=e||[],o=e.length;for(r in n)!lt(n,r)||u&&("length"==r||U(r,o))||t&&"constructor"==r||e.push(r); -return e}function Ue(n){for(var t=-1,r=Rr(n),e=dt(n),u=e.length,o=Ar(n),i=!!o,o=o||[],f=o.length;++tt||t>9007199254740991)return r;do t%2&&(r+=n),t=bu(t/2),n+=n;while(t);return r; +return t>n}function we(n){if(!n)return[];if(fe(n))return be(n)?n.match(On):Pt(n);if(_u&&n[_u])return B(n[_u]());var t=br(n);return("[object Map]"==t?z:"[object Set]"==t?$:ze)(n)}function Ae(n){if(!n)return 0===n?n:0;if(n=Ee(n),n===D||n===-D)return 1.7976931348623157e308*(0>n?-1:1);var t=n%1;return n===n?t?n-t:n:0}function Oe(n){return n?Hn(Ae(n),0,4294967295):0}function Ee(n){if(pe(n)&&(n=le(n.valueOf)?n.valueOf():n,n=pe(n)?n+"":n),typeof n!="string")return 0===n?n:+n;n=n.replace(on,"");var t=_n.test(n); +return t||vn.test(n)?Mn(n.slice(2),t?2:8):pn.test(n)?q:+n}function ke(n){return Tt(n,Ue(n))}function Ie(n){if(typeof n=="string")return n;if(null==n)return"";if(xe(n))return cu?$u.call(n):"";var t=n+"";return"0"==t&&1/n==-D?"-0":t}function Re(n,t,r){return n=null==n?Z:at(n,t),n===Z?r:n}function Se(n,t){return xr(n,t,lt)}function We(n,t){return xr(n,t,st)}function Ce(n){var t=Rr(n);if(!t&&!fe(n))return ju(Object(n));var r,e=Ar(n),u=!!e,e=e||[],o=e.length;for(r in n)!lt(n,r)||u&&("length"==r||U(r,o))||t&&"constructor"==r||e.push(r); +return e}function Ue(n){for(var t=-1,r=Rr(n),e=dt(n),u=e.length,o=Ar(n),i=!!o,o=o||[],f=o.length;++tt||t>9007199254740991)return r;do t%2&&(r+=n),t=bu(t/2),n+=n;while(t);return r; }function Me(n,t,r){return n=Ie(n),t=r?Z:t,t===Z&&(t=Rn.test(n)?In:kn),n.match(t)||[]}function Ne(n){return n}function Ze(n){return _e(n)&&!Wo(n)?De(n):vt(n)}function De(n){return bt(Qn(n,true))}function qe(n,t,r){var u=Ce(t),o=ct(t,u);null!=r||pe(t)&&(o.length||!u.length)||(r=t,t=n,n=this,o=ct(t,Ce(t)));var i=pe(r)&&"chain"in r?r.chain:true,f=le(n);return e(o,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(i||t){var r=n(this.__wrapped__);return(r.__actions__=Pt(this.__actions__)).push({ -func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))})}),n}function Pe(){}function Te(n){return Er(n)?Ot(n):Et(n)}function Ke(n){return n&&n.length?b(n,Ne):Z}E=E?Gn.defaults({},E,Gn.pick(Kn,Sn)):Kn;var Ge=E.Date,Ve=E.Error,Je=E.Math,Ye=E.RegExp,He=E.TypeError,Qe=E.Array.prototype,Xe=E.Object.prototype,nu=E.Function.prototype.toString,tu=Xe.hasOwnProperty,ru=0,eu=nu.call(Object),uu=Xe.toString,ou=Kn._,iu=Ye("^"+nu.call(tu).replace(en,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fu=E.Symbol,cu=E.f,au=E.Uint8Array,lu=E.clearTimeout,su=cu?cu.g:Z,hu=Object.getPrototypeOf,pu=Object.getOwnPropertySymbols,_u=typeof(_u=fu&&fu.iterator)=="symbol"?_u:Z,gu=Xe.propertyIsEnumerable,vu=E.setTimeout,du=Qe.splice,yu=Je.ceil,bu=Je.floor,xu=E.isFinite,mu=Qe.join,ju=Object.keys,wu=Je.max,Au=Je.min,Ou=E.parseInt,Eu=Je.random,ku=Qe.reverse,Iu=yr(E,"Map"),Ru=yr(E,"Set"),Su=yr(E,"WeakMap"),Wu=yr(Object,"create"),Cu=Su&&new Su,Uu=Iu?nu.call(Iu):"",zu=Ru?nu.call(Ru):"",Bu=fu?fu.prototype:Z,Lu=fu?Bu.valueOf:Z,$u=fu?Bu.toString:Z,Fu={}; -dn.templateSettings={escape:H,evaluate:Q,interpolate:X,variable:"",imports:{_:dn}};var Mu=function(){function n(){}return function(t){if(pe(t)){n.prototype=t;var r=new n;n.prototype=Z}return r||{}}}(),Nu=Yt(it),Zu=Yt(ft,true),Du=Ht(),qu=Ht(true);su&&!gu.call({valueOf:1},"valueOf")&&(dt=function(n){return z(su(n))});var Pu=Cu?function(n,t){return Cu.set(n,t),n}:Ne,Tu=Ru&&2===new Ru([1,2]).size?function(n){return new Ru(n)}:Pe,Ku=Cu?function(n){return Cu.get(n)}:Pe,Gu=Ot("length"),Vu=pu||function(){return[]; -};(Iu&&"[object Map]"!=br(new Iu)||Ru&&"[object Set]"!=br(new Ru))&&(br=function(n){var t=uu.call(n);if(n="[object Object]"==t?n.constructor:null,n=typeof n=="function"?nu.call(n):""){if(n==Uu)return"[object Map]";if(n==zu)return"[object Set]"}return t});var Ju=function(){var n=0,t=0;return function(r,e){var u=jo(),o=16-(u-t);if(t=u,o>0){if(150<=++n)return r}else n=0;return Pu(r,e)}}(),Yu=ee(function(n,t){t=ut(t);for(var r=Wo(n)?n:[Object(n)],e=t,u=-1,o=r.length,i=-1,f=e.length,c=Array(o+f);++u0){if(150<=++n)return r}else n=0;return Pu(r,e)}}(),Yu=ee(function(n,t){Wo(n)||(n=null==n?[]:[Object(n)]),t=ut(t);for(var r=n,e=t,u=-1,o=r.length,i=-1,f=e.length,c=Array(o+f);++u1?n[t-1]:Z,t=typeof t=="function"?(n.pop(),t):Z;return qr(n,t)}),_o=ee(function(n){function t(t){return Yn(t,n)}n=ut(n);var r=n.length,e=r?n[0]:0,u=this.__wrapped__;return 1>=r&&!this.__actions__.length&&u instanceof wn&&U(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:Tr,args:[t],thisArg:Z}),new jn(u,this.__chain__).thru(function(n){return r&&!n.length&&n.push(Z),n})):this.thru(t)}),go=Vt(function(n,t,r){tu.call(n,r)?++n[r]:n[r]=1; }),vo=Vt(function(n,t,r){tu.call(n,r)?n[r].push(t):n[r]=[t]}),yo=ee(function(n,t,e){var u=-1,o=typeof t=="function",i=Er(t),f=fe(n)?Array(n.length):[];return Nu(n,function(n){var c=o?t:i&&null!=n?n[t]:Z;f[++u]=c?r(c,n,e):pt(n,t,e)}),f}),bo=Vt(function(n,t,r){n[r]=t}),xo=Vt(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),mo=ee(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Or(n,t[0],t[1])?t=[]:r>2&&Or(t[0],t[1],t[2])&&(t.length=1),jt(n,ut(t),[])}),jo=Ge.now,wo=ee(function(n,t,r){ var e=1;if(r.length)var u=L(r,wo.placeholder),e=32|e;return sr(n,e,t,r,u)}),Ao=ee(function(n,t,r){var e=3;if(r.length)var u=L(r,Ao.placeholder),e=32|e;return sr(t,e,n,r,u)}),Oo=ee(function(n,t){return nt(n,1,t)}),Eo=ee(function(n,t,r){return nt(n,Ee(t)||0,r)}),ko=ee(function(n,t){t=c(ut(t),vr());var e=t.length;return ee(function(u){for(var o=-1,i=Au(u.length,e);++oe.length?qn(e,n,t):(r.array=null,r.map=new zn(e))),(r=r.map)&&r.set(n,t), -this},re.Cache=zn,dn.after=function(n,t){if(typeof t!="function")throw new He("Expected a function");return n=Ae(n),function(){return 1>--n?t.apply(this,arguments):void 0}},dn.ary=Hr,dn.assign=Co,dn.assignIn=Uo,dn.assignInWith=zo,dn.assignWith=Bo,dn.at=Lo,dn.before=Qr,dn.bind=wo,dn.bindAll=Xo,dn.bindKey=Ao,dn.chain=Pr,dn.chunk=function(n,t){t=wu(Ae(t),0);var r=n?n.length:0;if(!r||1>t)return[];for(var e=0,u=-1,o=Array(yu(r/t));r>e;)o[++u]=Wt(n,e,e+=t);return o},dn.compact=function(n){for(var t=-1,r=n?n.length:0,e=-1,u=[];++te.length?qn(e,n,t):(r.array=null,r.map=new Bn(e))),(r=r.map)&&r.set(n,t), +this},re.Cache=Bn,dn.after=function(n,t){if(typeof t!="function")throw new He("Expected a function");return n=Ae(n),function(){return 1>--n?t.apply(this,arguments):void 0}},dn.ary=Hr,dn.assign=Co,dn.assignIn=Uo,dn.assignInWith=Bo,dn.assignWith=zo,dn.at=Lo,dn.before=Qr,dn.bind=wo,dn.bindAll=Xo,dn.bindKey=Ao,dn.chain=Pr,dn.chunk=function(n,t){t=wu(Ae(t),0);var r=n?n.length:0;if(!r||1>t)return[];for(var e=0,u=-1,o=Array(yu(r/t));r>e;)o[++u]=Wt(n,e,e+=t);return o},dn.compact=function(n){for(var t=-1,r=n?n.length:0,e=-1,u=[];++tr&&(r=-r>u?0:u+r),e=e===Z||e>u?u:Ae(e),0>e&&(e+=u),e=r>e?0:Oe(e);e>r;)n[r++]=t;return n}, -dn.filter=function(n,t){return(Wo(n)?o:et)(n,vr(t,3))},dn.flatMap=function(n,t){return n&&n.length?ut(c(n,vr(t,3))):[]},dn.flatten=function(n){return n&&n.length?ut(n):[]},dn.flattenDeep=function(n){return n&&n.length?ut(n,true):[]},dn.flip=function(n){return sr(n,512)},dn.flow=ni,dn.flowRight=ti,dn.fromPairs=function(n){for(var t=-1,r=n?n.length:0,e={};++tt?0:t)):[]},dn.takeRight=function(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:Ae(t),t=e-t,Wt(n,0>t?0:t,e)):[]},dn.takeRightWhile=function(n,t){return n&&n.length?Ft(n,vr(t,3),false,true):[]},dn.takeWhile=function(n,t){return n&&n.length?Ft(n,vr(t,3)):[]},dn.tap=function(n,t){return t(n),n},dn.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new He("Expected a function");return pe(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u), -te(n,t,{leading:e,maxWait:t,trailing:u})},dn.thru=Tr,dn.toArray=we,dn.toPairs=ze,dn.toPairsIn=function(n){return m(n,Ue(n))},dn.toPath=function(n){return Wo(n)?c(n,String):Cr(n)},dn.toPlainObject=ke,dn.transform=function(n,t,r){var u=Wo(n)||me(n);if(t=vr(t,4),null==r)if(u||pe(n)){var o=n.constructor;r=u?Wo(n)?new o:[]:Mu(le(o)?o.prototype:Z)}else r={};return(u?e:it)(n,function(n,e,u){return t(r,n,e,u)}),r},dn.unary=function(n){return Hr(n,1)},dn.union=oo,dn.unionBy=io,dn.unionWith=fo,dn.uniq=function(n){ -return n&&n.length?$t(n):[]},dn.uniqBy=function(n,t){return n&&n.length?$t(n,vr(t)):[]},dn.uniqWith=function(n,t){return n&&n.length?$t(n,Z,t):[]},dn.unset=function(n,t){var r;if(null==n)r=true;else{r=n;var e=t,e=Er(e,r)?[e+""]:Lt(e);r=Wr(r,e),e=Mr(e),r=null!=r&&Se(r,e)?delete r[e]:true}return r},dn.unzip=Dr,dn.unzipWith=qr,dn.values=Be,dn.valuesIn=function(n){return null==n?w(n,Ue(n)):[]},dn.without=co,dn.words=Me,dn.wrap=function(n,t){return t=null==t?Ne:t,Io(t,n)},dn.xor=ao,dn.xorBy=lo,dn.xorWith=so, -dn.zip=ho,dn.zipObject=function(n,t){for(var r=-1,e=n?n.length:0,u=t?t.length:0,o={};++rr?t[r]:Z);return o},dn.zipWith=po,dn.each=Gr,dn.eachRight=Vr,dn.extend=Uo,dn.extendWith=zo,qe(dn,dn),dn.add=function(n,t){var r;return n!==Z&&(r=n),t!==Z&&(r=r===Z?t:r+t),r},dn.attempt=Qo,dn.camelCase=Po,dn.capitalize=Le,dn.ceil=ai,dn.clamp=function(n,t,r){return r===Z&&(r=t,t=Z),r!==Z&&(r=Ee(r),r=r===r?r:0),t!==Z&&(t=Ee(t),t=t===t?t:0),Hn(Ee(n),t,r)},dn.clone=function(n){return Qn(n)},dn.cloneDeep=function(n){ -return Qn(n,true)},dn.cloneDeepWith=function(n,t){return Qn(n,true,t)},dn.cloneWith=function(n,t){return Qn(n,false,t)},dn.deburr=$e,dn.endsWith=function(n,t,r){n=Ie(n),t=typeof t=="string"?t:t+"";var e=n.length;return r=r===Z?e:Hn(Ae(r),0,e),r-=t.length,r>=0&&n.indexOf(t,r)==r},dn.eq=ue,dn.escape=function(n){return(n=Ie(n))&&Y.test(n)?n.replace(V,R):n},dn.escapeRegExp=function(n){return(n=Ie(n))&&un.test(n)?n.replace(en,"\\$&"):n},dn.every=function(n,t,r){var e=Wo(n)?u:rt;return r&&Or(n,t,r)&&(t=Z),e(n,vr(t,3)); -},dn.find=function(n,t){if(t=vr(t,3),Wo(n)){var r=g(n,t);return r>-1?n[r]:Z}return _(n,t,Nu)},dn.findIndex=function(n,t){return n&&n.length?g(n,vr(t,3)):-1},dn.findKey=function(n,t){return _(n,vr(t,3),it,true)},dn.findLast=function(n,t){if(t=vr(t,3),Wo(n)){var r=g(n,t,true);return r>-1?n[r]:Z}return _(n,t,Zu)},dn.findLastIndex=function(n,t){return n&&n.length?g(n,vr(t,3),true):-1},dn.findLastKey=function(n,t){return _(n,vr(t,3),ft,true)},dn.floor=li,dn.forEach=Gr,dn.forEachRight=Vr,dn.forIn=function(n,t){ -return null==n?n:Du(n,zr(t),Ue)},dn.forInRight=function(n,t){return null==n?n:qu(n,zr(t),Ue)},dn.forOwn=function(n,t){return n&&it(n,zr(t))},dn.forOwnRight=function(n,t){return n&&ft(n,zr(t))},dn.get=Re,dn.gt=oe,dn.gte=function(n,t){return n>=t},dn.has=Se,dn.hasIn=We,dn.head=Fr,dn.identity=Ne,dn.includes=function(n,t,r,e){return n=fe(n)?n:Be(n),r=r&&!e?Ae(r):0,e=n.length,0>r&&(r=wu(e+r,0)),be(n)?e>=r&&-1t?0:t)):[]},dn.takeRight=function(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:Ae(t),t=e-t,Wt(n,0>t?0:t,e)):[]},dn.takeRightWhile=function(n,t){return n&&n.length?Ft(n,vr(t,3),false,true):[]},dn.takeWhile=function(n,t){return n&&n.length?Ft(n,vr(t,3)):[]},dn.tap=function(n,t){return t(n),n},dn.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new He("Expected a function");return pe(r)&&(e="leading"in r?!!r.leading:e, +u="trailing"in r?!!r.trailing:u),te(n,t,{leading:e,maxWait:t,trailing:u})},dn.thru=Tr,dn.toArray=we,dn.toPairs=Be,dn.toPairsIn=function(n){return m(n,Ue(n))},dn.toPath=function(n){return Wo(n)?c(n,String):Cr(n)},dn.toPlainObject=ke,dn.transform=function(n,t,r){var u=Wo(n)||me(n);if(t=vr(t,4),null==r)if(u||pe(n)){var o=n.constructor;r=u?Wo(n)?new o:[]:Mu(le(o)?o.prototype:Z)}else r={};return(u?e:it)(n,function(n,e,u){return t(r,n,e,u)}),r},dn.unary=function(n){return Hr(n,1)},dn.union=oo,dn.unionBy=io, +dn.unionWith=fo,dn.uniq=function(n){return n&&n.length?$t(n):[]},dn.uniqBy=function(n,t){return n&&n.length?$t(n,vr(t)):[]},dn.uniqWith=function(n,t){return n&&n.length?$t(n,Z,t):[]},dn.unset=function(n,t){var r;if(null==n)r=true;else{r=n;var e=t,e=Er(e,r)?[e+""]:Lt(e);r=Wr(r,e),e=Mr(e),r=null!=r&&Se(r,e)?delete r[e]:true}return r},dn.unzip=Dr,dn.unzipWith=qr,dn.values=ze,dn.valuesIn=function(n){return null==n?w(n,Ue(n)):[]},dn.without=co,dn.words=Me,dn.wrap=function(n,t){return t=null==t?Ne:t,Io(t,n); +},dn.xor=ao,dn.xorBy=lo,dn.xorWith=so,dn.zip=ho,dn.zipObject=function(n,t){for(var r=-1,e=n?n.length:0,u=t?t.length:0,o={};++rr?t[r]:Z);return o},dn.zipWith=po,dn.extend=Uo,dn.extendWith=Bo,qe(dn,dn),dn.add=function(n,t){var r;return n!==Z&&(r=n),t!==Z&&(r=r===Z?t:r+t),r},dn.attempt=Qo,dn.camelCase=Po,dn.capitalize=Le,dn.ceil=ai,dn.clamp=function(n,t,r){return r===Z&&(r=t,t=Z),r!==Z&&(r=Ee(r),r=r===r?r:0),t!==Z&&(t=Ee(t),t=t===t?t:0),Hn(Ee(n),t,r)},dn.clone=function(n){return Qn(n); +},dn.cloneDeep=function(n){return Qn(n,true)},dn.cloneDeepWith=function(n,t){return Qn(n,true,t)},dn.cloneWith=function(n,t){return Qn(n,false,t)},dn.deburr=$e,dn.endsWith=function(n,t,r){n=Ie(n),t=typeof t=="string"?t:t+"";var e=n.length;return r=r===Z?e:Hn(Ae(r),0,e),r-=t.length,r>=0&&n.indexOf(t,r)==r},dn.eq=ue,dn.escape=function(n){return(n=Ie(n))&&Y.test(n)?n.replace(V,R):n},dn.escapeRegExp=function(n){return(n=Ie(n))&&un.test(n)?n.replace(en,"\\$&"):n},dn.every=function(n,t,r){var e=Wo(n)?u:rt;return r&&Or(n,t,r)&&(t=Z), +e(n,vr(t,3))},dn.find=function(n,t){if(t=vr(t,3),Wo(n)){var r=g(n,t);return r>-1?n[r]:Z}return _(n,t,Nu)},dn.findIndex=function(n,t){return n&&n.length?g(n,vr(t,3)):-1},dn.findKey=function(n,t){return _(n,vr(t,3),it,true)},dn.findLast=function(n,t){if(t=vr(t,3),Wo(n)){var r=g(n,t,true);return r>-1?n[r]:Z}return _(n,t,Zu)},dn.findLastIndex=function(n,t){return n&&n.length?g(n,vr(t,3),true):-1},dn.findLastKey=function(n,t){return _(n,vr(t,3),ft,true)},dn.floor=li,dn.forEach=Gr,dn.forEachRight=Vr,dn.forIn=function(n,t){ +return null==n?n:Du(n,Br(t),Ue)},dn.forInRight=function(n,t){return null==n?n:qu(n,Br(t),Ue)},dn.forOwn=function(n,t){return n&&it(n,Br(t))},dn.forOwnRight=function(n,t){return n&&ft(n,Br(t))},dn.get=Re,dn.gt=oe,dn.gte=function(n,t){return n>=t},dn.has=Se,dn.hasIn=We,dn.head=Fr,dn.identity=Ne,dn.includes=function(n,t,r,e){return n=fe(n)?n:ze(n),r=r&&!e?Ae(r):0,e=n.length,0>r&&(r=wu(e+r,0)),be(n)?e>=r&&-1r&&(r=wu(e+r,0)),v(n,t,r)):-1},dn.inRange=function(n,t,r){return t=Ee(t)||0,r===Z?(r=t,t=0):r=Ee(r)||0,n=Ee(n),n>=Au(t,r)&&n=-9007199254740991&&9007199254740991>=n},dn.isString=be,dn.isSymbol=xe,dn.isTypedArray=me,dn.isUndefined=function(n){return n===Z},dn.join=function(n,t){return n?mu.call(n,t):""},dn.kebabCase=To,dn.last=Mr,dn.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(r!==Z&&(u=Ae(r),u=(0>u?wu(e+u,0):Au(u,e-1))+1),t!==t)return W(n,u,true);for(;u--;)if(n[u]===t)return u; -return-1},dn.lowerCase=Ko,dn.lowerFirst=Go,dn.lt=je,dn.lte=function(n,t){return t>=n},dn.max=function(n){return n&&n.length?p(n,Ne,oe):Z},dn.maxBy=function(n,t){return n&&n.length?p(n,vr(t),oe):Z},dn.mean=function(n){return Ke(n)/(n?n.length:0)},dn.min=function(n){return n&&n.length?p(n,Ne,je):Z},dn.minBy=function(n,t){return n&&n.length?p(n,vr(t),je):Z},dn.noConflict=function(){return Kn._=ou,this},dn.noop=Pe,dn.now=jo,dn.pad=function(n,t,r){n=Ie(n),t=Ae(t);var e=F(n);return t&&t>e?(e=(t-e)/2,t=bu(e), -e=yu(e),ir("",t,r)+n+ir("",e,r)):n},dn.padEnd=function(n,t,r){return n=Ie(n),n+ir(n,t,r)},dn.padStart=function(n,t,r){return n=Ie(n),ir(n,t,r)+n},dn.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),n=Ie(n).replace(on,""),Ou(n,t||(hn.test(n)?16:10))},dn.random=function(n,t,r){if(r&&typeof r!="boolean"&&Or(n,t,r)&&(t=r=Z),r===Z&&(typeof t=="boolean"?(r=t,t=Z):typeof n=="boolean"&&(r=n,n=Z)),n===Z&&t===Z?(n=0,t=1):(n=Ee(n)||0,t===Z?(t=n,n=0):t=Ee(t)||0),n>t){var e=n;n=t,t=e}return r||n%1||t%1?(r=Eu(), +return-1},dn.lowerCase=Ko,dn.lowerFirst=Go,dn.lt=je,dn.lte=function(n,t){return t>=n},dn.max=function(n){return n&&n.length?p(n,Ne,oe):Z},dn.maxBy=function(n,t){return n&&n.length?p(n,vr(t),oe):Z},dn.mean=function(n){return Ke(n)/(n?n.length:0)},dn.min=function(n){return n&&n.length?p(n,Ne,je):Z},dn.minBy=function(n,t){return n&&n.length?p(n,vr(t),je):Z},dn.noConflict=function(){return Kn._===this&&(Kn._=ou),this},dn.noop=Pe,dn.now=jo,dn.pad=function(n,t,r){n=Ie(n),t=Ae(t);var e=F(n);return t&&t>e?(e=(t-e)/2, +t=bu(e),e=yu(e),ir("",t,r)+n+ir("",e,r)):n},dn.padEnd=function(n,t,r){return n=Ie(n),n+ir(n,t,r)},dn.padStart=function(n,t,r){return n=Ie(n),ir(n,t,r)+n},dn.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),n=Ie(n).replace(on,""),Ou(n,t||(hn.test(n)?16:10))},dn.random=function(n,t,r){if(r&&typeof r!="boolean"&&Or(n,t,r)&&(t=r=Z),r===Z&&(typeof t=="boolean"?(r=t,t=Z):typeof n=="boolean"&&(r=n,n=Z)),n===Z&&t===Z?(n=0,t=1):(n=Ee(n)||0,t===Z?(t=n,n=0):t=Ee(t)||0),n>t){var e=n;n=t,t=e}return r||n%1||t%1?(r=Eu(), Au(n+r*(t-n+Fn("1e-"+((r+"").length-1))),t)):Rt(n,t)},dn.reduce=function(n,t,r){var e=Wo(n)?l:d,u=3>arguments.length;return e(n,vr(t,4),r,u,Nu)},dn.reduceRight=function(n,t,r){var e=Wo(n)?s:d,u=3>arguments.length;return e(n,vr(t,4),r,u,Zu)},dn.repeat=Fe,dn.replace=function(){var n=arguments,t=Ie(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},dn.result=function(n,t,r){if(Er(t,n))e=null==n?Z:n[t];else{t=Lt(t);var e=Re(n,t);n=Wr(n,t)}return e===Z&&(e=r),le(e)?e.call(n):e},dn.round=si,dn.runInContext=N, -dn.sample=function(n){n=fe(n)?n:Be(n);var t=n.length;return t>0?n[Rt(0,t-1)]:Z},dn.size=Yr,dn.snakeCase=Jo,dn.some=function(n,t,r){var e=Wo(n)?h:Ct;return r&&Or(n,t,r)&&(t=Z),e(n,vr(t,3))},dn.sortedIndex=function(n,t){return Ut(n,t)},dn.sortedIndexBy=function(n,t,r){return zt(n,t,vr(r))},dn.sortedIndexOf=function(n,t){var r=n?n.length:0;if(r){var e=Ut(n,t);if(r>e&&ue(n[e],t))return e}return-1},dn.sortedLastIndex=function(n,t){return Ut(n,t,true)},dn.sortedLastIndexBy=function(n,t,r){return zt(n,t,vr(r),true); -},dn.sortedLastIndexOf=function(n,t){if(n&&n.length){var r=Ut(n,t,true)-1;if(ue(n[r],t))return r}return-1},dn.startCase=Yo,dn.startsWith=function(n,t,r){return n=Ie(n),r=Hn(Ae(r),0,n.length),n.lastIndexOf(t,r)==r},dn.subtract=function(n,t){var r;return n!==Z&&(r=n),t!==Z&&(r=r===Z?t:r-t),r},dn.sum=Ke,dn.sumBy=function(n,t){return n&&n.length?b(n,vr(t)):Z},dn.template=function(n,t,r){var e=dn.templateSettings;r&&Or(n,t,r)&&(t=Z),n=Ie(n),t=zo({},t,e,Pn),r=zo({},t.imports,e.imports,Pn);var u,o,i=Ce(r),f=w(r,i),c=0; +dn.sample=function(n){n=fe(n)?n:ze(n);var t=n.length;return t>0?n[Rt(0,t-1)]:Z},dn.size=Yr,dn.snakeCase=Jo,dn.some=function(n,t,r){var e=Wo(n)?h:Ct;return r&&Or(n,t,r)&&(t=Z),e(n,vr(t,3))},dn.sortedIndex=function(n,t){return Ut(n,t)},dn.sortedIndexBy=function(n,t,r){return Bt(n,t,vr(r))},dn.sortedIndexOf=function(n,t){var r=n?n.length:0;if(r){var e=Ut(n,t);if(r>e&&ue(n[e],t))return e}return-1},dn.sortedLastIndex=function(n,t){return Ut(n,t,true)},dn.sortedLastIndexBy=function(n,t,r){return Bt(n,t,vr(r),true); +},dn.sortedLastIndexOf=function(n,t){if(n&&n.length){var r=Ut(n,t,true)-1;if(ue(n[r],t))return r}return-1},dn.startCase=Yo,dn.startsWith=function(n,t,r){return n=Ie(n),r=Hn(Ae(r),0,n.length),n.lastIndexOf(t,r)==r},dn.subtract=function(n,t){var r;return n!==Z&&(r=n),t!==Z&&(r=r===Z?t:r-t),r},dn.sum=Ke,dn.sumBy=function(n,t){return n&&n.length?b(n,vr(t)):Z},dn.template=function(n,t,r){var e=dn.templateSettings;r&&Or(n,t,r)&&(t=Z),n=Ie(n),t=Bo({},t,e,Pn),r=Bo({},t.imports,e.imports,Pn);var u,o,i=Ce(r),f=w(r,i),c=0; r=t.interpolate||bn;var a="__p+='";r=Ye((t.escape||bn).source+"|"+r.source+"|"+(r===X?ln:bn).source+"|"+(t.evaluate||bn).source+"|$","g");var l="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,i,f,l){return e||(e=i),a+=n.slice(c,l).replace(xn,S),r&&(u=true,a+="'+__e("+r+")+'"),f&&(o=true,a+="';"+f+";\n__p+='"),e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),c=l+t.length,t}),a+="';",(t=t.variable)||(a="with(obj){"+a+"}"),a=(o?a.replace(P,""):a).replace(T,"$1").replace(K,"$1;"), -a="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+a+"return __p}",t=Qo(function(){return Function(i,l+"return "+a).apply(Z,f)}),t.source=a,ae(t))throw t;return t},dn.times=function(n,t){if(n=Ae(n),1>n||n>9007199254740991)return[];var r=4294967295,e=Au(n,4294967295);for(t=zr(t),n-=4294967295,e=x(e,t);++rn||n>9007199254740991)return[];var r=4294967295,e=Au(n,4294967295);for(t=Br(t),n-=4294967295,e=x(e,t);++r=o)return n;if(o=r-F(e),1>o)return e;if(r=i?i.slice(0,o).join(""):n.slice(0,o),u===Z)return r+e;if(i&&(o+=r.length-o),ye(u)){if(n.slice(o).search(u)){var f=r;for(u.global||(u=Ye(u.source,Ie(sn.exec(u))+"g")),u.lastIndex=0;i=u.exec(f);)var c=i.index; -r=r.slice(0,c===Z?o:c)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},dn.unescape=function(n){return(n=Ie(n))&&J.test(n)?n.replace(G,M):n},dn.uniqueId=function(n){var t=++ru;return Ie(n)+t},dn.upperCase=Ho,dn.upperFirst=Vo,dn.first=Fr,qe(dn,function(){var n={};return it(dn,function(t,r){tu.call(dn.prototype,r)||(n[r]=t)}),n}(),{chain:false}),dn.VERSION="4.0.0",e("bind bindKey curry curryRight partial partialRight".split(" "),function(n){dn[n].placeholder=dn}),e(["drop","take"],function(n,t){ -wn.prototype[n]=function(r){var e=this.__filtered__;if(e&&!t)return new wn(this);r=r===Z?1:wu(Ae(r),0);var u=this.clone();return e?u.__takeCount__=Au(r,u.__takeCount__):u.__views__.push({size:Au(r,4294967295),type:n+(0>u.__dir__?"Right":"")}),u},wn.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),e(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;wn.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:vr(n,3),type:r}),t.__filtered__=t.__filtered__||e, -t}}),e(["head","last"],function(n,t){var r="take"+(t?"Right":"");wn.prototype[n]=function(){return this[r](1).value()[0]}}),e(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");wn.prototype[n]=function(){return this.__filtered__?new wn(this):this[r](1)}}),wn.prototype.compact=function(){return this.filter(Ne)},wn.prototype.find=function(n){return this.filter(n).head()},wn.prototype.findLast=function(n){return this.reverse().find(n)},wn.prototype.invokeMap=ee(function(n,t){return typeof n=="function"?new wn(this):this.map(function(r){ -return pt(r,n,t)})}),wn.prototype.reject=function(n){return n=vr(n,3),this.filter(function(t){return!n(t)})},wn.prototype.slice=function(n,t){n=Ae(n);var r=this;return r.__filtered__&&(n>0||0>t)?new wn(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==Z&&(t=Ae(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},wn.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},wn.prototype.toArray=function(){return this.take(4294967295)},it(wn.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=dn[e?"take"+("last"==t?"Right":""):t],o=e||/^find/.test(t); -u&&(dn.prototype[t]=function(){function t(n){return n=u.apply(dn,a([n],f)),e&&h?n[0]:n}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof wn,l=f[0],s=c||Wo(i);s&&r&&typeof l=="function"&&1!=l.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,l=o&&!h,c=c&&!p;return!o&&s?(i=c?i:new wn(this),i=n.apply(i,f),i.__actions__.push({func:Tr,args:[t],thisArg:Z}),new jn(i,h)):l&&c?n.apply(this,f):(i=this.thru(t),l?e?i.value()[0]:i.value():i)})}),e("pop push shift sort splice unshift".split(" "),function(n){ -var t=Qe[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);dn.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),it(wn.prototype,function(n,t){var r=dn[t];if(r){var e=r.name+"";(Fu[e]||(Fu[e]=[])).push({name:t,func:r})}}),Fu[ur(Z,2).name]=[{name:"wrapper",func:Z}],wn.prototype.clone=function(){var n=new wn(this.__wrapped__);return n.__actions__=Pt(this.__actions__),n.__dir__=this.__dir__, -n.__filtered__=this.__filtered__,n.__iteratees__=Pt(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Pt(this.__views__),n},wn.prototype.reverse=function(){if(this.__filtered__){var n=new wn(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},wn.prototype.value=function(){var n,t=this.__wrapped__.value(),r=this.__dir__,e=Wo(t),u=0>r,o=e?t.length:0;n=o;for(var i=this.__views__,f=0,c=-1,a=i.length;++co||o==n&&a==n)return Mt(t,this.__actions__);e=[];n:for(;n--&&a>c;){for(u+=r,o=-1,l=t[u];++o=this.__values__.length,t=n?Z:this.__values__[this.__index__++];return{done:n,value:t}},dn.prototype.plant=function(n){for(var t,r=this;r instanceof mn;){var e=Br(r);e.__index__=0,e.__values__=Z,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},dn.prototype.reverse=function(){ -var n=this.__wrapped__;return n instanceof wn?(this.__actions__.length&&(n=new wn(this)),n=n.reverse(),n.__actions__.push({func:Tr,args:[Zr],thisArg:Z}),new jn(n,this.__chain__)):this.thru(Zr)},dn.prototype.toJSON=dn.prototype.valueOf=dn.prototype.value=function(){return Mt(this.__wrapped__,this.__actions__)},_u&&(dn.prototype[_u]=Kr),dn}var Z,D=1/0,q=NaN,P=/\b__p\+='';/g,T=/\b(__p\+=)''\+/g,K=/(__e\(.*?\)|\b__t\))\+'';/g,G=/&(?:amp|lt|gt|quot|#39|#96);/g,V=/[&<>"'`]/g,J=RegExp(G.source),Y=RegExp(V.source),H=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,nn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tn=/^\w*$/,rn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,en=/[\\^$.*+?()[\]{}|]/g,un=RegExp(en.source),on=/^\s+|\s+$/g,fn=/^\s+/,cn=/\s+$/,an=/\\(\\)?/g,ln=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,sn=/\w*$/,hn=/^0x/i,pn=/^[-+]0x[0-9a-f]+$/i,_n=/^0b[01]+$/i,gn=/^\[object .+?Constructor\]$/,vn=/^0o[0-7]+$/i,dn=/^(?:0|[1-9]\d*)$/,yn=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,bn=/($^)/,xn=/['\n\r\u2028\u2029\\]/g,mn="[\\ufe0e\\ufe0f]?(?:\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:\\ud83c[\\udffb-\\udfff])?)*",jn="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+mn,wn="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23]?|[\\u0300-\\u036f\\ufe20-\\ufe23]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",An=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23]","g"),On=RegExp(wn+mn,"g"),En=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\ufe0e\\ufe0f]"),kn=/[a-zA-Z0-9]+/g,In=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+|\\d+(?:(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+)?",jn].join("|"),"g"),Rn=/[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Sn="Array Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Reflect RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Wn={}; +r=r.slice(0,c===Z?o:c)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},dn.unescape=function(n){return(n=Ie(n))&&J.test(n)?n.replace(G,M):n},dn.uniqueId=function(n){var t=++ru;return Ie(n)+t},dn.upperCase=Ho,dn.upperFirst=Vo,dn.each=Gr,dn.eachRight=Vr,dn.first=Fr,qe(dn,function(){var n={};return it(dn,function(t,r){tu.call(dn.prototype,r)||(n[r]=t)}),n}(),{chain:false}),dn.VERSION="4.0.1",e("bind bindKey curry curryRight partial partialRight".split(" "),function(n){dn[n].placeholder=dn; +}),e(["drop","take"],function(n,t){wn.prototype[n]=function(r){var e=this.__filtered__;if(e&&!t)return new wn(this);r=r===Z?1:wu(Ae(r),0);var u=this.clone();return e?u.__takeCount__=Au(r,u.__takeCount__):u.__views__.push({size:Au(r,4294967295),type:n+(0>u.__dir__?"Right":"")}),u},wn.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),e(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;wn.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({ +iteratee:vr(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),e(["head","last"],function(n,t){var r="take"+(t?"Right":"");wn.prototype[n]=function(){return this[r](1).value()[0]}}),e(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");wn.prototype[n]=function(){return this.__filtered__?new wn(this):this[r](1)}}),wn.prototype.compact=function(){return this.filter(Ne)},wn.prototype.find=function(n){return this.filter(n).head()},wn.prototype.findLast=function(n){return this.reverse().find(n); +},wn.prototype.invokeMap=ee(function(n,t){return typeof n=="function"?new wn(this):this.map(function(r){return pt(r,n,t)})}),wn.prototype.reject=function(n){return n=vr(n,3),this.filter(function(t){return!n(t)})},wn.prototype.slice=function(n,t){n=Ae(n);var r=this;return r.__filtered__&&(n>0||0>t)?new wn(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==Z&&(t=Ae(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},wn.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},wn.prototype.toArray=function(){ +return this.take(4294967295)},it(wn.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=dn[e?"take"+("last"==t?"Right":""):t],o=e||/^find/.test(t);u&&(dn.prototype[t]=function(){function t(n){return n=u.apply(dn,a([n],f)),e&&h?n[0]:n}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof wn,l=f[0],s=c||Wo(i);s&&r&&typeof l=="function"&&1!=l.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,l=o&&!h,c=c&&!p;return!o&&s?(i=c?i:new wn(this), +i=n.apply(i,f),i.__actions__.push({func:Tr,args:[t],thisArg:Z}),new jn(i,h)):l&&c?n.apply(this,f):(i=this.thru(t),l?e?i.value()[0]:i.value():i)})}),e("pop push shift sort splice unshift".split(" "),function(n){var t=Qe[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);dn.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),it(wn.prototype,function(n,t){var r=dn[t];if(r){var e=r.name+"";(Fu[e]||(Fu[e]=[])).push({ +name:t,func:r})}}),Fu[ur(Z,2).name]=[{name:"wrapper",func:Z}],wn.prototype.clone=function(){var n=new wn(this.__wrapped__);return n.__actions__=Pt(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Pt(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Pt(this.__views__),n},wn.prototype.reverse=function(){if(this.__filtered__){var n=new wn(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},wn.prototype.value=function(){ +var n,t=this.__wrapped__.value(),r=this.__dir__,e=Wo(t),u=0>r,o=e?t.length:0;n=o;for(var i=this.__views__,f=0,c=-1,a=i.length;++co||o==n&&a==n)return Mt(t,this.__actions__);e=[];n:for(;n--&&a>c;){for(u+=r,o=-1,l=t[u];++o=this.__values__.length,t=n?Z:this.__values__[this.__index__++];return{done:n,value:t}},dn.prototype.plant=function(n){ +for(var t,r=this;r instanceof mn;){var e=zr(r);e.__index__=0,e.__values__=Z,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},dn.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof wn?(this.__actions__.length&&(n=new wn(this)),n=n.reverse(),n.__actions__.push({func:Tr,args:[Zr],thisArg:Z}),new jn(n,this.__chain__)):this.thru(Zr)},dn.prototype.toJSON=dn.prototype.valueOf=dn.prototype.value=function(){return Mt(this.__wrapped__,this.__actions__)},_u&&(dn.prototype[_u]=Kr), +dn}var Z,D=1/0,q=NaN,P=/\b__p\+='';/g,T=/\b(__p\+=)''\+/g,K=/(__e\(.*?\)|\b__t\))\+'';/g,G=/&(?:amp|lt|gt|quot|#39|#96);/g,V=/[&<>"'`]/g,J=RegExp(G.source),Y=RegExp(V.source),H=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,nn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tn=/^\w*$/,rn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,en=/[\\^$.*+?()[\]{}|]/g,un=RegExp(en.source),on=/^\s+|\s+$/g,fn=/^\s+/,cn=/\s+$/,an=/\\(\\)?/g,ln=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,sn=/\w*$/,hn=/^0x/i,pn=/^[-+]0x[0-9a-f]+$/i,_n=/^0b[01]+$/i,gn=/^\[object .+?Constructor\]$/,vn=/^0o[0-7]+$/i,dn=/^(?:0|[1-9]\d*)$/,yn=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,bn=/($^)/,xn=/['\n\r\u2028\u2029\\]/g,mn="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*",jn="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+mn,wn="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",An=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),On=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+wn+mn,"g"),En=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),kn=/[a-zA-Z0-9]+/g,In=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|\\d+",jn].join("|"),"g"),Rn=/[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Sn="Array Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Reflect RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Wn={}; Wn["[object Float32Array]"]=Wn["[object Float64Array]"]=Wn["[object Int8Array]"]=Wn["[object Int16Array]"]=Wn["[object Int32Array]"]=Wn["[object Uint8Array]"]=Wn["[object Uint8ClampedArray]"]=Wn["[object Uint16Array]"]=Wn["[object Uint32Array]"]=true,Wn["[object Arguments]"]=Wn["[object Array]"]=Wn["[object ArrayBuffer]"]=Wn["[object Boolean]"]=Wn["[object Date]"]=Wn["[object Error]"]=Wn["[object Function]"]=Wn["[object Map]"]=Wn["[object Number]"]=Wn["[object Object]"]=Wn["[object RegExp]"]=Wn["[object Set]"]=Wn["[object String]"]=Wn["[object WeakMap]"]=false; var Cn={};Cn["[object Arguments]"]=Cn["[object Array]"]=Cn["[object ArrayBuffer]"]=Cn["[object Boolean]"]=Cn["[object Date]"]=Cn["[object Float32Array]"]=Cn["[object Float64Array]"]=Cn["[object Int8Array]"]=Cn["[object Int16Array]"]=Cn["[object Int32Array]"]=Cn["[object Map]"]=Cn["[object Number]"]=Cn["[object Object]"]=Cn["[object RegExp]"]=Cn["[object Set]"]=Cn["[object String]"]=Cn["[object Symbol]"]=Cn["[object Uint8Array]"]=Cn["[object Uint8ClampedArray]"]=Cn["[object Uint16Array]"]=Cn["[object Uint32Array]"]=true, Cn["[object Error]"]=Cn["[object Function]"]=Cn["[object WeakMap]"]=false;var Un={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O", -"\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},zn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Bn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ln={"function":true,object:true},$n={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029" +"\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Bn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},zn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ln={"function":true,object:true},$n={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029" },Fn=parseFloat,Mn=parseInt,Nn=Ln[typeof exports]&&exports&&!exports.nodeType?exports:null,Zn=Ln[typeof module]&&module&&!module.nodeType?module:null,Dn=E(Ln[typeof self]&&self),qn=E(Ln[typeof window]&&window),Pn=Zn&&Zn.exports===Nn?Nn:null,Tn=E(Ln[typeof this]&&this),Kn=E(Nn&&Zn&&typeof global=="object"&&global)||qn!==(Tn&&Tn.window)&&qn||Dn||Tn||Function("return this")(),Gn=N();(qn||Dn||{})._=Gn,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Gn}):Nn&&Zn?(Pn&&((Zn.exports=Gn)._=Gn), Nn._=Gn):Kn._=Gn}).call(this); \ No newline at end of file diff --git a/dist/mapping.fp.js b/dist/mapping.fp.js index fcf6e537c7..4788970469 100644 --- a/dist/mapping.fp.js +++ b/dist/mapping.fp.js @@ -57,28 +57,29 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = { /** Used to map method names to their aliases. */ - 'aliasMap': { + 'alias': { 'ary': ['nAry'], - 'overEvery': ['allPass'], - 'overSome': ['somePass'], + 'assignIn': ['extend'], + 'assignInWith': ['extendWith'], 'filter': ['whereEq'], 'flatten': ['unnest'], 'flow': ['pipe'], 'flowRight': ['compose'], 'forEach': ['each'], 'forEachRight': ['eachRight'], - 'get': ['path'], - 'getOr': ['pathOr'], + 'get': ['path', 'prop'], + 'getOr': ['pathOr', 'propOr'], 'head': ['first'], 'includes': ['contains'], 'initial': ['init'], 'isEqual': ['equals'], 'mapValues': ['mapObj'], 'matchesProperty': ['pathEq'], - 'overArgs': ['useWith'], 'omit': ['dissoc', 'omitAll'], + 'overArgs': ['useWith'], + 'overEvery': ['allPass'], + 'overSome': ['somePass'], 'pick': ['pickAll'], - 'property': ['prop'], 'propertyOf': ['propOf'], 'rest': ['unapply'], 'some': ['all'], @@ -87,14 +88,14 @@ return /******/ (function(modules) { // webpackBootstrap }, /** Used to map method names to their iteratee ary. */ - 'aryIterateeMap': { + 'aryIteratee': { 'assignWith': 2, + 'assignInWith': 2, 'cloneDeepWith': 1, 'cloneWith': 1, 'dropRightWhile': 1, 'dropWhile': 1, 'every': 1, - 'extendWith': 2, 'filter': 1, 'find': 1, 'findIndex': 1, @@ -127,61 +128,82 @@ return /******/ (function(modules) { // webpackBootstrap }, /** Used to map ary to method names. */ - 'aryMethodMap': { - 1: ( - 'attempt,ceil,create,curry,curryRight,floor,fromPairs,iteratee,invert,over,' + - 'overEvery,overSome,memoize,method,methodOf,mixin,rest,reverse,round,' + - 'runInContext,template,trim,trimLeft,trimRight,uniqueId,words').split(','), - 2: ( - 'add,ary,assign,at,bind,bindKey,cloneDeepWith,cloneWith,concat,countBy,curryN,' + - 'curryRightN,debounce,defaults,defaultsDeep,delay,difference,drop,dropRight,' + - 'dropRightWhile,dropWhile,endsWith,eq,every,extend,filter,find,find,findIndex,' + - 'findKey,findLast,findLastIndex,findLastKey,flatMap,forEach,forEachRight,' + - 'forIn,forInRight,forOwn,forOwnRight,get,groupBy,includes,indexBy,indexOf,' + - 'intersection,invoke,invokeMap,isMatch,lastIndexOf,map,mapKeys,mapValues,' + - 'matchesProperty,maxBy,mean,minBy,merge,omit,orderBy,overArgs,pad,padLeft,' + - 'padRight,parseInt,partition,pick,pull,pullAll,pullAt,random,range,rangeRight,' + - 'rearg,reject,remove,repeat,result,sampleSize,some,sortBy,sortedIndexBy,' + - 'sortedLastIndexBy,sortedUniqBy,startsWith,subtract,sumBy,take,takeRight,' + - 'takeRightWhile,takeWhile,throttle,times,truncate,union,uniqBy,without,wrap,' + - 'xor,zip,zipObject').split(','), - 3: ( - 'assignWith,clamp,differenceBy,extendWith,getOr,inRange,intersectionBy,' + - 'isEqualWith,isMatchWith,mergeWith,omitBy,pickBy,pullAllBy,reduce,' + - 'reduceRight,set,slice,transform,unionBy,xorBy,zipWith').split(','), - 4: - ['fill', 'setWith'] + 'aryMethod': { + 1:[ + 'attempt', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'fromPairs', + 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin', 'over', + 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext', + 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words' + ], + 2:[ + 'add', 'after', 'ary', 'assign', 'at', 'before', 'bind', 'bindKey', + 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', + 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', + 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', + 'every', 'extend', 'filter', 'find', 'find', 'findIndex', 'findKey', + 'findLast', 'findLastIndex', 'findLastKey', 'flatMap', 'forEach', + 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', + 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', + 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', + 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', + 'merge', 'minBy', 'omit', 'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd', + 'padStart', 'parseInt', 'partition', 'pick', 'pickBy', 'pull', 'pullAll', + 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', + 'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', + 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', + 'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', + 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'truncate', 'union', 'uniqBy', + 'uniqWith', 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject' + ], + 3:[ + 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', + 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith', + 'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace', + 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', + 'unionWith', 'xorBy', 'xorWith', 'zipWith' + ], + 4:[ + 'fill', 'setWith' + ] }, - /** Used to map ary to rearg configs by method ary. */ - 'aryReargMap': { + /** Used to map ary to rearg configs. */ + 'aryRearg': { 2: [1, 0], 3: [2, 1, 0], 4: [3, 2, 0, 1] }, - /** Used to map ary to rearg configs by method names. */ - 'methodReargMap': { + /** Used to map method names to iteratee rearg configs. */ + 'iterateeRearg': { + 'findKey': [1], + 'findLastKey': [1], + 'mapKeys': [1] + }, + + /** Used to map method names to rearg configs. */ + 'methodRearg': { 'clamp': [2, 0, 1], 'reduce': [2, 0, 1], 'reduceRight': [2, 0, 1], - 'setWith': [3, 2, 1, 0], + 'set': [2, 0, 1], + 'setWith': [3, 1, 2, 0], 'slice': [2, 0, 1], 'transform': [2, 0, 1] }, - /** Used to iterate `mapping.aryMethodMap` keys. */ + /** Used to iterate `mapping.aryMethod` keys. */ 'caps': [1, 2, 3, 4], /** Used to map keys to other keys. */ - 'keyMap': { + 'key': { 'curryN': 'curry', 'curryRightN': 'curryRight', 'getOr': 'get' }, /** Used to identify methods which mutate arrays or objects. */ - 'mutateMap': { + 'mutate': { 'array': { 'fill': true, 'pull': true, @@ -193,11 +215,11 @@ return /******/ (function(modules) { // webpackBootstrap }, 'object': { 'assign': true, + 'assignIn': true, + 'assignInWith': true, 'assignWith': true, 'defaults': true, 'defaultsDeep': true, - 'extend': true, - 'extendWith': true, 'merge': true, 'mergeWith': true }, @@ -207,10 +229,26 @@ return /******/ (function(modules) { // webpackBootstrap } }, + /** Used to track methods with placeholder support */ + 'placeholder': { + 'bind': true, + 'bindKey': true, + 'curry': true, + 'curryRight': true, + 'partial': true, + 'partialRight': true + }, + /** Used to track methods that skip `_.rearg`. */ - 'skipReargMap': { + 'skipRearg': { + 'assign': true, + 'assignIn': true, + 'concat': true, + 'defaults': true, + 'defaultsDeep': true, 'difference': true, 'matchesProperty': true, + 'merge': true, 'random': true, 'range': true, 'rangeRight': true, diff --git a/doc/README.md b/doc/README.md index 7ffbc6aee7..5bd967f62b 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,4 +1,4 @@ -# lodash v4.0.0 +# lodash v4.0.1 @@ -37,6 +37,7 @@ * `_.pullAllBy` * `_.pullAt` * `_.remove` +* `_.reverse` * `_.slice` * `_.sortedIndex` * `_.sortedIndexBy` @@ -66,7 +67,6 @@ * `_.zip` * `_.zipObject` * `_.zipWith` -* `_.prototype.reverse` @@ -272,15 +272,14 @@ * `_.chain` * `_.tap` * `_.thru` -* `_.wrapperFlatMap` * `_.prototype[Symbol.iterator]` * `_.prototype.at` * `_.prototype.chain` * `_.prototype.commit` +* `_.prototype.flatMap` * `_.prototype.next` * `_.prototype.plant` * `_.prototype.reverse` -* `_.prototype.run` -> `value` * `_.prototype.toJSON` -> `value` * `_.prototype.value` * `_.prototype.valueOf` -> `value` @@ -359,14 +358,6 @@ -## `Methods` -* `_.templateSettings.imports._` -* `stringSize` - - - - - ## `Properties` * `_.VERSION` * `_.templateSettings` @@ -378,6 +369,13 @@ + + +## `Methods` +* `_.templateSettings.imports._` + + + @@ -389,7 +387,7 @@ ### `_.chunk(array, [size=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5250 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.chunk "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5270 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.chunk "See the npm package") Creates an array of elements split into groups the length of `size`. If `array` can't be split evenly, the final chunk will be the remaining @@ -417,7 +415,7 @@ _.chunk(['a', 'b', 'c', 'd'], 3); ### `_.compact(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5281 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.compact "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5301 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.compact "See the npm package") Creates an array with all falsey values removed. The values `false`, `null`, `0`, `""`, `undefined`, and `NaN` are falsey. @@ -440,7 +438,7 @@ _.compact([0, 1, false, 2, '', 3]); ### `_.concat(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5317 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.concat "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5337 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.concat "See the npm package") Creates a new array concatenating `array` with any additional arrays and/or values. @@ -470,7 +468,7 @@ console.log(array); ### `_.difference(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5338 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.difference "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5361 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.difference "See the npm package") Creates an array of unique `array` values not included in the other provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -495,7 +493,7 @@ _.difference([3, 2, 1], [4, 2]); ### `_.differenceBy(array, [values], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5365 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differenceby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5388 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differenceby "See the npm package") This method is like `_.difference` except that it accepts `iteratee` which is invoked for each element of `array` and `values` to generate the criterion @@ -525,7 +523,7 @@ _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); ### `_.differenceWith(array, [values], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5394 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differencewith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5417 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differencewith "See the npm package") This method is like `_.difference` except that it accepts `comparator` which is invoked to compare elements of `array` to `values`. The comparator @@ -553,7 +551,7 @@ _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); ### `_.drop(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5428 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.drop "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5451 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.drop "See the npm package") Creates a slice of `array` with `n` elements dropped from the beginning. @@ -585,7 +583,7 @@ _.drop([1, 2, 3], 0); ### `_.dropRight(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5461 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5484 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropright "See the npm package") Creates a slice of `array` with `n` elements dropped from the end. @@ -617,7 +615,7 @@ _.dropRight([1, 2, 3], 0); ### `_.dropRightWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5505 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5528 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package") Creates a slice of `array` excluding elements dropped from the end. Elements are dropped until `predicate` returns falsey. The predicate is @@ -660,7 +658,7 @@ _.dropRightWhile(users, 'active'); ### `_.dropWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5545 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropwhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5568 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropwhile "See the npm package") Creates a slice of `array` excluding elements dropped from the beginning. Elements are dropped until `predicate` returns falsey. The predicate is @@ -703,7 +701,7 @@ _.dropWhile(users, 'active'); ### `_.fill(array, value, [start=0], [end=array.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5579 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.fill "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5602 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.fill "See the npm package") Fills elements of `array` with `value` from `start` up to, but not including, `end`. @@ -741,7 +739,7 @@ _.fill([4, 6, 8, 10], '*', 1, 3); ### `_.findIndex(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5624 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5647 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findindex "See the npm package") This method is like `_.find` except that it returns the index of the first element `predicate` returns truthy for instead of the element itself. @@ -783,7 +781,7 @@ _.findIndex(users, 'active'); ### `_.findLastIndex(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5663 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5686 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastindex "See the npm package") This method is like `_.findIndex` except that it iterates over elements of `collection` from right to left. @@ -825,7 +823,7 @@ _.findLastIndex(users, 'active'); ### `_.flatMap(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5689 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmap "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5712 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmap "See the npm package") Creates an array of flattened values by running each element in `array` through `iteratee` and concating its result to the other mapped values. @@ -854,7 +852,7 @@ _.flatMap([1, 2], duplicate); ### `_.flatten(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5707 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatten "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5730 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatten "See the npm package") Flattens `array` a single level. @@ -876,7 +874,7 @@ _.flatten([1, [2, 3, [4]]]); ### `_.flattenDeep(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5725 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5748 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendeep "See the npm package") This method is like `_.flatten` except that it recursively flattens `array`. @@ -898,7 +896,7 @@ _.flattenDeep([1, [2, 3, [4]]]); ### `_.fromPairs(pairs)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5744 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.frompairs "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5767 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.frompairs "See the npm package") The inverse of `_.toPairs`; this method returns an object composed from key-value `pairs`. @@ -921,7 +919,7 @@ _.fromPairs([['fred', 30], ['barney', 40]]); ### `_.head(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5773 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.head "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5796 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.head "See the npm package") Gets the first element of `array`. @@ -949,7 +947,7 @@ _.head([]); ### `_.indexOf(array, value, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5800 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.indexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5823 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.indexof "See the npm package") Gets the index at which the first occurrence of `value` is found in `array` using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -981,7 +979,7 @@ _.indexOf([1, 2, 1, 2], 2, 2); ### `_.initial(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5825 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.initial "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5848 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.initial "See the npm package") Gets all but the last element of `array`. @@ -1003,7 +1001,7 @@ _.initial([1, 2, 3]); ### `_.intersection([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5843 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersection "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5867 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersection "See the npm package") Creates an array of unique values that are included in all of the provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1027,7 +1025,7 @@ _.intersection([2, 1], [4, 2], [1, 2]); ### `_.intersectionBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5870 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5894 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionby "See the npm package") This method is like `_.intersection` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion @@ -1056,7 +1054,7 @@ _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); ### `_.intersectionWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5903 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5927 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package") This method is like `_.intersection` except that it accepts `comparator` which is invoked to compare elements of `arrays`. The comparator is invoked @@ -1084,7 +1082,7 @@ _.intersectionWith(objects, others, _.isEqual); ### `_.join(array, [separator=','])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5931 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.join "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5955 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.join "See the npm package") Converts all elements in `array` into a string separated by `separator`. @@ -1107,7 +1105,7 @@ _.join(['a', 'b', 'c'], '~'); ### `_.last(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5948 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.last "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5972 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.last "See the npm package") Gets the last element of `array`. @@ -1129,7 +1127,7 @@ _.last([1, 2, 3]); ### `_.lastIndexOf(array, value, [fromIndex=array.length-1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L5973 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lastindexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L5997 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lastindexof "See the npm package") This method is like `_.indexOf` except that it iterates over elements of `array` from right to left. @@ -1158,7 +1156,7 @@ _.lastIndexOf([1, 2, 1, 2], 2, 2); ### `_.pull(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6015 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pull "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6039 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pull "See the npm package") Removes all provided values from `array` using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1189,7 +1187,7 @@ console.log(array); ### `_.pullAll(array, values)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6036 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullall "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6060 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullall "See the npm package") This method is like `_.pull` except that it accepts an array of values to remove.
@@ -1207,7 +1205,7 @@ This method is like `_.pull` except that it accepts an array of values to remove ```js var array = [1, 2, 3, 1, 2, 3]; -_.pull(array, [2, 3]); +_.pullAll(array, [2, 3]); console.log(array); // => [1, 1] ``` @@ -1218,7 +1216,7 @@ console.log(array); ### `_.pullAllBy(array, values, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6064 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullallby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6088 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullallby "See the npm package") This method is like `_.pullAll` except that it accepts `iteratee` which is invoked for each element of `array` and `values` to to generate the criterion @@ -1250,7 +1248,7 @@ console.log(array); ### `_.pullAt(array, [indexes])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6094 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullat "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6118 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullat "See the npm package") Removes elements from `array` corresponding to `indexes` and returns an array of removed elements. @@ -1283,7 +1281,7 @@ console.log(evens); ### `_.remove(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6128 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.remove "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6152 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.remove "See the npm package") Removes all elements from `array` that `predicate` returns truthy for and returns an array of the removed elements. The predicate is invoked with @@ -1318,8 +1316,37 @@ console.log(evens); +### `_.reverse()` +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6194 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reverse "See the npm package") + +Reverses `array` so that the first element becomes the last, the second +element becomes the second to last, and so on. +
+
+**Note:** This method mutates `array` and is based on +[`Array#reverse`](https://mdn.io/Array/reverse). + +#### Returns +*(Array)*: Returns `array`. + +#### Example +```js +var array = [1, 2, 3]; + +_.reverse(array); +// => [3, 2, 1] + +console.log(array); +// => [3, 2, 1] +``` +* * * + + + + + ### `_.slice(array, [start=0], [end=array.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6187 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.slice "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6212 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.slice "See the npm package") Creates a slice of `array` from `start` up to, but not including, `end`.
@@ -1342,7 +1369,7 @@ to ensure dense arrays are returned. ### `_.sortedIndex(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6221 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6246 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindex "See the npm package") Uses a binary search to determine the lowest index at which `value` should be inserted into `array` in order to maintain its sort order. @@ -1369,7 +1396,7 @@ _.sortedIndex([4, 5], 4); ### `_.sortedIndexBy(array, value, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6248 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6273 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package") This method is like `_.sortedIndex` except that it accepts `iteratee` which is invoked for `value` and each element of `array` to compute their @@ -1401,7 +1428,7 @@ _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); ### `_.sortedIndexOf(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6267 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6292 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package") This method is like `_.indexOf` except that it performs a binary search on a sorted `array`. @@ -1425,7 +1452,7 @@ _.sortedIndexOf([1, 1, 2, 2], 2); ### `_.sortedLastIndex(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6294 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6319 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package") This method is like `_.sortedIndex` except that it returns the highest index at which `value` should be inserted into `array` in order to @@ -1450,7 +1477,7 @@ _.sortedLastIndex([4, 5], 4); ### `_.sortedLastIndexBy(array, value, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6316 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6341 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package") This method is like `_.sortedLastIndex` except that it accepts `iteratee` which is invoked for `value` and each element of `array` to compute their @@ -1477,7 +1504,7 @@ _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); ### `_.sortedLastIndexOf(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6335 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6360 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package") This method is like `_.lastIndexOf` except that it performs a binary search on a sorted `array`. @@ -1501,7 +1528,7 @@ _.sortedLastIndexOf([1, 1, 2, 2], 2); ### `_.sortedUniq(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6360 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6385 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package") This method is like `_.uniq` except that it's designed and optimized for sorted arrays. @@ -1524,7 +1551,7 @@ _.sortedUniq([1, 1, 2]); ### `_.sortedUniqBy(array, [iteratee])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6381 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6406 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package") This method is like `_.uniqBy` except that it's designed and optimized for sorted arrays. @@ -1548,7 +1575,7 @@ _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); ### `_.tail(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6400 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tail "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6425 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tail "See the npm package") Gets all but the first element of `array`. @@ -1570,7 +1597,7 @@ _.tail([1, 2, 3]); ### `_.take(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6428 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.take "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6453 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.take "See the npm package") Creates a slice of `array` with `n` elements taken from the beginning. @@ -1602,7 +1629,7 @@ _.take([1, 2, 3], 0); ### `_.takeRight(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6460 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takeright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6485 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takeright "See the npm package") Creates a slice of `array` with `n` elements taken from the end. @@ -1634,7 +1661,7 @@ _.takeRight([1, 2, 3], 0); ### `_.takeRightWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6504 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6529 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package") Creates a slice of `array` with elements taken from the end. Elements are taken until `predicate` returns falsey. The predicate is invoked with three @@ -1677,7 +1704,7 @@ _.takeRightWhile(users, 'active'); ### `_.takeWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6544 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takewhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6569 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takewhile "See the npm package") Creates a slice of `array` with elements taken from the beginning. Elements are taken until `predicate` returns falsey. The predicate is invoked with @@ -1720,7 +1747,7 @@ _.takeWhile(users, 'active'); ### `_.union([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6565 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.union "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6590 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.union "See the npm package") Creates an array of unique values, in order, from all of the provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1744,7 +1771,7 @@ _.union([2, 1], [4, 2], [1, 2]); ### `_.unionBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6589 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6614 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionby "See the npm package") This method is like `_.union` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion by which @@ -1773,7 +1800,7 @@ _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); ### `_.unionWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6616 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6641 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionwith "See the npm package") This method is like `_.union` except that it accepts `comparator` which is invoked to compare elements of `arrays`. The comparator is invoked @@ -1801,7 +1828,7 @@ _.unionWith(objects, others, _.isEqual); ### `_.uniq(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6640 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniq "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6665 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniq "See the npm package") Creates a duplicate-free version of an array, using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1826,7 +1853,7 @@ _.uniq([2, 1, 2]); ### `_.uniqBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6666 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6691 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqby "See the npm package") This method is like `_.uniq` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which @@ -1855,7 +1882,7 @@ _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); ### `_.uniqWith(array, [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6690 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6715 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqwith "See the npm package") This method is like `_.uniq` except that it accepts `comparator` which is invoked to compare elements of `array`. The comparator is invoked with @@ -1882,7 +1909,7 @@ _.uniqWith(objects, _.isEqual); ### `_.unzip(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6714 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzip "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6739 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzip "See the npm package") This method is like `_.zip` except that it accepts an array of grouped elements and creates an array regrouping the elements to their pre-zip @@ -1909,7 +1936,7 @@ _.unzip(zipped); ### `_.unzipWith(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6749 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzipwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6774 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzipwith "See the npm package") This method is like `_.unzip` except that it accepts `iteratee` to specify how regrouped values should be combined. The iteratee is invoked with the @@ -1937,7 +1964,7 @@ _.unzipWith(zipped, _.add); ### `_.without(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6778 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.without "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6803 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.without "See the npm package") Creates an array excluding all provided values using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -1962,7 +1989,7 @@ _.without([1, 2, 1, 3], 1, 2); ### `_.xor([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6798 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xor "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6823 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xor "See the npm package") Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) of the provided arrays. @@ -1985,7 +2012,7 @@ _.xor([2, 1], [4, 2]); ### `_.xorBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6822 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6847 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorby "See the npm package") This method is like `_.xor` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion by which @@ -2014,7 +2041,7 @@ _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); ### `_.xorWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6849 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6874 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorwith "See the npm package") This method is like `_.xor` except that it accepts `comparator` which is invoked to compare elements of `arrays`. The comparator is invoked with @@ -2042,7 +2069,7 @@ _.xorWith(objects, others, _.isEqual); ### `_.zip([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6872 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zip "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6897 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zip "See the npm package") Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements @@ -2066,7 +2093,7 @@ _.zip(['fred', 'barney'], [30, 40], [true, false]); ### `_.zipObject([props=[]], [values=[]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6889 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6914 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobject "See the npm package") This method is like `_.fromPairs` except that it accepts two arrays, one of property names and one of corresponding values. @@ -2090,7 +2117,7 @@ _.zipObject(['fred', 'barney'], [30, 40]); ### `_.zipWith([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6919 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6944 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipwith "See the npm package") This method is like `_.zip` except that it accepts `iteratee` to specify how grouped values should be combined. The iteratee is invoked with the @@ -2114,35 +2141,6 @@ _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { - - -### `_.prototype.reverse()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6169 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reverse "See the npm package") - -Reverses `array` so that the first element becomes the last, the second -element becomes the second to last, and so on. -
-
-**Note:** This method mutates `array` and is based on -[`Array#reverse`](https://mdn.io/Array/reverse). - -#### Returns -*(Array)*: Returns `array`. - -#### Example -```js -var array = [1, 2, 3]; - -_.reverse(array); -// => [3, 2, 1] - -console.log(array); -// => [3, 2, 1] -``` -* * * - - - @@ -2152,7 +2150,7 @@ console.log(array); ### `_.countBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7299 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.countby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7324 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.countby "See the npm package") Creates an object composed of keys generated from the results of running each element of `collection` through `iteratee`. The corresponding value @@ -2161,7 +2159,7 @@ The iteratee is invoked with one argument: (value). #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element. +2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee to transform keys. #### Returns *(Object)*: Returns the composed aggregate object. @@ -2181,7 +2179,7 @@ _.countBy(['one', 'two', 'three'], 'length'); ### `_.every(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7337 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.every "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7362 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.every "See the npm package") Checks if `predicate` returns truthy for **all** elements of `collection`. Iteration is stopped once `predicate` returns falsey. The predicate is @@ -2223,7 +2221,7 @@ _.every(users, 'active'); ### `_.filter(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7378 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.filter "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7403 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.filter "See the npm package") Iterates over elements of `collection`, returning an array of all elements `predicate` returns truthy for. The predicate is invoked with three arguments:
@@ -2265,7 +2263,7 @@ _.filter(users, 'active'); ### `_.find(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7417 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.find "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7442 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.find "See the npm package") Iterates over elements of `collection`, returning the first element `predicate` returns truthy for. The predicate is invoked with three arguments:
@@ -2308,7 +2306,7 @@ _.find(users, 'active'); ### `_.findLast(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7443 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlast "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7468 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlast "See the npm package") This method is like `_.find` except that it iterates over elements of `collection` from right to left. @@ -2334,7 +2332,7 @@ _.findLast([1, 2, 3, 4], function(n) { ### `_.forEach(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7480 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreach "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7505 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreach "See the npm package") Iterates over elements of `collection` invoking `iteratee` for each element. The iteratee is invoked with three arguments: (value, index|key, collection). @@ -2374,7 +2372,7 @@ _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { ### `_.forEachRight(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7504 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreachright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7529 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreachright "See the npm package") This method is like `_.forEach` except that it iterates over elements of `collection` from right to left. @@ -2403,16 +2401,16 @@ _.forEachRight([1, 2], function(value) { ### `_.groupBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7531 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.groupby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7556 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.groupby "See the npm package") Creates an object composed of keys generated from the results of running each element of `collection` through `iteratee`. The corresponding value -of each key is an array of the elements responsible for generating the key. +of each key is an array of elements responsible for generating the key. The iteratee is invoked with one argument: (value). #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element. +2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee to transform keys. #### Returns *(Object)*: Returns the composed aggregate object. @@ -2433,7 +2431,7 @@ _.groupBy(['one', 'two', 'three'], 'length'); ### `_.includes(collection, value, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7567 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.includes "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7592 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.includes "See the npm package") Checks if `value` is in `collection`. If `collection` is a string it's checked for a substring of `value`, otherwise [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -2469,7 +2467,7 @@ _.includes('pebbles', 'eb'); ### `_.invokeMap(collection, path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7602 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invokemap "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7627 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invokemap "See the npm package") Invokes the method at `path` of each element in `collection`, returning an array of the results of each invoked method. Any additional arguments @@ -2499,7 +2497,7 @@ _.invokeMap([123, 456], String.prototype.split, ''); ### `_.keyBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7642 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keyby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7667 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keyby "See the npm package") Creates an object composed of keys generated from the results of running each element of `collection` through `iteratee`. The corresponding value @@ -2508,7 +2506,7 @@ iteratee is invoked with one argument: (value). #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. -2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element. +2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee to transform keys. #### Returns *(Object)*: Returns the composed aggregate object. @@ -2520,13 +2518,13 @@ var keyData = [ { 'dir': 'right', 'code': 100 } ]; -_.keyBy(keyData, 'dir'); -// => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - _.keyBy(keyData, function(o) { return String.fromCharCode(o.code); }); // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + +_.keyBy(keyData, 'dir'); +// => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } ``` * * * @@ -2535,7 +2533,7 @@ _.keyBy(keyData, function(o) { ### `_.map(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7687 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.map "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7712 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.map "See the npm package") Creates an array of values by running each element in `collection` through `iteratee`. The iteratee is invoked with three arguments:
@@ -2565,11 +2563,11 @@ function square(n) { return n * n; } -_.map([1, 2], square); -// => [3, 6] +_.map([4, 8], square); +// => [16, 64] -_.map({ 'a': 1, 'b': 2 }, square); -// => [3, 6] (iteration order is not guaranteed) +_.map({ 'a': 4, 'b': 8 }, square); +// => [16, 64] (iteration order is not guaranteed) var users = [ { 'user': 'barney' }, @@ -2587,7 +2585,7 @@ _.map(users, 'user'); ### `_.orderBy(collection, [iteratees=[_.identity]], [orders])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7719 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.orderby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7744 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.orderby "See the npm package") This method is like `_.sortBy` except that it allows specifying the sort orders of the iteratees to sort by. If `orders` is unspecified, all values @@ -2622,12 +2620,12 @@ _.orderBy(users, ['user', 'age'], ['asc', 'desc']); ### `_.partition(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7768 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partition "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7793 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partition "See the npm package") Creates an array of elements split into two groups, the first of which -contains elements `predicate` returns truthy for, while the second of which -contains elements `predicate` returns falsey for. The predicate is invoked -with one argument: (value). +contains elements `predicate` returns truthy for, the second of which +contains elements `predicate` returns falsey for. The predicate is +invoked with one argument: (value). #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. @@ -2666,7 +2664,7 @@ _.partition(users, 'active'); ### `_.reduce(collection, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7807 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduce "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7832 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduce "See the npm package") Reduces `collection` to a value which is the accumulated result of running each element in `collection` through `iteratee`, where each successive @@ -2712,7 +2710,7 @@ _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { ### `_.reduceRight(collection, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7834 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduceright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7859 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduceright "See the npm package") This method is like `_.reduce` except that it iterates over elements of `collection` from right to left. @@ -2741,7 +2739,7 @@ _.reduceRight(array, function(flattened, other) { ### `_.reject(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7873 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7898 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reject "See the npm package") The opposite of `_.filter`; this method returns the elements of `collection` that `predicate` does **not** return truthy for. @@ -2782,7 +2780,7 @@ _.reject(users, 'active'); ### `_.sample(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7894 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sample "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7919 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sample "See the npm package") Gets a random element from `collection`. @@ -2804,9 +2802,10 @@ _.sample([1, 2, 3, 4]); ### `_.sampleSize(collection, [n=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7915 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.samplesize "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7944 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.samplesize "See the npm package") -Gets `n` random elements from `collection`. +Gets `n` random elements at unique keys from `collection` up to the +size of `collection`. #### Arguments 1. `collection` *(Array|Object)*: The collection to sample. @@ -2817,8 +2816,11 @@ Gets `n` random elements from `collection`. #### Example ```js -_.sampleSize([1, 2, 3, 4], 2); +_.sampleSize([1, 2, 3], 2); // => [3, 1] + +_.sampleSize([1, 2, 3], 4); +// => [2, 3, 1] ``` * * * @@ -2827,7 +2829,7 @@ _.sampleSize([1, 2, 3, 4], 2); ### `_.shuffle(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7947 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.shuffle "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7976 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.shuffle "See the npm package") Creates an array of shuffled values, using a version of the [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). @@ -2850,7 +2852,7 @@ _.shuffle([1, 2, 3, 4]); ### `_.size(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7971 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.size "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8000 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.size "See the npm package") Gets the size of `collection` by returning its length for array-like values or the number of own enumerable properties for objects. @@ -2879,7 +2881,7 @@ _.size('pebbles'); ### `_.some(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8016 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.some "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8045 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.some "See the npm package") Checks if `predicate` returns truthy for **any** element of `collection`. Iteration is stopped once `predicate` returns truthy. The predicate is @@ -2921,7 +2923,7 @@ _.some(users, 'active'); ### `_.sortBy(collection, [iteratees=[_.identity]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8057 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8086 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortby "See the npm package") Creates an array of elements, sorted in ascending order by the results of running each element in a collection through each iteratee. This method @@ -2968,7 +2970,7 @@ _.sortBy(users, 'user', function(o) { ### `_.now()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8088 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.now "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8117 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.now "See the npm package") Gets the timestamp of the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). @@ -2996,7 +2998,7 @@ _.defer(function(stamp) { ### `_.after(n, func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8115 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.after "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8144 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.after "See the npm package") The opposite of `_.before`; this method creates a function that invokes `func` once it's called `n` or more times. @@ -3028,7 +3030,7 @@ _.forEach(saves, function(type) { ### `_.ary(func, [n=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8143 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ary "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8172 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ary "See the npm package") Creates a function that accepts up to `n` arguments, ignoring any additional arguments. @@ -3052,7 +3054,7 @@ _.map(['6', '8', '10'], _.ary(parseInt, 1)); ### `_.before(n, func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8165 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.before "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8194 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.before "See the npm package") Creates a function that invokes `func`, with the `this` binding and arguments of the created function, while it's called less than `n` times. Subsequent @@ -3077,7 +3079,7 @@ jQuery(element).on('click', _.before(5, addContactToList)); ### `_.bind(func, thisArg, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8217 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bind "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8246 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bind "See the npm package") Creates a function that invokes `func` with the `this` binding of `thisArg` and prepends any additional `_.bind` arguments to those provided to the @@ -3123,7 +3125,7 @@ bound('hi'); ### `_.bindKey(object, key, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8270 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindkey "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8299 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindkey "See the npm package") Creates a function that invokes the method at `object[key]` and prepends any additional `_.bindKey` arguments to those provided to the bound function. @@ -3178,7 +3180,7 @@ bound('hi'); ### `_.curry(func, [arity=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8319 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curry "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8348 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curry "See the npm package") Creates a function that accepts arguments of `func` and either invokes `func` returning its result, if at least `arity` number of arguments have @@ -3228,7 +3230,7 @@ curried(1)(_, 3)(2); ### `_.curryRight(func, [arity=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8363 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curryright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8392 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curryright "See the npm package") This method is like `_.curry` except that arguments are applied to `func` in the manner of `_.partialRight` instead of `_.partial`. @@ -3275,7 +3277,7 @@ curried(3)(1, _)(2); ### `_.debounce(func, [wait=0], [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8419 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.debounce "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8448 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.debounce "See the npm package") Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was @@ -3332,7 +3334,7 @@ jQuery(window).on('popstate', debounced.cancel); ### `_.defer(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8551 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defer "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8580 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defer "See the npm package") Defers invoking the `func` until the current call stack has cleared. Any additional arguments are provided to `func` when it's invoked. @@ -3358,7 +3360,7 @@ _.defer(function(text) { ### `_.delay(func, wait, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8573 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.delay "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8602 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.delay "See the npm package") Invokes `func` after `wait` milliseconds. Any additional arguments are provided to `func` when it's invoked. @@ -3385,7 +3387,7 @@ _.delay(function(text) { ### `_.flip(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8594 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flip "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8623 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flip "See the npm package") Creates a function that invokes `func` with arguments reversed. @@ -3411,7 +3413,7 @@ flipped('a', 'b', 'c', 'd'); ### `_.memoize(func, [resolver])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8640 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.memoize "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8669 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.memoize "See the npm package") Creates a function that memoizes the result of `func`. If `resolver` is provided it determines the cache key for storing the result based on the @@ -3463,7 +3465,7 @@ _.memoize.Cache = WeakMap; ### `_.negate(predicate)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8679 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.negate "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8708 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.negate "See the npm package") Creates a function that negates the result of the predicate `func`. The `func` predicate is invoked with the `this` binding and arguments of the @@ -3491,7 +3493,7 @@ _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); ### `_.once(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8705 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.once "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8734 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.once "See the npm package") Creates a function that is restricted to invoking `func` once. Repeat calls to the function return the value of the first invocation. The `func` is @@ -3517,7 +3519,7 @@ initialize(); ### `_.overArgs(func, [transforms])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8740 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overargs "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8769 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overargs "See the npm package") Creates a function that invokes `func` with arguments transformed by corresponding `transforms`. @@ -3556,7 +3558,7 @@ func(10, 5); ### `_.partial(func, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8787 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partial "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8816 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partial "See the npm package") Creates a function that invokes `func` with `partial` arguments prepended to those provided to the new function. This method is like `_.bind` except @@ -3599,7 +3601,7 @@ greetFred('hi'); ### `_.partialRight(func, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8823 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partialright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8852 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partialright "See the npm package") This method is like `_.partial` except that partially applied arguments are appended to those provided to the new function. @@ -3641,7 +3643,7 @@ sayHelloTo('fred'); ### `_.rearg(func, indexes)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8850 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rearg "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8879 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rearg "See the npm package") Creates a function that invokes `func` with arguments arranged according to the specified indexes where the argument value at the first index is @@ -3671,7 +3673,7 @@ rearged('b', 'c', 'a') ### `_.rest(func, [start=func.length-1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8876 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rest "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8905 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rest "See the npm package") Creates a function that invokes `func` with the `this` binding of the created function and arguments from `start` and beyond provided as an array. @@ -3703,7 +3705,7 @@ say('hello', 'fred', 'barney', 'pebbles'); ### `_.spread(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8936 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.spread "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L8965 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.spread "See the npm package") Creates a function that invokes `func` with the `this` binding of the created function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3). @@ -3744,7 +3746,7 @@ numbers.then(_.spread(function(x, y) { ### `_.throttle(func, [wait=0], [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L8985 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.throttle "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9014 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.throttle "See the npm package") Creates a throttled function that only invokes `func` at most once per every `wait` milliseconds. The throttled function comes with a `cancel` @@ -3793,7 +3795,7 @@ jQuery(window).on('popstate', throttled.cancel); ### `_.unary(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9013 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unary "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9042 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unary "See the npm package") Creates a function that accepts up to one argument, ignoring any additional arguments. @@ -3816,7 +3818,7 @@ _.map(['6', '8', '10'], _.unary(parseInt)); ### `_.wrap(value, wrapper)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9038 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.wrap "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9067 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.wrap "See the npm package") Creates a function that provides `value` to the wrapper function as its first argument. Any additional arguments provided to the function are @@ -3852,7 +3854,7 @@ p('fred, barney, & pebbles'); ### `_.clone(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9069 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clone "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9098 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clone "See the npm package") Creates a shallow clone of `value`.
@@ -3886,7 +3888,7 @@ console.log(shallow[0] === objects[0]); ### `_.cloneDeep(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9122 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9151 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeep "See the npm package") This method is like `_.clone` except that it recursively clones `value`. @@ -3911,7 +3913,7 @@ console.log(deep[0] === objects[0]); ### `_.cloneDeepWith(value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9152 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9181 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package") This method is like `_.cloneWith` except that it recursively clones `value`. @@ -3930,7 +3932,7 @@ function customizer(value) { } } -var el = _.cloneDeep(document.body, customizer); +var el = _.cloneDeepWith(document.body, customizer); console.log(el === document.body); // => false @@ -3946,12 +3948,12 @@ console.log(el.childNodes.length); ### `_.cloneWith(value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9102 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonewith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9131 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonewith "See the npm package") This method is like `_.clone` except that it accepts `customizer` which is invoked to produce the cloned value. If `customizer` returns `undefined` cloning is handled by the method instead. The `customizer` is invoked with -up to five arguments; (value [, index|key, object, stack]). +up to four arguments; (value [, index|key, object, stack]). #### Arguments 1. `value` *(*)*: The value to clone. @@ -3968,7 +3970,7 @@ function customizer(value) { } } -var el = _.clone(document.body, customizer); +var el = _.cloneWith(document.body, customizer); console.log(el === document.body); // => false @@ -3984,7 +3986,7 @@ console.log(el.childNodes.length); ### `_.eq(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9186 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.eq "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9215 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.eq "See the npm package") Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) comparison between two values to determine if they are equivalent. @@ -4023,7 +4025,7 @@ _.eq(NaN, NaN); ### `_.gt(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9210 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gt "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9239 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gt "See the npm package") Checks if `value` is greater than `other`. @@ -4052,7 +4054,7 @@ _.gt(1, 3); ### `_.gte(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9234 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gte "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9263 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gte "See the npm package") Checks if `value` is greater than or equal to `other`. @@ -4081,7 +4083,7 @@ _.gte(1, 3); ### `_.isArguments(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9254 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarguments "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9283 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarguments "See the npm package") Checks if `value` is likely an `arguments` object. @@ -4106,7 +4108,7 @@ _.isArguments([1, 2, 3]); ### `_.isArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9283 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarray "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9312 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarray "See the npm package") Checks if `value` is classified as an `Array` object. @@ -4137,7 +4139,7 @@ _.isArray(_.noop); ### `_.isArrayLike(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9310 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylike "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9339 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylike "See the npm package") Checks if `value` is array-like. A value is considered array-like if it's not a function and has a `value.length` that's an integer greater than or @@ -4170,7 +4172,7 @@ _.isArrayLike(_.noop); ### `_.isArrayLikeObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9339 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9368 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package") This method is like `_.isArrayLike` except that it also checks if `value` is an object. @@ -4202,7 +4204,7 @@ _.isArrayLikeObject(_.noop); ### `_.isBoolean(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9359 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isboolean "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9388 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isboolean "See the npm package") Checks if `value` is classified as a boolean primitive or object. @@ -4227,7 +4229,7 @@ _.isBoolean(null); ### `_.isDate(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9380 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isdate "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9409 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isdate "See the npm package") Checks if `value` is classified as a `Date` object. @@ -4252,7 +4254,7 @@ _.isDate('Mon April 23 2012'); ### `_.isElement(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9400 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iselement "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9429 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iselement "See the npm package") Checks if `value` is likely a DOM element. @@ -4277,7 +4279,7 @@ _.isElement(''); ### `_.isEmpty(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9431 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isempty "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9460 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isempty "See the npm package") Checks if `value` is empty. A value is considered empty unless it's an `arguments` object, array, string, or jQuery-like collection with a length @@ -4313,7 +4315,7 @@ _.isEmpty({ 'a': 1 }); ### `_.isEqual(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9464 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequal "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9493 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequal "See the npm package") Performs a deep comparison between two values to determine if they are equivalent. @@ -4350,11 +4352,11 @@ object === other; ### `_.isEqualWith(value, other, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9499 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequalwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9528 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequalwith "See the npm package") This method is like `_.isEqual` except that it accepts `customizer` which is invoked to compare values. If `customizer` returns `undefined` comparisons are -handled by the method instead. The `customizer` is invoked with up to seven arguments:
+handled by the method instead. The `customizer` is invoked with up to six arguments:
(objValue, othValue [, index|key, object, other, stack]). #### Arguments @@ -4390,7 +4392,7 @@ _.isEqualWith(array, other, customizer); ### `_.isError(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9522 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iserror "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9551 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iserror "See the npm package") Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, or `URIError` object. @@ -4416,7 +4418,7 @@ _.isError(Error); ### `_.isFinite(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9551 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfinite "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9580 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfinite "See the npm package") Checks if `value` is a finite primitive number.
@@ -4450,7 +4452,7 @@ _.isFinite(Infinity); ### `_.isFunction(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9571 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfunction "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9600 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfunction "See the npm package") Checks if `value` is classified as a `Function` object. @@ -4475,7 +4477,7 @@ _.isFunction(/abc/); ### `_.isInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9603 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isinteger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9632 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isinteger "See the npm package") Checks if `value` is an integer.
@@ -4509,7 +4511,7 @@ _.isInteger('3'); ### `_.isLength(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9631 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.islength "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9660 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.islength "See the npm package") Checks if `value` is a valid array-like length.
@@ -4543,7 +4545,7 @@ _.isLength('3'); ### `_.isMatch(object, source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9714 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatch "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9743 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatch "See the npm package") Performs a deep comparison between `object` and `source` to determine if `object` contains equivalent property values. @@ -4575,11 +4577,11 @@ _.isMatch(object, { 'age': 36 }); ### `_.isMatchWith(object, source, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9749 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9778 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package") This method is like `_.isMatch` except that it accepts `customizer` which is invoked to compare values. If `customizer` returns `undefined` comparisons -are handled by the method instead. The `customizer` is invoked with three +are handled by the method instead. The `customizer` is invoked with five arguments: (objValue, srcValue, index|key, object, source). #### Arguments @@ -4615,7 +4617,7 @@ _.isMatchWith(object, source, customizer); ### `_.isNaN(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9779 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnan "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9808 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnan "See the npm package") Checks if `value` is `NaN`.
@@ -4650,7 +4652,7 @@ _.isNaN(undefined); ### `_.isNative(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9801 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnative "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9830 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnative "See the npm package") Checks if `value` is a native function. @@ -4675,7 +4677,7 @@ _.isNative(_); ### `_.isNil(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9851 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnil "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9880 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnil "See the npm package") Checks if `value` is `null` or `undefined`. @@ -4703,7 +4705,7 @@ _.isNil(NaN); ### `_.isNull(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9828 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnull "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9857 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnull "See the npm package") Checks if `value` is `null`. @@ -4728,7 +4730,7 @@ _.isNull(void 0); ### `_.isNumber(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9880 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnumber "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9909 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnumber "See the npm package") Checks if `value` is classified as a `Number` primitive or object.
@@ -4763,7 +4765,7 @@ _.isNumber('3'); ### `_.isObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9658 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9687 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobject "See the npm package") Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) @@ -4795,7 +4797,7 @@ _.isObject(null); ### `_.isObjectLike(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9688 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9717 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package") Checks if `value` is object-like. A value is object-like if it's not `null` and has a `typeof` result of "object". @@ -4827,7 +4829,7 @@ _.isObjectLike(null); ### `_.isPlainObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9912 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isplainobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9941 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isplainobject "See the npm package") Checks if `value` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`. @@ -4863,7 +4865,7 @@ _.isPlainObject(Object.create(null)); ### `_.isRegExp(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9944 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isregexp "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L9973 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isregexp "See the npm package") Checks if `value` is classified as a `RegExp` object. @@ -4888,7 +4890,7 @@ _.isRegExp('/abc/'); ### `_.isSafeInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9973 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10002 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package") Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 double precision number which isn't the result of a rounded unsafe integer. @@ -4923,7 +4925,7 @@ _.isSafeInteger('3'); ### `_.isString(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L9993 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isstring "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10022 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isstring "See the npm package") Checks if `value` is classified as a `String` primitive or object. @@ -4948,7 +4950,7 @@ _.isString(1); ### `_.isSymbol(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10014 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issymbol "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10043 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issymbol "See the npm package") Checks if `value` is classified as a `Symbol` primitive or object. @@ -4973,7 +4975,7 @@ _.isSymbol('abc'); ### `_.isTypedArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10035 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.istypedarray "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10064 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.istypedarray "See the npm package") Checks if `value` is classified as a typed array. @@ -4998,7 +5000,7 @@ _.isTypedArray([]); ### `_.isUndefined(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10055 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isundefined "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10084 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isundefined "See the npm package") Checks if `value` is `undefined`. @@ -5023,7 +5025,7 @@ _.isUndefined(null); ### `_.lt(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10079 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lt "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10108 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lt "See the npm package") Checks if `value` is less than `other`. @@ -5052,7 +5054,7 @@ _.lt(3, 1); ### `_.lte(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10103 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lte "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10132 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lte "See the npm package") Checks if `value` is less than or equal to `other`. @@ -5081,7 +5083,7 @@ _.lte(3, 1); ### `_.toArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10129 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toarray "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10158 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toarray "See the npm package") Converts `value` to an array. @@ -5112,7 +5114,7 @@ _.toArray(null); ### `_.toInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10169 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tointeger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10198 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tointeger "See the npm package") Converts `value` to an integer.
@@ -5146,7 +5148,7 @@ _.toInteger('3'); ### `_.toLength(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10207 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolength "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10236 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolength "See the npm package") Converts `value` to an integer suitable for use as the length of an array-like object. @@ -5157,6 +5159,9 @@ array-like object. #### Arguments 1. `value` *(*)*: The value to convert. +#### Returns +*(number)*: Returns the converted integer. + #### Example ```js _.toLength(3); @@ -5178,7 +5183,7 @@ _.toLength('3'); ### `_.toNumber(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10233 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tonumber "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10262 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tonumber "See the npm package") Converts `value` to a number. @@ -5209,7 +5214,7 @@ _.toNumber('3'); ### `_.toPlainObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10271 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toplainobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10300 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toplainobject "See the npm package") Converts `value` to a plain object flattening inherited enumerable properties of `value` to own properties of the plain object. @@ -5241,7 +5246,7 @@ _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); ### `_.toSafeInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10298 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10327 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package") Converts `value` to a safe integer. A safe integer can be compared and represented correctly. @@ -5273,7 +5278,7 @@ _.toSafeInteger('3'); ### `_.toString(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10322 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tostring "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10351 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tostring "See the npm package") Converts `value` to a string if it's not one. An empty string is returned for `null` and `undefined` values. The sign of `-0` is preserved. @@ -5308,7 +5313,7 @@ _.toString([1, 2, 3]); ### `_.add(augend, addend)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13547 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.add "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13577 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.add "See the npm package") Adds two numbers. @@ -5331,7 +5336,7 @@ _.add(6, 4); ### `_.ceil(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13578 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ceil "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13608 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ceil "See the npm package") Computes `number` rounded up to `precision`. @@ -5360,7 +5365,7 @@ _.ceil(6040, -2); ### `_.floor(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13600 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.floor "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13630 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.floor "See the npm package") Computes `number` rounded down to `precision`. @@ -5389,7 +5394,7 @@ _.floor(4060, -2); ### `_.max(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13619 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.max "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13649 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.max "See the npm package") Computes the maximum value of `array`. If `array` is empty or falsey `undefined` is returned. @@ -5415,7 +5420,7 @@ _.max([]); ### `_.maxBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13647 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.maxby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13677 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.maxby "See the npm package") This method is like `_.max` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which @@ -5432,7 +5437,7 @@ the value is ranked. The iteratee is invoked with one argument: (value). ```js var objects = [{ 'n': 1 }, { 'n': 2 }]; -_.maxBy(objects, function(o) { return o.a; }); +_.maxBy(objects, function(o) { return o.n; }); // => { 'n': 2 } // using the `_.property` iteratee shorthand @@ -5446,7 +5451,7 @@ _.maxBy(objects, 'n'); ### `_.mean(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13666 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mean "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13696 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mean "See the npm package") Computes the mean of the values in `array`. @@ -5468,7 +5473,7 @@ _.mean([4, 2, 8, 6]); ### `_.min(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13687 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.min "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13717 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.min "See the npm package") Computes the minimum value of `array`. If `array` is empty or falsey `undefined` is returned. @@ -5494,7 +5499,7 @@ _.min([]); ### `_.minBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13715 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.minby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13745 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.minby "See the npm package") This method is like `_.min` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which @@ -5511,7 +5516,7 @@ the value is ranked. The iteratee is invoked with one argument: (value). ```js var objects = [{ 'n': 1 }, { 'n': 2 }]; -_.minBy(objects, function(o) { return o.a; }); +_.minBy(objects, function(o) { return o.n; }); // => { 'n': 1 } // using the `_.property` iteratee shorthand @@ -5525,7 +5530,7 @@ _.minBy(objects, 'n'); ### `_.round(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13741 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.round "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13771 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.round "See the npm package") Computes `number` rounded to `precision`. @@ -5554,7 +5559,7 @@ _.round(4060, -2); ### `_.subtract(minuend, subtrahend)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13757 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.subtract "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13787 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.subtract "See the npm package") Subtract two numbers. @@ -5577,7 +5582,7 @@ _.subtract(6, 4); ### `_.sum(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13781 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sum "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13811 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sum "See the npm package") Computes the sum of the values in `array`. @@ -5599,7 +5604,7 @@ _.sum([4, 2, 8, 6]); ### `_.sumBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13809 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sumby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13839 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sumby "See the npm package") This method is like `_.sum` except that it accepts `iteratee` which is invoked for each element in `array` to generate the value to be summed. @@ -5636,7 +5641,7 @@ _.sumBy(objects, 'n'); ### `_.clamp(number, [lower], upper)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11575 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clamp "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11604 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clamp "See the npm package") Clamps `number` within the inclusive `lower` and `upper` bounds. @@ -5663,7 +5668,7 @@ _.clamp(10, -5, 5); ### `_.inRange(number, [start=0], end)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11627 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.inrange "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11656 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.inrange "See the npm package") Checks if `n` is between `start` and up to but not including, `end`. If `end` is not specified it's set to `start` with `start` then set to `0`. @@ -5708,7 +5713,7 @@ _.inRange(-3, -2, -6); ### `_.random([lower=0], [upper=1], [floating])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11669 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.random "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11698 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.random "See the npm package") Produces a random number between the inclusive `lower` and `upper` bounds. If only one argument is provided a number between `0` and the given number @@ -5754,7 +5759,7 @@ _.random(1.2, 5.2); ### `_.assign(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10369 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assign "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10398 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assign "See the npm package") Assigns own enumerable properties of source objects to the destination object. Source objects are applied from left to right. Subsequent sources @@ -5794,7 +5799,7 @@ _.assign({ 'a': 1 }, new Foo, new Bar); ### `_.assignIn(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10402 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10431 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignin "See the npm package") This method is like `_.assign` except that it iterates over own and inherited source properties. @@ -5835,7 +5840,7 @@ _.assignIn({ 'a': 1 }, new Foo, new Bar); ### `_.assignInWith(object, sources, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10433 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assigninwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10462 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assigninwith "See the npm package") This method is like `_.assignIn` except that it accepts `customizer` which is invoked to produce the assigned values. If `customizer` returns `undefined` @@ -5874,7 +5879,7 @@ defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); ### `_.assignWith(object, sources, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10463 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10492 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignwith "See the npm package") This method is like `_.assign` except that it accepts `customizer` which is invoked to produce the assigned values. If `customizer` returns `undefined` @@ -5910,7 +5915,7 @@ defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); ### `_.at(object, [paths])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10487 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.at "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10516 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.at "See the npm package") Creates an array of values corresponding to `paths` of `object`. @@ -5938,7 +5943,7 @@ _.at(['a', 'b', 'c'], 0, 2); ### `_.create(prototype, [properties])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10523 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.create "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10552 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.create "See the npm package") Creates an object that inherits from the `prototype` object. If a `properties` object is provided its own enumerable properties are assigned to the created object. @@ -5979,7 +5984,7 @@ circle instanceof Shape; ### `_.defaults(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10547 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaults "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10576 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaults "See the npm package") Assigns own and inherited enumerable properties of source objects to the destination object for all destination properties that resolve to `undefined`. @@ -6008,7 +6013,7 @@ _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); ### `_.defaultsDeep(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10570 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10599 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package") This method is like `_.defaults` except that it recursively assigns default properties. @@ -6035,7 +6040,7 @@ _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'ag ### `_.findKey(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10608 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findkey "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10637 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findkey "See the npm package") This method is like `_.find` except that it returns the key of the first element `predicate` returns truthy for instead of the element itself. @@ -6077,7 +6082,7 @@ _.findKey(users, 'active'); ### `_.findLastKey(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10645 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastkey "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10674 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastkey "See the npm package") This method is like `_.findKey` except that it iterates over elements of a collection in the opposite order. @@ -6119,7 +6124,7 @@ _.findLastKey(users, 'active'); ### `_.forIn(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10675 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10704 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forin "See the npm package") Iterates over own and inherited enumerable properties of an object invoking `iteratee` for each property. The iteratee is invoked with three arguments:
@@ -6154,7 +6159,7 @@ _.forIn(new Foo, function(value, key) { ### `_.forInRight(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10703 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forinright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10732 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forinright "See the npm package") This method is like `_.forIn` except that it iterates over properties of `object` in the opposite order. @@ -6187,7 +6192,7 @@ _.forInRight(new Foo, function(value, key) { ### `_.forOwn(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10733 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forown "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10762 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forown "See the npm package") Iterates over own enumerable properties of an object invoking `iteratee` for each property. The iteratee is invoked with three arguments:
@@ -6222,7 +6227,7 @@ _.forOwn(new Foo, function(value, key) { ### `_.forOwnRight(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10761 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forownright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10790 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forownright "See the npm package") This method is like `_.forOwn` except that it iterates over properties of `object` in the opposite order. @@ -6255,7 +6260,7 @@ _.forOwnRight(new Foo, function(value, key) { ### `_.functions(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10786 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functions "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10815 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functions "See the npm package") Creates an array of function property names from own enumerable properties of `object`. @@ -6285,7 +6290,7 @@ _.functions(new Foo); ### `_.functionsIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10811 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functionsin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10840 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functionsin "See the npm package") Creates an array of function property names from own and inherited enumerable properties of `object`. @@ -6315,7 +6320,7 @@ _.functionsIn(new Foo); ### `_.get(object, path, [defaultValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10839 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.get "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10868 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.get "See the npm package") Gets the value at `path` of `object`. If the resolved value is `undefined` the `defaultValue` is used in its place. @@ -6348,7 +6353,7 @@ _.get(object, 'a.b.c', 'default'); ### `_.has(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10870 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.has "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10899 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.has "See the npm package") Checks if `path` is a direct property of `object`. @@ -6383,7 +6388,7 @@ _.has(other, 'a'); ### `_.hasIn(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10899 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.hasin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10928 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.hasin "See the npm package") Checks if `path` is a direct or inherited property of `object`. @@ -6417,7 +6422,7 @@ _.hasIn(object, 'b'); ### `_.invert(object, [multiVal])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10926 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invert "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10955 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invert "See the npm package") Creates an object composed of the inverted keys and values of `object`. If `object` contains duplicate values, subsequent values overwrite property @@ -6448,7 +6453,7 @@ _.invert(object, true); ### `_.invoke(object, path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10960 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invoke "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L10989 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invoke "See the npm package") Invokes the method at `path` of `object`. @@ -6474,7 +6479,7 @@ _.invoke(object, 'a[0].b.c.slice', 1, 3); ### `_.keys(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L10989 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keys "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11018 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keys "See the npm package") Creates an array of the own enumerable property names of `object`.
@@ -6511,7 +6516,7 @@ _.keys('hi'); ### `_.keysIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11031 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keysin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11060 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keysin "See the npm package") Creates an array of the own and inherited enumerable property names of `object`.
@@ -6543,7 +6548,7 @@ _.keysIn(new Foo); ### `_.mapKeys(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11069 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapkeys "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11098 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapkeys "See the npm package") The opposite of `_.mapValues`; this method creates an object with the same values as `object` and keys generated by running each own enumerable @@ -6570,7 +6575,7 @@ _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { ### `_.mapValues(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11104 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapvalues "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11133 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapvalues "See the npm package") Creates an object with the same keys as `object` and values generated by running each own enumerable property of `object` through `iteratee`. The @@ -6604,7 +6609,7 @@ _.mapValues(users, 'age'); ### `_.merge(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11143 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.merge "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11172 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.merge "See the npm package") Recursively merges own and inherited enumerable properties of source objects into the destination object, skipping source properties that resolve @@ -6643,7 +6648,7 @@ _.merge(users, ages); ### `_.mergeWith(object, sources, customizer)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11182 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mergewith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11211 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mergewith "See the npm package") This method is like `_.merge` except that it accepts `customizer` which is invoked to produce the merged values of the destination and source @@ -6687,7 +6692,7 @@ _.mergeWith(object, other, customizer); ### `_.omit(object, [props])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11204 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omit "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11233 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omit "See the npm package") The opposite of `_.pick`; this method creates an object composed of the own and inherited enumerable properties of `object` that are not omitted. @@ -6713,7 +6718,7 @@ _.omit(object, ['a', 'c']); ### `_.omitBy(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11230 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omitby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11259 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omitby "See the npm package") The opposite of `_.pickBy`; this method creates an object composed of the own and inherited enumerable properties of `object` that `predicate` @@ -6740,7 +6745,7 @@ _.omitBy(object, _.isNumber); ### `_.pick(object, [props])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11254 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pick "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11283 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pick "See the npm package") Creates an object composed of the picked `object` properties. @@ -6765,7 +6770,7 @@ _.pick(object, ['a', 'c']); ### `_.pickBy(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11275 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pickby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11304 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pickby "See the npm package") Creates an object composed of the `object` properties `predicate` returns truthy for. The predicate is invoked with one argument: (value). @@ -6791,7 +6796,7 @@ _.pickBy(object, _.isNumber); ### `_.result(object, path, [defaultValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11307 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.result "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11336 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.result "See the npm package") This method is like `_.get` except that if the resolved value is a function it's invoked with the `this` binding of its parent object and its result @@ -6828,7 +6833,7 @@ _.result(object, 'a[0].b.c3', _.constant('default')); ### `_.set(object, path, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11346 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.set "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11375 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.set "See the npm package") Sets the value at `path` of `object`. If a portion of `path` doesn't exist it's created. Arrays are created for missing index properties while objects @@ -6862,7 +6867,7 @@ console.log(object.x[0].y.z); ### `_.setWith(object, path, value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11369 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.setwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11398 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.setwith "See the npm package") This method is like `_.set` except that it accepts `customizer` which is invoked to produce the objects of `path`. If `customizer` returns `undefined` @@ -6890,7 +6895,7 @@ _.setWith({ '0': { 'length': 2 } }, '[0][1][2]', 3, Object); ### `_.toPairs(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11394 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairs "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11423 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairs "See the npm package") Creates an array of own enumerable key-value pairs for `object`. @@ -6919,7 +6924,7 @@ _.toPairs(new Foo); ### `_.toPairsIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11418 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairsin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11447 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairsin "See the npm package") Creates an array of own and inherited enumerable key-value pairs for `object`. @@ -6948,7 +6953,7 @@ _.toPairsIn(new Foo); ### `_.transform(object, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11450 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.transform "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11479 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.transform "See the npm package") An alternative to `_.reduce`; this method transforms `object` to a new `accumulator` object which is the result of running each of its own enumerable @@ -6985,7 +6990,7 @@ _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { ### `_.unset(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11496 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unset "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11525 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unset "See the npm package") Removes the property at `path` of `object`. @@ -7018,7 +7023,7 @@ console.log(object); ### `_.values(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11525 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.values "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11554 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.values "See the npm package") Creates an array of the own enumerable property values of `object`.
@@ -7053,7 +7058,7 @@ _.values('hi'); ### `_.valuesIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11551 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.valuesin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11580 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.valuesin "See the npm package") Creates an array of the own and inherited enumerable property values of `object`.
@@ -7091,7 +7096,7 @@ _.valuesIn(new Foo); ### `_(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L1439 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1445 "View in source") [Ⓣ][1] Creates a `lodash` object which wraps `value` to enable implicit method chaining. Methods that operate on and return arrays, collections, and @@ -7142,13 +7147,12 @@ The wrapper methods that support shortcut fusion are:
The chainable wrapper methods are:
`after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, `before`, `bind`, `bindAll`, `bindKey`, `chain`, `chunk`, `commit`, -`compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`, +`compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, -`differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, +`differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`, -`flowRight`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, -`forOwnRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, -`intersection`, `intersectionBy`, `intersectionWith`, invert`, `invokeMap`, +`flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, +`intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, @@ -7168,22 +7172,23 @@ The wrapper methods that are **not** chainable by default are:
`add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, -`findLast`, `findLastIndex`, `findLastKey`, `floor`, `get`, `gt`, `gte`, -`has`, `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, -`invoke`, `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, -`isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, -`isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, -`isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, -`isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, -`isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`, `last`, -`lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, -`mean`, `min`, `minBy`, `noConflict`, `noop`, `now`, `pad`, `padEnd`, -`padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, -`result`, `round`, `runInContext`, `sample`, `shift`, `size`, `snakeCase`, -`some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, -`startCase`, `startsWith`, `subtract`, `sum`, sumBy`, `template`, `times`, -`toLower`, `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, toString`, -`toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, +`findLast`, `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, +`forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, +`hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, +`isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, +`isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, +`isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, `isMatchWith`, +`isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`, +`isPlainObject`, `isRegExp`, `isSafeInteger`, `isString`, `isUndefined`, +`isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, +`lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, +`noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`, +`pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, +`runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, +`sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, +`startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toLower`, +`toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, +`trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words` #### Arguments @@ -7220,7 +7225,7 @@ _.isArray(squares.value()); ### `_.chain(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6956 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L6981 "View in source") [Ⓣ][1] Creates a `lodash` object that wraps `value` with explicit method chaining enabled. The result of such method chaining must be unwrapped with `_#value`. @@ -7256,7 +7261,7 @@ var youngest = _ ### `_.tap(value, interceptor)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L6984 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7009 "View in source") [Ⓣ][1] This method invokes `interceptor` and returns `value`. The interceptor is invoked with one argument; (value). The purpose of this method is to "tap into" @@ -7287,7 +7292,7 @@ _([1, 2, 3]) ### `_.thru(value, interceptor)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7009 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7034 "View in source") [Ⓣ][1] This method is like `_.tap` except that it returns the result of `interceptor`. @@ -7315,34 +7320,8 @@ _(' abc ') -### `_.wrapperFlatMap([iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7128 "View in source") [Ⓣ][1] - -This method is the wrapper version of `_.flatMap`. - -#### Arguments -1. `[iteratee=_.identity]` *(Function|Object|string)*: The function invoked per iteration. - -#### Returns -*(Object)*: Returns the new `lodash` wrapper instance. - -#### Example -```js -function duplicate(n) { - return [n, n]; -} - -_([1, 2]).flatMap(duplicate).value(); -// => [1, 1, 2, 2] -``` -* * * - - - - - ### `_.prototype[Symbol.iterator]()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7180 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7205 "View in source") [Ⓣ][1] Enables the wrapper to be iterable. @@ -7366,7 +7345,7 @@ Array.from(wrapped); ### `_.prototype.at([paths])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7032 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7057 "View in source") [Ⓣ][1] This method is the wrapper version of `_.at`. @@ -7393,7 +7372,7 @@ _(['a', 'b', 'c']).at(0, 2).value(); ### `_.prototype.chain()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7078 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7103 "View in source") [Ⓣ][1] Enables explicit method chaining on the wrapper object. @@ -7426,7 +7405,7 @@ _(users) ### `_.prototype.commit()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7107 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7132 "View in source") [Ⓣ][1] Executes the chained sequence and returns the wrapped result. @@ -7457,8 +7436,34 @@ console.log(array); +### `_.prototype.flatMap([iteratee=_.identity])` +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7153 "View in source") [Ⓣ][1] + +This method is the wrapper version of `_.flatMap`. + +#### Arguments +1. `[iteratee=_.identity]` *(Function|Object|string)*: The function invoked per iteration. + +#### Returns +*(Object)*: Returns the new `lodash` wrapper instance. + +#### Example +```js +function duplicate(n) { + return [n, n]; +} + +_([1, 2]).flatMap(duplicate).value(); +// => [1, 1, 2, 2] +``` +* * * + + + + + ### `_.prototype.next()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7153 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7178 "View in source") [Ⓣ][1] Gets the next value on a wrapped object following the [iterator protocol](https://mdn.io/iteration_protocols#iterator). @@ -7486,7 +7491,7 @@ wrapped.next(); ### `_.prototype.plant(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7207 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7232 "View in source") [Ⓣ][1] Creates a clone of the chained sequence planting `value` as the wrapped value. @@ -7518,7 +7523,7 @@ wrapped.value(); ### `_.prototype.reverse()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7246 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7271 "View in source") [Ⓣ][1] This method is the wrapper version of `_.reverse`.
@@ -7545,12 +7550,12 @@ console.log(array); ### `_.prototype.value()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L7273 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L7298 "View in source") [Ⓣ][1] Executes the chained sequence to extract the unwrapped value. #### Aliases -*_.prototype.run, _.prototype.toJSON, _.prototype.valueOf* +*_.prototype.toJSON, _.prototype.valueOf* #### Returns *(*)*: Returns the resolved unwrapped value. @@ -7573,7 +7578,7 @@ _([1, 2, 3]).value(); ### `_.camelCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11729 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.camelcase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11758 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.camelcase "See the npm package") Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). @@ -7601,7 +7606,7 @@ _.camelCase('__foo_bar__'); ### `_.capitalize([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11748 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.capitalize "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11777 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.capitalize "See the npm package") Converts the first character of `string` to upper case and the remaining to lower case. @@ -7624,7 +7629,7 @@ _.capitalize('FRED'); ### `_.deburr([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11766 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.deburr "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11795 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.deburr "See the npm package") Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). @@ -7647,7 +7652,7 @@ _.deburr('déjà vu'); ### `_.endsWith([string=''], [target], [position=string.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11792 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.endswith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11821 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.endswith "See the npm package") Checks if `string` ends with the given target string. @@ -7677,7 +7682,7 @@ _.endsWith('abc', 'b', 2); ### `_.escape([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11837 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escape "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11866 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escape "See the npm package") Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to their corresponding HTML entities. @@ -7722,7 +7727,7 @@ _.escape('fred, barney, & pebbles'); ### `_.escapeRegExp([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11858 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11887 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package") Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. @@ -7745,7 +7750,7 @@ _.escapeRegExp('[lodash](https://lodash.com/)'); ### `_.kebabCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11884 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.kebabcase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11913 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.kebabcase "See the npm package") Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). @@ -7773,7 +7778,7 @@ _.kebabCase('__foo_bar__'); ### `_.lowerCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11907 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowercase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11936 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowercase "See the npm package") Converts `string`, as space separated words, to lower case. @@ -7801,7 +7806,7 @@ _.lowerCase('__FOO_BAR__'); ### `_.lowerFirst([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11927 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11956 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package") Converts the first character of `string` to lower case. @@ -7826,7 +7831,7 @@ _.lowerFirst('FRED'); ### `_.pad([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11969 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pad "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11998 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pad "See the npm package") Pads `string` on the left and right sides if it's shorter than `length`. Padding characters are truncated if they can't be evenly divided by `length`. @@ -7857,7 +7862,7 @@ _.pad('abc', 3); ### `_.padEnd([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12006 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padend "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12035 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padend "See the npm package") Pads `string` on the right side if it's shorter than `length`. Padding characters are truncated if they exceed `length`. @@ -7888,7 +7893,7 @@ _.padEnd('abc', 3); ### `_.padStart([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12033 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padstart "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12062 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padstart "See the npm package") Pads `string` on the left side if it's shorter than `length`. Padding characters are truncated if they exceed `length`. @@ -7919,14 +7924,14 @@ _.padStart('abc', 3); ### `_.parseInt(string, [radix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12061 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.parseint "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12090 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.parseint "See the npm package") Converts `string` to an integer of the specified radix. If `radix` is `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, in which case a `radix` of `16` is used.

-**Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E) +**Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. #### Arguments @@ -7951,7 +7956,7 @@ _.map(['6', '08', '10'], _.parseInt); ### `_.repeat([string=''], [n=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12093 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.repeat "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12122 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.repeat "See the npm package") Repeats the given string `n` times. @@ -7980,7 +7985,7 @@ _.repeat('abc', 0); ### `_.replace([string=''], pattern, replacement)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12131 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.replace "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12160 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.replace "See the npm package") Replaces matches for `pattern` in `string` with `replacement`.
@@ -8007,7 +8012,7 @@ _.replace('Hi Fred', 'Fred', 'Barney'); ### `_.snakeCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12157 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.snakecase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12186 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.snakecase "See the npm package") Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). @@ -8035,7 +8040,7 @@ _.snakeCase('--foo-bar'); ### `_.split([string=''], separator, [limit])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12178 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.split "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12207 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.split "See the npm package") Splits `string` by `separator`.
@@ -8062,7 +8067,7 @@ _.split('a-b-c', '-', 2); ### `_.startCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12201 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startcase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12230 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startcase "See the npm package") Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). @@ -8090,7 +8095,7 @@ _.startCase('__foo_bar__'); ### `_.startsWith([string=''], [target], [position=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12226 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startswith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12255 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startswith "See the npm package") Checks if `string` starts with the given target string. @@ -8120,7 +8125,7 @@ _.startsWith('abc', 'b', 1); ### `_.template([string=''], [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12328 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.template "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12357 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.template "See the npm package") Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, HTML-escape interpolated data properties in @@ -8227,7 +8232,7 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\ ### `_.toLower([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12453 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolower "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12482 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolower "See the npm package") Converts `string`, as a whole, to lower case. @@ -8255,7 +8260,7 @@ _.toLower('__FOO_BAR__'); ### `_.toUpper([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12476 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toupper "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12505 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toupper "See the npm package") Converts `string`, as a whole, to upper case. @@ -8283,7 +8288,7 @@ _.toUpper('__foo_bar__'); ### `_.trim([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12501 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trim "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12530 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trim "See the npm package") Removes leading and trailing whitespace or specified characters from `string`. @@ -8312,7 +8317,7 @@ _.map([' foo ', ' bar '], _.trim); ### `_.trimEnd([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12537 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimend "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12566 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimend "See the npm package") Removes trailing whitespace or specified characters from `string`. @@ -8338,7 +8343,7 @@ _.trimEnd('-_-abc-_-', '_-'); ### `_.trimStart([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12571 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimstart "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12600 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimstart "See the npm package") Removes leading whitespace or specified characters from `string`. @@ -8364,7 +8369,7 @@ _.trimStart('-_-abc-_-', '_-'); ### `_.truncate([string=''], [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12623 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.truncate "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12652 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.truncate "See the npm package") Truncates `string` if it's longer than the given maximum string length. The last characters of the truncated string are replaced with the omission @@ -8409,7 +8414,7 @@ _.truncate('hi-diddly-ho there, neighborino', { ### `_.unescape([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12697 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unescape "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12726 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unescape "See the npm package") The inverse of `_.escape`; this method converts the HTML entities `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their @@ -8437,7 +8442,7 @@ _.unescape('fred, barney, & pebbles'); ### `_.upperCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12723 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uppercase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12752 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uppercase "See the npm package") Converts `string`, as space separated words, to upper case. @@ -8465,7 +8470,7 @@ _.upperCase('__foo_bar__'); ### `_.upperFirst([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L11945 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.upperfirst "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L11974 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.upperfirst "See the npm package") Converts the first character of `string` to upper case. @@ -8490,7 +8495,7 @@ _.upperFirst('FRED'); ### `_.words([string=''], [pattern])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12745 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.words "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12774 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.words "See the npm package") Splits `string` into an array of its words. @@ -8522,7 +8527,7 @@ _.words('fred, barney, & pebbles', /[^, ]+/g); ### `_.attempt(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12777 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.attempt "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12806 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.attempt "See the npm package") Attempts to invoke `func`, returning either the result or the caught error object. Any additional arguments are provided to `func` when it's invoked. @@ -8551,7 +8556,7 @@ if (_.isError(elements)) { ### `_.bindAll(object, methodNames)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12811 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindall "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12840 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindall "See the npm package") Binds methods of an object to the object itself, overwriting the existing method. @@ -8586,7 +8591,7 @@ jQuery(element).on('click', view.onClick); ### `_.cond(pairs)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12846 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.cond "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12875 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.cond "See the npm package") Creates a function that iterates over `pairs` invoking the corresponding function of the first predicate to return truthy. The predicate-function @@ -8605,7 +8610,7 @@ var func = _.cond([ [_.matches({ 'a': 1 }), _.constant('matches A')], [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], [_.constant(true), _.constant('no match')] -]) +]); func({ 'a': 1, 'b': 2 }); // => 'matches A' @@ -8623,7 +8628,7 @@ func({ 'a': '1', 'b': '2' }); ### `_.conforms(source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12888 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.conforms "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12917 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.conforms "See the npm package") Creates a function that invokes the predicate properties of `source` with the corresponding property values of a given object, returning `true` if @@ -8652,7 +8657,7 @@ _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) })); ### `_.constant(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12908 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.constant "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12937 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.constant "See the npm package") Creates a function that returns `value`. @@ -8677,7 +8682,7 @@ getter() === object; ### `_.flow([funcs])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12934 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flow "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12963 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flow "See the npm package") Creates a function that returns the result of invoking the provided functions with the `this` binding of the created function, where each @@ -8706,7 +8711,7 @@ addSquare(1, 2); ### `_.flowRight([funcs])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12955 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flowright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L12984 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flowright "See the npm package") This method is like `_.flow` except that it creates a function that invokes the provided functions from right to left. @@ -8734,7 +8739,7 @@ addSquare(1, 2); ### `_.identity(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L12972 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.identity "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13001 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.identity "See the npm package") This method returns the first argument provided to it. @@ -8758,7 +8763,7 @@ _.identity(object) === object; ### `_.iteratee([func=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13005 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iteratee "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13034 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iteratee "See the npm package") Creates a function that invokes `func` with the arguments of the created function. If `func` is a property name the created callback returns the @@ -8796,7 +8801,7 @@ _.filter(users, 'age > 36'); ### `_.matches(source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13033 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matches "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13062 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matches "See the npm package") Creates a function that performs a deep partial comparison between a given object and `source`, returning `true` if the given object has equivalent @@ -8828,7 +8833,7 @@ _.filter(users, _.matches({ 'age': 40, 'active': false })); ### `_.matchesProperty(path, srcValue)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13060 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matchesproperty "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13089 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matchesproperty "See the npm package") Creates a function that performs a deep partial comparison between the value at `path` of a given object to `srcValue`, returning `true` if the @@ -8861,7 +8866,7 @@ _.find(users, _.matchesProperty('user', 'fred')); ### `_.method(path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13087 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.method "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13116 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.method "See the npm package") Creates a function that invokes the method at `path` of a given object. Any additional arguments are provided to the invoked method. @@ -8893,7 +8898,7 @@ _.invokeMap(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c'); ### `_.methodOf(object, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13115 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.methodof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13144 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.methodof "See the npm package") The opposite of `_.method`; this method creates a function that invokes the method at a given path of `object`. Any additional arguments are @@ -8924,7 +8929,7 @@ _.map([['a', '2'], ['c', '0']], _.methodOf(object)); ### `_.mixin([object=lodash], source, [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13157 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mixin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13186 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mixin "See the npm package") Adds all own enumerable function properties of a source object to the destination object. If `object` is a function then methods are added to @@ -8969,7 +8974,7 @@ _('fred').vowels(); ### `_.noConflict()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13205 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noconflict "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13234 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noconflict "See the npm package") Reverts the `_` variable to its previous value and returns a reference to the `lodash` function. @@ -8988,7 +8993,7 @@ var lodash = _.noConflict(); ### `_.noop()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13224 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noop "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13255 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noop "See the npm package") A no-operation function that returns `undefined` regardless of the arguments it receives. @@ -9007,7 +9012,7 @@ _.noop(object) === undefined; ### `_.nthArg([n=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13243 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ntharg "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13274 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ntharg "See the npm package") Creates a function that returns its nth argument. @@ -9031,7 +9036,7 @@ func('a', 'b', 'c'); ### `_.over(iteratees)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13266 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.over "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13297 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.over "See the npm package") Creates a function that invokes `iteratees` with the arguments provided to the created function and returns their results. @@ -9056,7 +9061,7 @@ func(1, 2, 3, 4); ### `_.overEvery(predicates)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13290 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overevery "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13321 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overevery "See the npm package") Creates a function that checks if **all** of the `predicates` return truthy when invoked with the arguments provided to the created function. @@ -9087,7 +9092,7 @@ func(NaN); ### `_.overSome(predicates)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13314 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.oversome "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13345 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.oversome "See the npm package") Creates a function that checks if **any** of the `predicates` return truthy when invoked with the arguments provided to the created function. @@ -9118,7 +9123,7 @@ func(NaN); ### `_.property(path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13337 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.property "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13368 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.property "See the npm package") Creates a function that returns the value at `path` of a given object. @@ -9148,7 +9153,7 @@ _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); ### `_.propertyOf(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13361 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.propertyof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13392 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.propertyof "See the npm package") The opposite of `_.property`; this method creates a function that returns the value at a given path of `object`. @@ -9177,13 +9182,12 @@ _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); ### `_.range([start=0], end, [step=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13407 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.range "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13437 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.range "See the npm package") Creates an array of numbers (positive and/or negative) progressing from `start` up to, but not including, `end`. A step of `-1` is used if a negative `start` is specified without an `end` or `step`. If `end` is not specified -it's set to `start` with `start` then set to `0`. If `end` is less than -`start` a zero-length range is created unless a negative `step` is specified. +it's set to `start` with `start` then set to `0`.

**Note:** JavaScript follows the IEEE-754 standard for resolving @@ -9227,7 +9231,7 @@ _.range(0); ### `_.rangeRight([start=0], end, [step=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13443 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rangeright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13473 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rangeright "See the npm package") This method is like `_.range` except that it populates values in descending order. @@ -9270,7 +9274,7 @@ _.rangeRight(0); ### `_.runInContext([context=root])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L1240 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.runincontext "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1246 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.runincontext "See the npm package") Create a new pristine `lodash` function using the `context` object. @@ -9314,7 +9318,7 @@ var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; ### `_.times(n, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13463 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.times "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13493 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.times "See the npm package") Invokes the iteratee function `n` times, returning an array of the results of each invocation. The iteratee is invoked with one argument; (index). @@ -9341,7 +9345,7 @@ _.times(3, String); ### `_.toPath(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13506 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topath "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13536 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topath "See the npm package") Converts `value` to a property path array. @@ -9375,7 +9379,7 @@ console.log(path === newPath); ### `_.uniqueId([prefix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L13526 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqueid "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L13556 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqueid "See the npm package") Generates a unique ID. If `prefix` is provided the ID is appended to it. @@ -9401,46 +9405,12 @@ _.uniqueId(); -## `Methods` - - - -### `_.templateSettings.imports._` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L1532 "View in source") [Ⓣ][1] - -A reference to the `lodash` function. - -* * * - - - - - -### `stringSize(string)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L1170 "View in source") [Ⓣ][1] - -Gets the number of symbols in `string`. - -#### Arguments -1. `string` *(string)*: The string to inspect. - -#### Returns -*(number)*: Returns the string size. - -* * * - - - - - - - ## `Properties` ### `_.VERSION` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L14157 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L14187 "View in source") [Ⓣ][1] (string): The semantic version number. @@ -9451,7 +9421,7 @@ Gets the number of symbols in `string`. ### `_.templateSettings` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L1484 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.templatesettings "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1490 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.templatesettings "See the npm package") (Object): By default, the template delimiters used by lodash are like those in embedded Ruby (ERB). Change the following template settings to use @@ -9464,7 +9434,7 @@ alternative delimiters. ### `_.templateSettings.escape` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L1492 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1498 "View in source") [Ⓣ][1] (RegExp): Used to detect `data` property values to be HTML-escaped. @@ -9475,7 +9445,7 @@ alternative delimiters. ### `_.templateSettings.evaluate` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L1500 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1506 "View in source") [Ⓣ][1] (RegExp): Used to detect code to be evaluated. @@ -9486,7 +9456,7 @@ alternative delimiters. ### `_.templateSettings.imports` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L1524 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1530 "View in source") [Ⓣ][1] (Object): Used to import variables into the compiled template. @@ -9497,7 +9467,7 @@ alternative delimiters. ### `_.templateSettings.interpolate` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L1508 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1514 "View in source") [Ⓣ][1] (RegExp): Used to detect `data` property values to inject. @@ -9508,7 +9478,7 @@ alternative delimiters. ### `_.templateSettings.variable` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.0/lodash.js#L1516 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1522 "View in source") [Ⓣ][1] (string): Used to reference the data object in the template text. @@ -9518,6 +9488,23 @@ alternative delimiters. + + +## `Methods` + + + +### `_.templateSettings.imports._` +# [Ⓢ](https://github.com/lodash/lodash/blob/4.0.1/lodash.js#L1538 "View in source") [Ⓣ][1] + +A reference to the `lodash` function. + +* * * + + + + + [1]: #array "Jump back to the TOC." diff --git a/lodash.js b/lodash.js index 5915052334..95aef79608 100644 --- a/lodash.js +++ b/lodash.js @@ -1,6 +1,6 @@ /** * @license - * lodash 4.0.0 (Custom Build) + * lodash 4.0.1 (Custom Build) * Build: `lodash -d -o ./lodash.js` * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 @@ -13,7 +13,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.0.0'; + var VERSION = '4.0.1'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, From 258ad020edd47f689a76e7c2359756e742d0c6b4 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 19 Jan 2016 21:40:30 -0600 Subject: [PATCH 90/90] Bump to 4.0.1. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e832b98b0d..c142c8573f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lodash", - "version": "4.0.0", + "version": "4.0.1", "main": "lodash.js", "private": true, "devDependencies": {