From a5ae078f8fe3357007bd29fa07d9023402009ba2 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 5 Feb 2016 00:23:20 -0800 Subject: [PATCH 01/28] Increment package version to enable ci tests. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ec8dc67a8c..b0aa712ce6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lodash", - "version": "4.2.1", + "version": "4.2.2-pre", "main": "lodash.js", "private": true, "devDependencies": { From eb72bbe6f71640d60f05739dbd43fce9d01a3bf2 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 3 Feb 2016 22:26:49 -0800 Subject: [PATCH 02/28] Update license to github formatting. --- LICENSE | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/LICENSE b/LICENSE index b054ca5a3a..bcbe13d67a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,22 +1,23 @@ +The MIT License (MIT) + Copyright 2012-2016 The Dojo Foundation Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 73134f9dcc7572305cca6159a777a862ac84df24 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 3 Feb 2016 23:02:40 -0800 Subject: [PATCH 03/28] Update the readme. --- README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6fafb43daf..2184fae952 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,20 @@ $ lodash core -o ./dist/lodash.core.js [![Gitter](https://badges.gitter.im/lodash/lodash.svg)](https://gitter.im/lodash/lodash) -## Module formats +## Documentation + + * [API Documentation](https://lodash.com/docs) + * [DevDocs – *a searchable interface for our documentation*](https://lodash.com/docs) + +## Download + +Lodash is released under the [MIT license](https://raw.githubusercontent.com/lodash/lodash/4.2.1/LICENSE) & supports [modern environments](#support).
+Review the [build differences](https://github.com/lodash/lodash/wiki/build-differences) & pick the one that’s right for you. + + * [Core build](https://raw.githubusercontent.com/lodash/lodash/4.2.1/dist/lodash.core.js) ([~4 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.2.1/dist/lodash.core.min.js)) + * [Full build](https://raw.githubusercontent.com/lodash/lodash/4.2.1/dist/lodash.js) ([~20 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.2.1/dist/lodash.min.js)) + +## Module Formats Lodash is available in a variety of other builds & module formats. @@ -21,9 +34,12 @@ Lodash is available in a variety of other builds & module formats. * [lodash-amd](https://www.npmjs.com/package/lodash-amd) * [lodash-es](https://www.npmjs.com/package/lodash-es) & [babel-plugin-lodash](https://www.npmjs.com/package/babel-plugin-lodash) +CDN copies are available on [cdnjs](https://cdnjs.com/) & [jsDelivr](http://www.jsdelivr.com/).
+Create [custom builds](https://lodash.com/custom-builds) with only the features you need. + ## Further Reading - * [API Documentation](https://lodash.com/docs) + * [Release Notes](https://github.com/lodash/lodash/releases/tag/4.0.0) * [Build Differences](https://github.com/lodash/lodash/wiki/Build-Differences) * [Changelog](https://github.com/lodash/lodash/wiki/Changelog) * [Roadmap](https://github.com/lodash/lodash/wiki/Roadmap) From fc85cac91de1d9f9bde0266d084db461e1643fbe Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 4 Feb 2016 22:17:32 -0800 Subject: [PATCH 04/28] Update sauce-tunnel and webpack deps. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b0aa712ce6..bf5ceed3c5 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,9 @@ "qunitjs": "~1.21.0", "request": "^2.69.0", "requirejs": "^2.1.22", - "sauce-tunnel": "2.3.0", + "sauce-tunnel": "^2.4.0", "uglify-js": "2.6.1", - "webpack": "^1.12.12" + "webpack": "^1.12.13" }, "scripts": { "build": "npm run build:main & npm run build:fp", From 15956517803051d14fb3672f4066194b412656fe Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 4 Feb 2016 23:55:55 -0800 Subject: [PATCH 05/28] Add support for cloning buffers. [closes #1940] --- lodash.js | 59 +++++++++++++++++++++++++++++++++++++++++++--------- test/test.js | 17 +++++++++++++++ 2 files changed, 66 insertions(+), 10 deletions(-) diff --git a/lodash.js b/lodash.js index 427d385cca..e4d5a4cf23 100644 --- a/lodash.js +++ b/lodash.js @@ -230,8 +230,8 @@ /** Used to assign default `context` object properties. */ var contextProps = [ - 'Array', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', - 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Array', 'Buffer', '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' @@ -1305,7 +1305,8 @@ ); /** Built-in value references. */ - var Reflect = context.Reflect, + var Buffer = moduleExports ? context.Buffer : undefined, + Reflect = context.Reflect, Symbol = context.Symbol, Uint8Array = context.Uint8Array, clearTimeout = context.clearTimeout, @@ -2250,6 +2251,9 @@ var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; + if (isBuffer(value)) { + return cloneBuffer(value); + } if (tag == objectTag || tag == argsTag || (isFunc && !object)) { if (isHostObject(value)) { return object ? value : {}; @@ -3707,18 +3711,33 @@ } /** - * Creates a clone of `buffer`. + * Creates a clone of `buffer`. * * @private - * @param {ArrayBuffer} buffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. + * @param {Buffer} buffer The buffer to clone. + * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer) { var Ctor = buffer.constructor, - result = new Ctor(buffer.byteLength), + result = new Ctor(buffer.byteLength); + + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var Ctor = arrayBuffer.constructor, + result = new Ctor(arrayBuffer.byteLength), view = new Uint8Array(result); - view.set(new Uint8Array(buffer)); + view.set(new Uint8Array(arrayBuffer)); return result; } @@ -3784,7 +3803,7 @@ var buffer = typedArray.buffer, Ctor = typedArray.constructor; - return new Ctor(isDeep ? cloneBuffer(buffer) : buffer, typedArray.byteOffset, typedArray.length); + return new Ctor(isDeep ? cloneArrayBuffer(buffer) : buffer, typedArray.byteOffset, typedArray.length); } /** @@ -4978,7 +4997,7 @@ var Ctor = object.constructor; switch (tag) { case arrayBufferTag: - return cloneBuffer(object); + return cloneArrayBuffer(object); case boolTag: case dateTag: @@ -9504,6 +9523,26 @@ (isObjectLike(value) && objectToString.call(value) == boolTag); } + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = !Buffer ? constant(false) : function(value) { + return value instanceof Buffer; + }; + /** * Checks if `value` is classified as a `Date` object. * diff --git a/test/test.js b/test/test.js index 988df5c815..79fc83e268 100644 --- a/test/test.js +++ b/test/test.js @@ -44,6 +44,7 @@ amd = root.define && define.amd, argv = root.process && process.argv, ArrayBuffer = root.ArrayBuffer, + Buffer = root.Buffer, defineProperty = Object.defineProperty, document = !phantom && root.document, body = root.document && root.document.body, @@ -2538,6 +2539,22 @@ assert.strictEqual(actual.lastIndex, 3); }); + QUnit.test('`_.' + methodName + '` should clone buffers', function(assert) { + assert.expect(3); + + if (Buffer) { + var buffer = new Buffer([1, 2, 3]), + actual = func(buffer); + + assert.strictEqual(actual.byteLength, buffer.byteLength); + assert.strictEqual(actual.inspect(), buffer.inspect()); + assert.notStrictEqual(actual, buffer); + } + else { + skipTest(assert, 3); + } + }); + QUnit.test('`_.' + methodName + '` should clone prototype objects', function(assert) { assert.expect(2); From 4a805ea666e96281375dd62ad5c2c088091387bd Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 4 Feb 2016 23:59:38 -0800 Subject: [PATCH 06/28] Add `_.isArrayBuffer` and `_.isBuffer`. --- lodash.js | 23 +++++++++++++++++++++++ test/test.js | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index e4d5a4cf23..fe05953ec8 100644 --- a/lodash.js +++ b/lodash.js @@ -9444,6 +9444,27 @@ */ var isArray = Array.isArray; + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @type Function + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + function isArrayBuffer(value) { + return isObjectLike(value) && objectToString.call(value) == arrayBufferTag; + } + /** * 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 @@ -14250,9 +14271,11 @@ lodash.invoke = invoke; lodash.isArguments = isArguments; lodash.isArray = isArray; + lodash.isArrayBuffer = isArrayBuffer; lodash.isArrayLike = isArrayLike; lodash.isArrayLikeObject = isArrayLikeObject; lodash.isBoolean = isBoolean; + lodash.isBuffer = isBuffer; lodash.isDate = isDate; lodash.isElement = isElement; lodash.isEmpty = isEmpty; diff --git a/test/test.js b/test/test.js index 79fc83e268..4c12856f3f 100644 --- a/test/test.js +++ b/test/test.js @@ -23623,7 +23623,7 @@ var acceptFalsey = lodashStable.difference(allMethods, rejectFalsey); QUnit.test('should accept falsey arguments', function(assert) { - assert.expect(289); + assert.expect(291); var emptyArrays = lodashStable.map(falsey, alwaysEmptyArray); From a04fc310b43bc1168028689731b47d94e25f9c79 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 5 Feb 2016 00:49:39 -0800 Subject: [PATCH 07/28] Fix buffer test fails. --- lodash.js | 2 +- test/test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index fe05953ec8..314017a4ed 100644 --- a/lodash.js +++ b/lodash.js @@ -3719,7 +3719,7 @@ */ function cloneBuffer(buffer) { var Ctor = buffer.constructor, - result = new Ctor(buffer.byteLength); + result = new Ctor(buffer.length); buffer.copy(result); return result; diff --git a/test/test.js b/test/test.js index 4c12856f3f..1d58c2962f 100644 --- a/test/test.js +++ b/test/test.js @@ -2543,7 +2543,7 @@ assert.expect(3); if (Buffer) { - var buffer = new Buffer([1, 2, 3]), + var buffer = new Buffer([1, 2]), actual = func(buffer); assert.strictEqual(actual.byteLength, buffer.byteLength); From ce60ac42747a0997335c16e858e3e654c409dc8c Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 5 Feb 2016 08:28:19 -0800 Subject: [PATCH 08/28] Add `isDeep` flag to `cloneBuffer`. --- lodash.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 314017a4ed..bd1ae94ef7 100644 --- a/lodash.js +++ b/lodash.js @@ -3715,9 +3715,13 @@ * * @private * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ - function cloneBuffer(buffer) { + function cloneBuffer(buffer, isDeep) { + if (!isDeep) { + return buffer.slice(); + } var Ctor = buffer.constructor, result = new Ctor(buffer.length); From 7e9d49b3008d6eedf5ed9ff12f9903155b70318f Mon Sep 17 00:00:00 2001 From: Tyler Garrett Date: Fri, 5 Feb 2016 13:12:17 -0800 Subject: [PATCH 09/28] Fix DevDoc link in readme. [ci skip] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2184fae952..859522aa8a 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ $ lodash core -o ./dist/lodash.core.js ## Documentation * [API Documentation](https://lodash.com/docs) - * [DevDocs – *a searchable interface for our documentation*](https://lodash.com/docs) + * [DevDocs – *a searchable interface for our documentation*](https://devdocs.io/lodash/) ## Download From ea942b06429ad5f8d5560f48564f0c2897b9bec4 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 5 Feb 2016 16:51:21 -0800 Subject: [PATCH 10/28] Upgrade sauce tested versions of Chrome and Firefox. --- test/saucelabs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/saucelabs.js b/test/saucelabs.js index 0cbc848c42..d962064c1c 100644 --- a/test/saucelabs.js +++ b/test/saucelabs.js @@ -103,10 +103,10 @@ var browserNameMap = { /** List of platforms to load the runner on. */ var platforms = [ ['Linux', 'android', '5.1'], + ['Windows 10', 'chrome', '48'], ['Windows 10', 'chrome', '47'], - ['Windows 10', 'chrome', '46'], + ['Windows 10', 'firefox', '44'], ['Windows 10', 'firefox', '43'], - ['Windows 10', 'firefox', '42'], ['Windows 10', 'microsoftedge', '20.10240'], ['Windows 10', 'internet explorer', '11'], ['Windows 8', 'internet explorer', '10'], From e30dc968ef8244fd80ee7a3ae012f8bac03086c1 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 5 Feb 2016 22:58:28 -0800 Subject: [PATCH 11/28] Move `_.isNull` test. --- test/test.js | 104 +++++++++++++++++++++++++-------------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/test/test.js b/test/test.js index 1d58c2962f..328da69585 100644 --- a/test/test.js +++ b/test/test.js @@ -9921,58 +9921,6 @@ /*--------------------------------------------------------------------------*/ - QUnit.module('lodash.isNull'); - - (function() { - var args = arguments; - - QUnit.test('should return `true` for `null` values', function(assert) { - assert.expect(1); - - assert.strictEqual(_.isNull(null), true); - }); - - QUnit.test('should return `false` for non `null` values', function(assert) { - assert.expect(13); - - var expected = lodashStable.map(falsey, function(value) { - return value === null; - }); - - var actual = lodashStable.map(falsey, function(value, index) { - return index ? _.isNull(value) : _.isNull(); - }); - - assert.deepEqual(actual, expected); - - assert.strictEqual(_.isNull(args), false); - assert.strictEqual(_.isNull([1, 2, 3]), false); - assert.strictEqual(_.isNull(true), false); - assert.strictEqual(_.isNull(new Date), false); - assert.strictEqual(_.isNull(new Error), false); - assert.strictEqual(_.isNull(_), false); - assert.strictEqual(_.isNull(slice), false); - assert.strictEqual(_.isNull({ 'a': 1 }), false); - assert.strictEqual(_.isNull(1), false); - assert.strictEqual(_.isNull(/x/), false); - assert.strictEqual(_.isNull('a'), false); - assert.strictEqual(_.isNull(symbol), false); - }); - - QUnit.test('should work with nulls from another realm', function(assert) { - assert.expect(1); - - if (realm.object) { - assert.strictEqual(_.isNull(realm.null), true); - } - else { - skipTest(assert); - } - }); - }(1, 2, 3)); - - /*--------------------------------------------------------------------------*/ - QUnit.module('lodash.isNil'); (function() { @@ -10034,6 +9982,58 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.isNull'); + + (function() { + var args = arguments; + + QUnit.test('should return `true` for `null` values', function(assert) { + assert.expect(1); + + assert.strictEqual(_.isNull(null), true); + }); + + QUnit.test('should return `false` for non `null` values', function(assert) { + assert.expect(13); + + var expected = lodashStable.map(falsey, function(value) { + return value === null; + }); + + var actual = lodashStable.map(falsey, function(value, index) { + return index ? _.isNull(value) : _.isNull(); + }); + + assert.deepEqual(actual, expected); + + assert.strictEqual(_.isNull(args), false); + assert.strictEqual(_.isNull([1, 2, 3]), false); + assert.strictEqual(_.isNull(true), false); + assert.strictEqual(_.isNull(new Date), false); + assert.strictEqual(_.isNull(new Error), false); + assert.strictEqual(_.isNull(_), false); + assert.strictEqual(_.isNull(slice), false); + assert.strictEqual(_.isNull({ 'a': 1 }), false); + assert.strictEqual(_.isNull(1), false); + assert.strictEqual(_.isNull(/x/), false); + assert.strictEqual(_.isNull('a'), false); + assert.strictEqual(_.isNull(symbol), false); + }); + + QUnit.test('should work with nulls from another realm', function(assert) { + assert.expect(1); + + if (realm.object) { + assert.strictEqual(_.isNull(realm.null), true); + } + else { + skipTest(assert); + } + }); + }(1, 2, 3)); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.isNumber'); (function() { From 0d340b378b6414867fea8d2710d4c3fa14ef7f62 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 5 Feb 2016 22:58:37 -0800 Subject: [PATCH 12/28] Add `_.isBuffer` test. --- test/test.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/test/test.js b/test/test.js index 328da69585..397dea39c2 100644 --- a/test/test.js +++ b/test/test.js @@ -8004,6 +8004,50 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.isBuffer'); + + (function() { + var args = arguments; + + QUnit.test('should return `true` for buffers', function(assert) { + assert.expect(1); + + if (Buffer) { + assert.strictEqual(_.isBuffer(new Buffer(2)), true); + } + else { + skipTest(assert); + } + }); + + QUnit.test('should return `false` for non buffers', function(assert) { + assert.expect(13); + + var expected = lodashStable.map(falsey, alwaysFalse); + + var actual = lodashStable.map(falsey, function(value, index) { + return index ? _.isBuffer(value) : _.isBuffer(); + }); + + assert.deepEqual(actual, expected); + + assert.strictEqual(_.isBuffer(args), false); + assert.strictEqual(_.isBuffer([1, 2, 3]), false); + assert.strictEqual(_.isBuffer(true), false); + assert.strictEqual(_.isBuffer(new Date), false); + assert.strictEqual(_.isBuffer(new Error), false); + assert.strictEqual(_.isBuffer(_), false); + assert.strictEqual(_.isBuffer(slice), false); + assert.strictEqual(_.isBuffer({ 'a': 1 }), false); + assert.strictEqual(_.isBuffer(1), false); + assert.strictEqual(_.isBuffer(/x/), false); + assert.strictEqual(_.isBuffer('a'), false); + assert.strictEqual(_.isBuffer(symbol), false); + }); + }(1, 2, 3)); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.isDate'); (function() { From 8810754ada03f258a7dd20f5d006616c20937c69 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 5 Feb 2016 23:21:59 -0800 Subject: [PATCH 13/28] Add `_.isArrayBuffer` test. --- test/test.js | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/test/test.js b/test/test.js index 397dea39c2..21618ab39b 100644 --- a/test/test.js +++ b/test/test.js @@ -7892,6 +7892,61 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.isArrayBuffer'); + + (function() { + var args = arguments; + + QUnit.test('should return `true` for buffers', function(assert) { + assert.expect(1); + + if (Buffer) { + assert.strictEqual(_.isArrayBuffer(new ArrayBuffer(2)), true); + } + else { + skipTest(assert); + } + }); + + QUnit.test('should return `false` for non buffers', function(assert) { + assert.expect(13); + + var expected = lodashStable.map(falsey, alwaysFalse); + + var actual = lodashStable.map(falsey, function(value, index) { + return index ? _.isArrayBuffer(value) : _.isArrayBuffer(); + }); + + assert.deepEqual(actual, expected); + + assert.strictEqual(_.isArrayBuffer(args), false); + assert.strictEqual(_.isArrayBuffer([1, 2, 3]), false); + assert.strictEqual(_.isArrayBuffer(true), false); + assert.strictEqual(_.isArrayBuffer(new Date), false); + assert.strictEqual(_.isArrayBuffer(new Error), false); + assert.strictEqual(_.isArrayBuffer(_), false); + assert.strictEqual(_.isArrayBuffer(slice), false); + assert.strictEqual(_.isArrayBuffer({ 'a': 1 }), false); + assert.strictEqual(_.isArrayBuffer(1), false); + assert.strictEqual(_.isArrayBuffer(/x/), false); + assert.strictEqual(_.isArrayBuffer('a'), false); + assert.strictEqual(_.isArrayBuffer(symbol), false); + }); + + QUnit.test('should work with array buffers from another realm', function(assert) { + assert.expect(1); + + if (realm.arrayBuffer) { + assert.strictEqual(_.isArrayBuffer(realm.arrayBuffer), true); + } + else { + skipTest(assert); + } + }); + }(1, 2, 3)); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.isArrayLike'); (function() { From 984b0af883a9d4300f63137424412e1c2368db38 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 6 Feb 2016 00:06:43 -0800 Subject: [PATCH 14/28] Add deep clone test for buffers. --- lodash.js | 4 ++-- test/test.js | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lodash.js b/lodash.js index bd1ae94ef7..1717bf41e8 100644 --- a/lodash.js +++ b/lodash.js @@ -2252,7 +2252,7 @@ isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) { - return cloneBuffer(value); + return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || (isFunc && !object)) { if (isHostObject(value)) { @@ -3719,7 +3719,7 @@ * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { - if (!isDeep) { + if (isDeep) { return buffer.slice(); } var Ctor = buffer.constructor, diff --git a/test/test.js b/test/test.js index 21618ab39b..91212a1be3 100644 --- a/test/test.js +++ b/test/test.js @@ -2540,7 +2540,7 @@ }); QUnit.test('`_.' + methodName + '` should clone buffers', function(assert) { - assert.expect(3); + assert.expect(4); if (Buffer) { var buffer = new Buffer([1, 2]), @@ -2549,9 +2549,12 @@ assert.strictEqual(actual.byteLength, buffer.byteLength); assert.strictEqual(actual.inspect(), buffer.inspect()); assert.notStrictEqual(actual, buffer); + + buffer[0] = 2; + assert.strictEqual(actual[0], isDeep ? 2 : 1); } else { - skipTest(assert, 3); + skipTest(assert, 4); } }); From 88708ec00f2c2201b9db0e49ce3bd55a7756adb5 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 6 Feb 2016 00:27:00 -0800 Subject: [PATCH 15/28] Minor test order nit. --- test/test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index 91212a1be3..70e2fa2a60 100644 --- a/test/test.js +++ b/test/test.js @@ -8881,10 +8881,10 @@ assert.expect(4); if (realm.object) { - assert.strictEqual(_.isEqual({ 'a': 1, 'b': 2, 'c': 3 }, realm.object), true); - assert.strictEqual(_.isEqual({ 'a': 1, 'b': 2, 'c': 2 }, realm.object), false); assert.strictEqual(_.isEqual([1, 2, 3], realm.array), true); assert.strictEqual(_.isEqual([1, 2, 2], realm.array), false); + assert.strictEqual(_.isEqual({ 'a': 1, 'b': 2, 'c': 3 }, realm.object), true); + assert.strictEqual(_.isEqual({ 'a': 1, 'b': 2, 'c': 2 }, realm.object), false); } else { skipTest(assert, 4); From 1cf7093f46bb439785f0c17ac7a105f79b0be452 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 6 Feb 2016 00:30:13 -0800 Subject: [PATCH 16/28] Allow undefined realm values. --- test/test.js | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/test/test.js b/test/test.js index 70e2fa2a60..8579f34311 100644 --- a/test/test.js +++ b/test/test.js @@ -525,29 +525,27 @@ '', ' var object = {', " 'arguments': (function() { return arguments; }(1, 2, 3)),", - " 'array': [1, 2, 3],", - " 'arrayBuffer': new (root.ArrayBuffer || noop),", + " 'array': [1],", + " 'arrayBuffer': root.ArrayBuffer ? new root.ArrayBuffer : undefined,", " 'boolean': Object(false),", " 'date': new Date,", " 'errors': [new Error, new EvalError, new RangeError, new ReferenceError, new SyntaxError, new TypeError, new URIError],", " 'function': noop,", - " 'map': new (root.Map || noop),", + " 'map': root.Map ? new root.Map : undefined,", " 'nan': NaN,", " 'null': null,", " 'number': Object(0),", - " 'object': { 'a': 1, 'b': 2, 'c': 3 },", + " 'object': { 'a': 1 },", " 'regexp': /x/,", - " 'set': new (root.Set || noop),", + " 'set': root.Set ? new root.Set : undefined,", " 'string': Object('a'),", - " 'symbol': Object((root.Symbol || noop)()),", + " 'symbol': root.Symbol ? root.Symbol() : undefined,", " 'undefined': undefined", ' };', '', " ['" + typedArrays.join("', '") + "'].forEach(function(type) {", ' var Ctor = root[type]', - ' if (Ctor) {', - ' object[type.toLowerCase()] = new Ctor(new ArrayBuffer(24));', - ' }', + ' object[type.toLowerCase()] = Ctor ? new Ctor(new ArrayBuffer(24)) : undefined;', ' });', '', ' return object;', @@ -573,29 +571,27 @@ '', 'var object = {', " 'arguments': (function() { return arguments; }(1, 2, 3)),", - " 'array': [1, 2, 3],", - " 'arrayBuffer': new (root.ArrayBuffer || noop),", + " 'array': [1],", + " 'arrayBuffer': root.ArrayBuffer ? new root.ArrayBuffer : undefined,", " 'boolean': Object(false),", " 'date': new Date,", " 'errors': [new Error, new EvalError, new RangeError, new ReferenceError, new SyntaxError, new TypeError, new URIError],", " 'function': noop,", - " 'map': new (root.Map || noop),", + " 'map': root.Map ? new root.Map : undefined,", " 'nan': NaN,", " 'null': null,", " 'number': Object(0),", - " 'object': { 'a': 1, 'b': 2, 'c': 3 },", + " 'object': { 'a': 1 },", " 'regexp': /x/,", - " 'set': new (root.Set || noop),", + " 'set': root.Set ? new root.Set : undefined,", " 'string': Object('a'),", - " 'symbol': Object((root.Symbol || noop)()),", + " 'symbol': root.Symbol ? root.Symbol() : undefined,", " 'undefined': undefined", '};', '', "_.each(['" + typedArrays.join("', '") + "'], function(type) {", ' var Ctor = root[type];', - ' if (Ctor) {', - ' object[type.toLowerCase()] = new Ctor(new ArrayBuffer(24));', - ' }', + ' object[type.toLowerCase()] = Ctor ? new Ctor(new ArrayBuffer(24)) : undefined;', '});', '', '_.assign(_._realm, object);', @@ -8881,10 +8877,10 @@ assert.expect(4); if (realm.object) { - assert.strictEqual(_.isEqual([1, 2, 3], realm.array), true); - assert.strictEqual(_.isEqual([1, 2, 2], realm.array), false); - assert.strictEqual(_.isEqual({ 'a': 1, 'b': 2, 'c': 3 }, realm.object), true); - assert.strictEqual(_.isEqual({ 'a': 1, 'b': 2, 'c': 2 }, realm.object), false); + assert.strictEqual(_.isEqual([1], realm.array), true); + assert.strictEqual(_.isEqual([2], realm.array), false); + assert.strictEqual(_.isEqual({ 'a': 1 }, realm.object), true); + assert.strictEqual(_.isEqual({ 'a': 2 }, realm.object), false); } else { skipTest(assert, 4); @@ -10644,7 +10640,7 @@ props = invoke(typedArrays, 'toLowerCase'); var expected = lodashStable.map(props, function(key) { - return key in realm; + return realm[key] !== undefined; }); var actual = lodashStable.map(props, function(key) { From e00d9821a89d141e7b12f9acddda003368c6938a Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 6 Feb 2016 16:51:54 -0800 Subject: [PATCH 17/28] Add `gt`, `gte`, `lt`, `lte` to fp `skipRearg` mapping. --- fp/_mapping.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fp/_mapping.js b/fp/_mapping.js index 8b8e24b755..75f0babaa6 100644 --- a/fp/_mapping.js +++ b/fp/_mapping.js @@ -226,6 +226,10 @@ exports.skipRearg = { 'assignIn': true, 'concat': true, 'difference': true, + 'gt': true, + 'gte': true, + 'lt': true, + 'lte': true, 'matchesProperty': true, 'merge': true, 'partial': true, From 6752d75ad0cebefda27300de09d9155266a8ef84 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 6 Feb 2016 16:19:48 -0800 Subject: [PATCH 18/28] Add `_.isMap`, `_.isSet`, `_.isWeakMap`, & `_.isWeakSet`. --- lodash.js | 107 +++++++++++++++++-- test/test.js | 287 ++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 361 insertions(+), 33 deletions(-) diff --git a/lodash.js b/lodash.js index 1717bf41e8..3dfa6a60cc 100644 --- a/lodash.js +++ b/lodash.js @@ -81,7 +81,8 @@ setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; var arrayBufferTag = '[object ArrayBuffer]', float32Tag = '[object Float32Array]', @@ -1339,9 +1340,10 @@ /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; - /** Used to detect maps and sets. */ + /** Used to detect maps, sets, and weakmaps. */ var mapCtorString = Map ? funcToString.call(Map) : '', - setCtorString = Set ? funcToString.call(Set) : ''; + setCtorString = Set ? funcToString.call(Set) : '', + weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, @@ -4875,19 +4877,20 @@ return objectToString.call(value); } - // Fallback for IE 11 providing `toStringTag` values for maps and sets. - if ((Map && getTag(new Map) != mapTag) || (Set && getTag(new Set) != setTag)) { + // Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. + if ((Map && getTag(new Map) != mapTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : null, ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; if (ctorString) { - if (ctorString == mapCtorString) { - return mapTag; - } - if (ctorString == setCtorString) { - return setTag; + switch (ctorString) { + case mapCtorString: return mapTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; } } return result; @@ -9901,6 +9904,26 @@ return !!value && typeof value == 'object'; } + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + function isMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + /** * Performs a deep comparison between `object` and `source` to determine if * `object` contains equivalent property values. @@ -10186,6 +10209,26 @@ return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; } + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + function isSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + /** * Checks if `value` is classified as a `String` primitive or object. * @@ -10268,6 +10311,46 @@ return value === undefined; } + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && objectToString.call(value) == weakSetTag; + } + /** * Checks if `value` is less than `other`. * @@ -14290,6 +14373,7 @@ lodash.isFunction = isFunction; lodash.isInteger = isInteger; lodash.isLength = isLength; + lodash.isMap = isMap; lodash.isMatch = isMatch; lodash.isMatchWith = isMatchWith; lodash.isNaN = isNaN; @@ -14302,10 +14386,13 @@ lodash.isPlainObject = isPlainObject; lodash.isRegExp = isRegExp; lodash.isSafeInteger = isSafeInteger; + lodash.isSet = isSet; lodash.isString = isString; lodash.isSymbol = isSymbol; lodash.isTypedArray = isTypedArray; lodash.isUndefined = isUndefined; + lodash.isWeakMap = isWeakMap; + lodash.isWeakSet = isWeakSet; lodash.join = join; lodash.kebabCase = kebabCase; lodash.last = last; diff --git a/test/test.js b/test/test.js index 8579f34311..7fdec12e81 100644 --- a/test/test.js +++ b/test/test.js @@ -43,8 +43,6 @@ var phantom = root.phantom, amd = root.define && define.amd, argv = root.process && process.argv, - ArrayBuffer = root.ArrayBuffer, - Buffer = root.Buffer, defineProperty = Object.defineProperty, document = !phantom && root.document, body = root.document && root.document.body, @@ -53,18 +51,28 @@ freeze = Object.freeze, identity = function(value) { return value; }, JSON = root.JSON, - Map = root.Map, noop = function() {}, objToString = objectProto.toString, params = argv, push = arrayProto.push, realm = {}, + slice = arrayProto.slice; + + var ArrayBuffer = root.ArrayBuffer, + Buffer = root.Buffer, + Map = root.Map, Set = root.Set, - slice = arrayProto.slice, Symbol = root.Symbol, - symbol = Symbol ? Symbol('a') : undefined, Uint8Array = root.Uint8Array, - WeakMap = root.WeakMap; + WeakMap = root.WeakMap, + WeakSet = root.WeakSet; + + var arrayBuffer = ArrayBuffer ? new ArrayBuffer(2) : undefined, + map = Map ? new Map : undefined, + set = Set ? new Set : undefined, + symbol = Symbol ? Symbol('a') : undefined, + weakMap = WeakMap ? new WeakMap : undefined, + weakSet = WeakSet ? new WeakSet : undefined; /** Math helpers. */ var add = function(x, y) { return x + y; }, @@ -540,7 +548,9 @@ " 'set': root.Set ? new root.Set : undefined,", " 'string': Object('a'),", " 'symbol': root.Symbol ? root.Symbol() : undefined,", - " 'undefined': undefined", + " 'undefined': undefined,", + " 'weakMap': root.WeakMap ? new root.WeakMap : undefined,", + " 'weakSet': root.WeakSet ? new root.WeakSet : undefined", ' };', '', " ['" + typedArrays.join("', '") + "'].forEach(function(type) {", @@ -586,7 +596,9 @@ " 'set': root.Set ? new root.Set : undefined,", " 'string': Object('a'),", " 'symbol': root.Symbol ? root.Symbol() : undefined,", - " 'undefined': undefined", + " 'undefined': undefined,", + " 'weakMap': root.WeakMap ? new root.WeakMap : undefined,", + " 'weakSet': root.WeakSet ? new root.WeakSet : undefined", '};', '', "_.each(['" + typedArrays.join("', '") + "'], function(type) {", @@ -2503,11 +2515,9 @@ assert.expect(2); if (ArrayBuffer) { - var buffer = new ArrayBuffer(10), - actual = func(buffer); - - assert.strictEqual(actual.byteLength, buffer.byteLength); - assert.notStrictEqual(actual, buffer); + var actual = func(arrayBuffer); + assert.strictEqual(actual.byteLength, arrayBuffer.byteLength); + assert.notStrictEqual(actual, arrayBuffer); } else { skipTest(assert, 2); @@ -7896,18 +7906,18 @@ (function() { var args = arguments; - QUnit.test('should return `true` for buffers', function(assert) { + QUnit.test('should return `true` for array buffers', function(assert) { assert.expect(1); - if (Buffer) { - assert.strictEqual(_.isArrayBuffer(new ArrayBuffer(2)), true); + if (ArrayBuffer) { + assert.strictEqual(_.isArrayBuffer(arrayBuffer), true); } else { skipTest(assert); } }); - QUnit.test('should return `false` for non buffers', function(assert) { + QUnit.test('should return `false` for non array buffers', function(assert) { assert.expect(13); var expected = lodashStable.map(falsey, alwaysFalse); @@ -9432,6 +9442,62 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.isMap'); + + (function() { + var args = arguments; + + QUnit.test('should return `true` for maps', function(assert) { + assert.expect(1); + + if (Map) { + assert.strictEqual(_.isMap(map), true); + } + else { + skipTest(assert); + } + }); + + QUnit.test('should return `false` for non maps', function(assert) { + assert.expect(14); + + var expected = lodashStable.map(falsey, alwaysFalse); + + var actual = lodashStable.map(falsey, function(value, index) { + return index ? _.isMap(value) : _.isMap(); + }); + + assert.deepEqual(actual, expected); + + assert.strictEqual(_.isMap(args), false); + assert.strictEqual(_.isMap([1, 2, 3]), false); + assert.strictEqual(_.isMap(true), false); + assert.strictEqual(_.isMap(new Date), false); + assert.strictEqual(_.isMap(new Error), false); + assert.strictEqual(_.isMap(_), false); + assert.strictEqual(_.isMap(slice), false); + assert.strictEqual(_.isMap({ 'a': 1 }), false); + assert.strictEqual(_.isMap(1), false); + assert.strictEqual(_.isMap(/x/), false); + assert.strictEqual(_.isMap('a'), false); + assert.strictEqual(_.isMap(symbol), false); + assert.strictEqual(_.isMap(weakMap), false); + }); + + QUnit.test('should work with maps from another realm', function(assert) { + assert.expect(1); + + if (realm.map) { + assert.strictEqual(_.isMap(realm.map), true); + } + else { + skipTest(assert); + } + }); + }(1, 2, 3)); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.isMatch'); (function() { @@ -10480,6 +10546,62 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.isSet'); + + (function() { + var args = arguments; + + QUnit.test('should return `true` for sets', function(assert) { + assert.expect(1); + + if (Set) { + assert.strictEqual(_.isSet(set), true); + } + else { + skipTest(assert); + } + }); + + QUnit.test('should return `false` for non sets', function(assert) { + assert.expect(14); + + var expected = lodashStable.map(falsey, alwaysFalse); + + var actual = lodashStable.map(falsey, function(value, index) { + return index ? _.isSet(value) : _.isSet(); + }); + + assert.deepEqual(actual, expected); + + assert.strictEqual(_.isSet(args), false); + assert.strictEqual(_.isSet([1, 2, 3]), false); + assert.strictEqual(_.isSet(true), false); + assert.strictEqual(_.isSet(new Date), false); + assert.strictEqual(_.isSet(new Error), false); + assert.strictEqual(_.isSet(_), false); + assert.strictEqual(_.isSet(slice), false); + assert.strictEqual(_.isSet({ 'a': 1 }), false); + assert.strictEqual(_.isSet(1), false); + assert.strictEqual(_.isSet(/x/), false); + assert.strictEqual(_.isSet('a'), false); + assert.strictEqual(_.isSet(symbol), false); + assert.strictEqual(_.isSet(weakSet), false); + }); + + QUnit.test('should work with weak sets from another realm', function(assert) { + assert.expect(1); + + if (realm.set) { + assert.strictEqual(_.isSet(realm.set), true); + } + else { + skipTest(assert); + } + }); + }(1, 2, 3)); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.isString'); (function() { @@ -10717,6 +10839,118 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.isWeakMap'); + + (function() { + var args = arguments; + + QUnit.test('should return `true` for weak maps', function(assert) { + assert.expect(1); + + if (WeakMap) { + assert.strictEqual(_.isWeakMap(weakMap), true); + } + else { + skipTest(assert); + } + }); + + QUnit.test('should return `false` for non weak maps', function(assert) { + assert.expect(14); + + var expected = lodashStable.map(falsey, alwaysFalse); + + var actual = lodashStable.map(falsey, function(value, index) { + return index ? _.isWeakMap(value) : _.isWeakMap(); + }); + + assert.deepEqual(actual, expected); + + assert.strictEqual(_.isWeakMap(args), false); + assert.strictEqual(_.isWeakMap([1, 2, 3]), false); + assert.strictEqual(_.isWeakMap(true), false); + assert.strictEqual(_.isWeakMap(new Date), false); + assert.strictEqual(_.isWeakMap(new Error), false); + assert.strictEqual(_.isWeakMap(_), false); + assert.strictEqual(_.isWeakMap(slice), false); + assert.strictEqual(_.isWeakMap({ 'a': 1 }), false); + assert.strictEqual(_.isWeakMap(map), false); + assert.strictEqual(_.isWeakMap(1), false); + assert.strictEqual(_.isWeakMap(/x/), false); + assert.strictEqual(_.isWeakMap('a'), false); + assert.strictEqual(_.isWeakMap(symbol), false); + }); + + QUnit.test('should work with weak maps from another realm', function(assert) { + assert.expect(1); + + if (realm.weakMap) { + assert.strictEqual(_.isWeakMap(realm.weakMap), true); + } + else { + skipTest(assert); + } + }); + }(1, 2, 3)); + + /*--------------------------------------------------------------------------*/ + + QUnit.module('lodash.isWeakSet'); + + (function() { + var args = arguments; + + QUnit.test('should return `true` for weak sets', function(assert) { + assert.expect(1); + + if (WeakSet) { + assert.strictEqual(_.isWeakSet(weakSet), true); + } + else { + skipTest(assert); + } + }); + + QUnit.test('should return `false` for non weak sets', function(assert) { + assert.expect(14); + + var expected = lodashStable.map(falsey, alwaysFalse); + + var actual = lodashStable.map(falsey, function(value, index) { + return index ? _.isWeakSet(value) : _.isWeakSet(); + }); + + assert.deepEqual(actual, expected); + + assert.strictEqual(_.isWeakSet(args), false); + assert.strictEqual(_.isWeakSet([1, 2, 3]), false); + assert.strictEqual(_.isWeakSet(true), false); + assert.strictEqual(_.isWeakSet(new Date), false); + assert.strictEqual(_.isWeakSet(new Error), false); + assert.strictEqual(_.isWeakSet(_), false); + assert.strictEqual(_.isWeakSet(slice), false); + assert.strictEqual(_.isWeakSet({ 'a': 1 }), false); + assert.strictEqual(_.isWeakSet(1), false); + assert.strictEqual(_.isWeakSet(/x/), false); + assert.strictEqual(_.isWeakSet('a'), false); + assert.strictEqual(_.isWeakSet(set), false); + assert.strictEqual(_.isWeakSet(symbol), false); + }); + + QUnit.test('should work with weak sets from another realm', function(assert) { + assert.expect(1); + + if (realm.weakSet) { + assert.strictEqual(_.isWeakSet(realm.weakSet), true); + } + else { + skipTest(assert); + } + }); + }(1, 2, 3)); + + /*--------------------------------------------------------------------------*/ + QUnit.module('isType checks'); (function() { @@ -10742,13 +10976,14 @@ }); QUnit.test('should not error on host objects (test in IE)', function(assert) { - assert.expect(20); + assert.expect(26); var funcs = [ - 'isArguments', 'isArray', 'isArrayLike', 'isBoolean', 'isDate', - 'isElement', 'isError', 'isFinite', 'isFunction', 'isInteger', 'isNaN', - 'isNil', 'isNull', 'isNumber', 'isObject', 'isObjectLike', 'isRegExp', - 'isSafeInteger', 'isString', 'isUndefined' + 'isArguments', 'isArray', 'isArrayBuffer', 'isArrayLike', 'isBoolean', + 'isBuffer', 'isDate', 'isElement', 'isError', 'isFinite', 'isFunction', + 'isInteger', 'isMap', 'isNaN', 'isNil', 'isNull', 'isNumber', 'isObject', + 'isObjectLike', 'isRegExp', 'isSet', 'isSafeInteger', 'isString', + 'isUndefined', 'isWeakMap', 'isWeakSet' ]; lodashStable.each(funcs, function(methodName) { @@ -23410,8 +23645,10 @@ 'includes', 'isArguments', 'isArray', + 'isArrayBuffer', 'isArrayLike', 'isBoolean', + 'isBuffer', 'isDate', 'isElement', 'isEmpty', @@ -23420,6 +23657,7 @@ 'isFinite', 'isFunction', 'isInteger', + 'isMap', 'isNaN', 'isNative', 'isNil', @@ -23430,8 +23668,11 @@ 'isPlainObject', 'isRegExp', 'isSafeInteger', + 'isSet', 'isString', 'isUndefined', + 'isWeakMap', + 'isWeakSet', 'join', 'kebabCase', 'last', @@ -23721,7 +23962,7 @@ var acceptFalsey = lodashStable.difference(allMethods, rejectFalsey); QUnit.test('should accept falsey arguments', function(assert) { - assert.expect(291); + assert.expect(295); var emptyArrays = lodashStable.map(falsey, alwaysEmptyArray); From e392b8e240840ac0d95a2d091ee17248b7e92b38 Mon Sep 17 00:00:00 2001 From: Corbacho Date: Sat, 6 Feb 2016 22:19:11 +0000 Subject: [PATCH 19/28] Improve accuracy of _.throttle. --- lodash.js | 2 +- test/test.js | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 3dfa6a60cc..d8717e6fc1 100644 --- a/lodash.js +++ b/lodash.js @@ -8652,7 +8652,7 @@ if (maxWait === false) { var leadingCall = leading && !timeoutId; } else { - if (!maxTimeoutId && !leading) { + if (!lastCalled && !maxTimeoutId && !leading) { lastCalled = stamp; } var remaining = maxWait - (stamp - lastCalled), diff --git a/test/test.js b/test/test.js index 7fdec12e81..36bbc52248 100644 --- a/test/test.js +++ b/test/test.js @@ -20635,6 +20635,30 @@ }); }); + QUnit.test('should trigger a second throttled call as early as possible when invoked repeatedly', function(assert) { + assert.expect(2); + + var done = assert.async(); + + var callCount = 0; + + var throttled = _.throttle(function() { + callCount++; + }, 128, { 'leading': false }); + + throttled(); + + setTimeout(function() { + assert.strictEqual(callCount, 1); + throttled(); + }, 192); + + setTimeout(function() { + assert.strictEqual(callCount, 2); + done(); + }, 288); + }); + QUnit.test('should apply default options', function(assert) { assert.expect(3); From 404a7181a8b3d5db0849becefb413e579e0f190e Mon Sep 17 00:00:00 2001 From: "Robert T. Stewart" Date: Sun, 7 Feb 2016 14:20:46 -0500 Subject: [PATCH 20/28] Add 'What is Lodash' section to README.md. [ci skip] --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 859522aa8a..61f3f6c1f3 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,15 @@ $ lodash -o ./dist/lodash.js $ lodash core -o ./dist/lodash.core.js ``` +## What is Lodash + +Lodash makes JavaScript easier by taking the hassle out of working with arrays,
+numbers, objects, strings, etc. Lodash’s modular methods can be used for: + +* Iterating arrays, objects, & strings +* Manipulating & testing values +* Creating composite functions + ## Community [![Gitter](https://badges.gitter.im/lodash/lodash.svg)](https://gitter.im/lodash/lodash) From d5a6a75639b05f52d01e534838ffc2ea5e2f0d03 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 7 Feb 2016 16:37:30 -0800 Subject: [PATCH 21/28] Clarify pull request notes in contributing.md. [ci skip] --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a4b7ddda1b..7277cca3b6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,8 +3,9 @@ Contributions are always welcome. Before contributing, please read the [code of conduct](https://github.com/lodash/lodash/blob/master/CODE_OF_CONDUCT.md) & [search the issue tracker](https://github.com/lodash/lodash/issues); your issue may have already been discussed or fixed in `master`. To contribute, [fork](https://help.github.com/articles/fork-a-repo/) lodash, commit your changes, & [send a pull request](https://help.github.com/articles/using-pull-requests/). -## Tests +## Pull Requests +For additions or bug fixes you should only need to modify `lodash.js`. Include updated unit tests in the `test` directory as part of your pull request. Don’t worry about regenerating the `dist/` or `doc/` files. From db23fcfe9fddadc691c551448dec008e36fb6d57 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 7 Feb 2016 21:33:49 -0800 Subject: [PATCH 22/28] Rename `num` params to `n`. --- test/test.js | 105 +++++++++++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 49 deletions(-) diff --git a/test/test.js b/test/test.js index 36bbc52248..94acc3d497 100644 --- a/test/test.js +++ b/test/test.js @@ -3285,8 +3285,8 @@ QUnit.test('should only add values to own, not inherited, properties', function(assert) { assert.expect(2); - var actual = _.countBy(array, function(num) { - return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; + var actual = _.countBy(array, function(n) { + return Math.floor(n) > 4 ? 'hasOwnProperty' : 'constructor'; }); assert.deepEqual(actual.constructor, 1); @@ -3309,10 +3309,7 @@ QUnit.test('should work with an object for `collection`', function(assert) { assert.expect(1); - var actual = _.countBy({ 'a': 6.1, 'b': 4.2, 'c': 6.3 }, function(num) { - return Math.floor(num); - }); - + var actual = _.countBy({ 'a': 6.1, 'b': 4.2, 'c': 6.3 }, Math.floor); assert.deepEqual(actual, { '4': 1, '6': 2 }); }); @@ -4599,8 +4596,8 @@ QUnit.test('should drop elements while `predicate` returns truthy', function(assert) { assert.expect(1); - var actual = _.dropRightWhile(array, function(num) { - return num > 2; + var actual = _.dropRightWhile(array, function(n) { + return n > 2; }); assert.deepEqual(actual, [1, 2]); @@ -4640,8 +4637,8 @@ assert.expect(2); if (!isNpm) { - var wrapped = _(array).dropRightWhile(function(num) { - return num > 2; + var wrapped = _(array).dropRightWhile(function(n) { + return n > 2; }); assert.ok(wrapped instanceof _); @@ -4669,8 +4666,8 @@ QUnit.test('should drop elements while `predicate` returns truthy', function(assert) { assert.expect(1); - var actual = _.dropWhile(array, function(num) { - return num < 3; + var actual = _.dropWhile(array, function(n) { + return n < 3; }); assert.deepEqual(actual, [3, 4]); @@ -4711,7 +4708,7 @@ if (!isNpm) { var array = lodashStable.range(1, LARGE_ARRAY_SIZE + 3), - predicate = function(num) { return num < 3; }, + predicate = function(n) { return n < 3; }, expected = _.dropWhile(array, predicate), wrapped = _(array).dropWhile(predicate); @@ -4731,9 +4728,9 @@ var array = lodashStable.range(1, LARGE_ARRAY_SIZE + 3); var actual = _(array) - .dropWhile(function(num) { return num == 1; }) + .dropWhile(function(n) { return n == 1; }) .drop() - .dropWhile(function(num) { return num == 3; }) + .dropWhile(function(n) { return n == 3; }) .value(); assert.deepEqual(actual, array.slice(3)); @@ -5375,8 +5372,8 @@ QUnit.test('should work with an object for `collection`', function(assert) { assert.expect(1); - var actual = func({ 'a': 1, 'b': 2, 'c': 3 }, function(num) { - return num < 3; + var actual = func({ 'a': 1, 'b': 2, 'c': 3 }, function(n) { + return n < 3; }); assert.strictEqual(actual, expected); @@ -6616,8 +6613,8 @@ QUnit.test('should only add values to own, not inherited, properties', function(assert) { assert.expect(2); - var actual = _.groupBy(array, function(num) { - return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; + var actual = _.groupBy(array, function(n) { + return Math.floor(n) > 4 ? 'hasOwnProperty' : 'constructor'; }); assert.deepEqual(actual.constructor, [4.2]); @@ -11799,8 +11796,8 @@ QUnit.test('should only add values to own, not inherited, properties', function(assert) { assert.expect(2); - var actual = _.keyBy([6.1, 4.2, 6.3], function(num) { - return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; + var actual = _.keyBy([6.1, 4.2, 6.3], function(n) { + return Math.floor(n) > 4 ? 'hasOwnProperty' : 'constructor'; }); assert.deepEqual(actual.constructor, 4.2); @@ -14423,8 +14420,8 @@ QUnit.test('`_.' + methodName + '` should work with an `iteratee` argument', function(assert) { assert.expect(1); - var actual = func(array, function(num) { - return -num; + var actual = func(array, function(n) { + return -n; }); assert.strictEqual(actual, isMax ? 1 : 3); @@ -15039,8 +15036,8 @@ var object = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }; - var actual = _.omitBy(object, function(num) { - return num != 2 && num != 4; + var actual = _.omitBy(object, function(n) { + return n != 2 && n != 4; }); assert.deepEqual(actual, { 'b': 2, 'd': 4 }); @@ -16073,8 +16070,8 @@ var object = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }; - var actual = _.pickBy(object, function(num) { - return num == 1 || num == 3; + var actual = _.pickBy(object, function(n) { + return n == 1 || n == 3; }); assert.deepEqual(actual, { 'a': 1, 'c': 3 }); @@ -17139,7 +17136,7 @@ QUnit.test('`_.' + methodName + '` should not modify the resulting value from within `predicate`', function(assert) { assert.expect(1); - var actual = func([0], function(num, index, array) { + var actual = func([0], function(value, index, array) { array[index] = 1; return isFilter; }); @@ -17165,14 +17162,14 @@ if (!isNpm) { var wrapped = _(array); - var actual = wrapped[methodName](function(num) { - return num < 3; + var actual = wrapped[methodName](function(n) { + return n < 3; }); assert.deepEqual(actual.value(), isFilter ? [1, 2] : [3, 4]); - actual = wrapped[methodName](function(num) { - return num > 2; + actual = wrapped[methodName](function(n) { + return n > 2; }); assert.deepEqual(actual.value(), isFilter ? [3, 4] : [1, 2]); @@ -17260,14 +17257,14 @@ QUnit.test('should modify the array and return removed elements', function(assert) { assert.expect(2); - var array = [1, 2, 3]; + var array = [1, 2, 3, 4]; - var actual = _.remove(array, function(num) { - return num < 3; + var actual = _.remove(array, function(n) { + return n % 2 == 0; }); - assert.deepEqual(array, [3]); - assert.deepEqual(actual, [1, 2]); + assert.deepEqual(array, [1, 3]); + assert.deepEqual(actual, [2, 4]); }); QUnit.test('should provide the correct `predicate` arguments', function(assert) { @@ -17277,7 +17274,7 @@ array = [1, 2, 3], clone = array.slice(); - _.remove(array, function(value, index) { + _.remove(array, function(n, index) { var args = slice.call(arguments); args[2] = args[2].slice(); argsList.push(args); @@ -17318,7 +17315,10 @@ delete array[1]; delete array[3]; - _.remove(array, function(num) { return num === 1; }); + _.remove(array, function(n) { + return n === 1; + }); + assert.notOk('0' in array); assert.notOk('2' in array); }); @@ -17329,7 +17329,10 @@ var array = [1, 2, 3]; delete array[1]; - _.remove(array, function(num) { return num == null; }); + _.remove(array, function(n) { + return n == null; + }); + assert.deepEqual(array, [1, 3]); }); @@ -17337,7 +17340,11 @@ assert.expect(1); var array = [1, 2, 3]; - _.remove(array, function(num, index) { return isEven(index); }); + + _.remove(array, function(n, index) { + return isEven(index); + }); + assert.deepEqual(array, [2]); }); }()); @@ -19586,8 +19593,8 @@ QUnit.test('should take elements while `predicate` returns truthy', function(assert) { assert.expect(1); - var actual = _.takeRightWhile(array, function(num) { - return num > 2; + var actual = _.takeRightWhile(array, function(n) { + return n > 2; }); assert.deepEqual(actual, [3, 4]); @@ -19628,7 +19635,7 @@ if (!isNpm) { var array = lodashStable.range(LARGE_ARRAY_SIZE), - predicate = function(num) { return num > 2; }, + predicate = function(n) { return n > 2; }, expected = _.takeRightWhile(array, predicate), wrapped = _(array).takeRightWhile(predicate); @@ -19701,8 +19708,8 @@ QUnit.test('should take elements while `predicate` returns truthy', function(assert) { assert.expect(1); - var actual = _.takeWhile(array, function(num) { - return num < 3; + var actual = _.takeWhile(array, function(n) { + return n < 3; }); assert.deepEqual(actual, [1, 2]); @@ -19742,7 +19749,7 @@ if (!isNpm) { var array = lodashStable.range(LARGE_ARRAY_SIZE), - predicate = function(num) { return num < 3; }, + predicate = function(n) { return n < 3; }, expected = _.takeWhile(array, predicate), wrapped = _(array).takeWhile(predicate); @@ -19762,9 +19769,9 @@ var array = lodashStable.range(LARGE_ARRAY_SIZE); var actual = _(array) - .takeWhile(function(num) { return num < 4; }) + .takeWhile(function(n) { return n < 4; }) .take(2) - .takeWhile(function(num) { return num == 0; }) + .takeWhile(function(n) { return n == 0; }) .value(); assert.deepEqual(actual, [0]); From 349c627110b25643c307a5e9650f1a0b82b29581 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 7 Feb 2016 20:17:00 -0800 Subject: [PATCH 23/28] Add options to `baseConvert`. --- fp/_baseConvert.js | 66 +++++++++++++++++-------- fp/_convertBrowser.js | 5 +- lib/fp/template/convert.jst | 5 +- test/test-fp.js | 99 ++++++++++++++++++++++++++++++++++++- 4 files changed, 149 insertions(+), 26 deletions(-) diff --git a/fp/_baseConvert.js b/fp/_baseConvert.js index 2af63a7f00..76cc02ce86 100644 --- a/fp/_baseConvert.js +++ b/fp/_baseConvert.js @@ -9,9 +9,17 @@ var mapping = require('./_mapping'), * @param {Object} util The util object. * @param {string} name The name of the function to wrap. * @param {Function} func The function to wrap. + * @param {Object} [options] The options object. + * @param {boolean} [options.cap=true] Specify capping iteratee arguments. + * @param {boolean} [options.curry=true] Specify currying. + * @param {boolean} [options.fixed=true] Specify fixed arity. + * @param {boolean} [options.immutable=true] Specify immutable operations. + * @param {boolean} [options.rearg=true] Specify rearranging arguments. * @returns {Function|Object} Returns the converted function or object. */ -function baseConvert(util, name, func) { +function baseConvert(util, name, func, options) { + options || (options = {}); + if (typeof func != 'function') { func = name; name = undefined; @@ -19,6 +27,16 @@ function baseConvert(util, name, func) { if (func == null) { throw new TypeError; } + var config = { + 'cap': 'cap' in options ? options.cap : true, + 'curry': 'curry' in options ? options.curry : true, + 'fixed': 'fixed' in options ? options.fixed : true, + 'immutable': 'immutable' in options ? options.immutable : true, + 'rearg': 'rearg' in options ? options.rearg : true + }; + + var forceRearg = ('rearg' in options) && options.rearg; + var isLib = name === undefined && typeof func.VERSION == 'string'; var _ = isLib ? func : { @@ -107,6 +125,9 @@ function baseConvert(util, name, func) { var func = arguments[0], arity = arguments[1]; + if (!config.cap) { + return iteratee(func, arity); + } arity = arity > 2 ? (arity - 2) : 1; func = iteratee(func); var length = func.length; @@ -145,7 +166,7 @@ function baseConvert(util, name, func) { }, 'runInContext': function(runInContext) { return function(context) { - return baseConvert(util, runInContext(context)); + return baseConvert(util, runInContext(context), undefined, options); }; } }; @@ -157,14 +178,16 @@ function baseConvert(util, name, func) { return wrapper(func); } var wrapped = func; - if (mutateMap.array[name]) { - wrapped = immutWrap(func, cloneArray); - } - else if (mutateMap.object[name]) { - wrapped = immutWrap(func, createCloner(func)); - } - else if (mutateMap.set[name]) { - wrapped = immutWrap(func, cloneDeep); + if (config.immutable) { + if (mutateMap.array[name]) { + wrapped = immutWrap(func, cloneArray); + } + else if (mutateMap.object[name]) { + wrapped = immutWrap(func, createCloner(func)); + } + else if (mutateMap.set[name]) { + wrapped = immutWrap(func, cloneDeep); + } } var result; each(mapping.caps, function(cap) { @@ -174,19 +197,22 @@ function baseConvert(util, name, func) { reargIndexes = mapping.iterateeRearg[name], spreadStart = mapping.methodSpread[name]; - result = spreadStart === undefined - ? ary(wrapped, cap) - : spread(wrapped, spreadStart); - - if (cap > 1 && !mapping.skipRearg[name]) { + if (config.fixed) { + result = spreadStart === undefined + ? ary(wrapped, cap) + : spread(wrapped, spreadStart); + } + if (config.rearg && cap > 1 && (forceRearg || !mapping.skipRearg[name])) { result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[cap]); } - if (reargIndexes) { - result = iterateeRearg(result, reargIndexes); - } else if (aryN) { - result = iterateeAry(result, aryN); + if (config.cap) { + if (reargIndexes) { + result = iterateeRearg(result, reargIndexes); + } else if (aryN) { + result = iterateeAry(result, aryN); + } } - if (cap > 1) { + if (config.curry && cap > 1) { result = curry(result, cap); } return false; diff --git a/fp/_convertBrowser.js b/fp/_convertBrowser.js index b076778a4a..0e69e66cda 100644 --- a/fp/_convertBrowser.js +++ b/fp/_convertBrowser.js @@ -4,10 +4,11 @@ var baseConvert = require('./_baseConvert'); * Converts `lodash` to an immutable auto-curried iteratee-first data-last version. * * @param {Function} lodash The lodash function. + * @param {Object} [options] The options object. See `baseConvert` for more details. * @returns {Function} Returns the converted `lodash`. */ -function browserConvert(lodash) { - return baseConvert(lodash, lodash); +function browserConvert(lodash, options) { + return baseConvert(lodash, lodash, undefined, options); } module.exports = browserConvert; diff --git a/lib/fp/template/convert.jst b/lib/fp/template/convert.jst index 85f3b7535e..a1d266fa64 100644 --- a/lib/fp/template/convert.jst +++ b/lib/fp/template/convert.jst @@ -7,10 +7,11 @@ var baseConvert = require('./_baseConvert'), * * @param {string} name The name of the function to wrap. * @param {Function} [func] The function to wrap. + * @param {Object} [options] The options object. See `baseConvert` for more details. * @returns {Function|Object} Returns the converted function or object. */ -function convert(name, func) { - return baseConvert(util, name, func); +function convert(name, func, options) { + return baseConvert(util, name, func, options); } module.exports = convert; diff --git a/test/test-fp.js b/test/test-fp.js index 1a5b04f1ac..a10343e144 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -46,8 +46,8 @@ var convert = root.fp || (function() { var baseConvert = load('../fp/_baseConvert.js'); - return function(name, func) { - return baseConvert(_, name, func); + return function(name, func, options) { + return baseConvert(_, name, func, options); }; }()); @@ -76,6 +76,101 @@ console.log('Running lodash/fp tests.'); } + QUnit.module('convert'); + + (function() { + QUnit.test('should accept an `options` argument', function(assert) { + assert.expect(3); + + if (!document) { + var remove = convert('remove', _.remove, { + 'cap': false, + 'curry': false, + 'fixed': false, + 'immutable': false, + 'rearg': false + }); + + var array = [1, 2, 3, 4]; + + var actual = remove(array, function(n) { + return n % 2 == 0; + }); + + assert.deepEqual(array, [1, 3]); + assert.deepEqual(actual, [2, 4]); + assert.deepEqual(remove(), []); + } + else { + skipTest(assert, 3); + } + }); + + QUnit.test('should respect the `cap` option', function(assert) { + assert.expect(1); + + if (!document) { + var iteratee = convert('iteratee', _.iteratee, { + 'cap': false + }); + + var func = iteratee(function(a, b, c) { + return [a, b, c]; + }, 3); + + assert.deepEqual(func(1, 2, 3), [1, 2, 3]); + } + else { + skipTest(assert); + } + }); + + QUnit.test('should respect the `rearg` option', function(assert) { + assert.expect(1); + + if (!document) { + var add = convert('add', _.add, { + 'rearg': true + }); + + assert.strictEqual(add('2')('1'), '12'); + } + else { + skipTest(assert); + } + }); + + QUnit.test('should use `options` in `runInContext`', function(assert) { + assert.expect(3); + + if (!document) { + var runInContext = convert('runInContext', _.runInContext, { + 'cap': false, + 'curry': false, + 'fixed': false, + 'immutable': false, + 'rearg': false + }); + + var array = [1, 2, 3, 4], + lodash = runInContext(); + + var actual = lodash.remove(array, function(n) { + return n % 2 == 0; + }); + + assert.deepEqual(array, [1, 3]); + assert.deepEqual(actual, [2, 4]); + assert.deepEqual(lodash.remove(), []); + } + else { + skipTest(assert, 3); + } + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('method arity checks'); (function() { From d790a1b3c674ead1d6242a67d9315d8691807e0c Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 7 Feb 2016 22:41:07 -0800 Subject: [PATCH 24/28] Adjust "provided"/"given" use. [ci skip] --- lodash.js | 40 ++++++++++++++++++++-------------------- test/test.js | 50 +++++++++++++++++++++++++------------------------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/lodash.js b/lodash.js index d8717e6fc1..a39806c39e 100644 --- a/lodash.js +++ b/lodash.js @@ -2341,7 +2341,7 @@ * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. - * @param {Object} args The arguments provide to `func`. + * @param {Object} args The arguments to provide to `func`. * @returns {number} Returns the timer id. */ function baseDelay(func, wait, args) { @@ -2586,7 +2586,7 @@ /** * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from those provided. + * `object` function property names filtered from `props`. * * @private * @param {Object} object The object to inspect. @@ -5051,7 +5051,7 @@ } /** - * Checks if the provided arguments are from an iteratee call. + * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. @@ -5459,7 +5459,7 @@ /** * 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) + * given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. * * @static @@ -5939,8 +5939,8 @@ } /** - * 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) + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. * * @static @@ -6105,7 +6105,7 @@ } /** - * Removes all provided values from `array` using + * Removes all given values from `array` using * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. * @@ -6662,8 +6662,8 @@ } /** - * 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) + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. * * @static @@ -6874,7 +6874,7 @@ } /** - * Creates an array excluding all provided values using + * Creates an array excluding all given values using * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. * @@ -6897,7 +6897,7 @@ /** * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the provided arrays. + * of the given arrays. * * @static * @memberOf _ @@ -7923,7 +7923,7 @@ * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` through `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` - * is not provided the first element of `collection` is used as the initial + * is not given the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * @@ -10785,7 +10785,7 @@ /** * 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. + * object is given its own enumerable properties are assigned to the created object. * * @static * @memberOf _ @@ -12551,7 +12551,7 @@ * in "interpolate" delimiters, HTML-escape interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * properties may be accessed as free variables in the template. If a setting - * object is provided it takes precedence over `_.templateSettings` values. + * object is given it takes precedence over `_.templateSettings` values. * * **Note:** In the development build `_.template` utilizes * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) @@ -13229,9 +13229,9 @@ } /** - * Creates a function that returns the result of invoking the provided - * functions with the `this` binding of the created function, where each - * successive invocation is supplied the return value of the previous. + * Creates a function that returns the result of invoking the given functions + * with the `this` binding of the created function, where each successive + * invocation is supplied the return value of the previous. * * @static * @memberOf _ @@ -13252,7 +13252,7 @@ /** * This method is like `_.flow` except that it creates a function that - * invokes the provided functions from right to left. + * invokes the given functions from right to left. * * @static * @memberOf _ @@ -13272,7 +13272,7 @@ var flowRight = createFlow(true); /** - * This method returns the first argument provided to it. + * This method returns the first argument given to it. * * @static * @memberOf _ @@ -13824,7 +13824,7 @@ } /** - * Generates a unique ID. If `prefix` is provided the ID is appended to it. + * Generates a unique ID. If `prefix` is given the ID is appended to it. * * @static * @memberOf _ diff --git a/test/test.js b/test/test.js index 94acc3d497..5823993453 100644 --- a/test/test.js +++ b/test/test.js @@ -948,7 +948,7 @@ } }); - QUnit.test('should return provided `lodash` instances', function(assert) { + QUnit.test('should return the given `lodash` instances', function(assert) { assert.expect(1); if (!isNpm) { @@ -1092,7 +1092,7 @@ assert.deepEqual(capped('a', 'b', 'c', 'd'), ['a', 'b']); }); - QUnit.test('should use `func.length` if `n` is not provided', function(assert) { + QUnit.test('should use `func.length` if `n` is not given', function(assert) { assert.expect(1); var capped = _.ary(fn); @@ -1125,7 +1125,7 @@ assert.deepEqual(actual, expected); }); - QUnit.test('should work when provided less than the capped number of arguments', function(assert) { + QUnit.test('should work when given less than the capped number of arguments', function(assert) { assert.expect(1); var capped = _.ary(fn, 3); @@ -1334,7 +1334,7 @@ assert.deepEqual(actual, expected); }); - QUnit.test('should return an empty array when no keys are provided', function(assert) { + QUnit.test('should return an empty array when no keys are given', function(assert) { assert.expect(2); assert.deepEqual(_.at(array), []); @@ -1348,7 +1348,7 @@ assert.deepEqual(actual, ['d', 'a', 'c']); }); - QUnit.test('should work with a falsey `object` argument when keys are provided', function(assert) { + QUnit.test('should work with a falsey `object` argument when keys are given', function(assert) { assert.expect(1); var expected = lodashStable.map(falsey, lodashStable.constant(Array(4))); @@ -3433,7 +3433,7 @@ return slice.call(arguments); } - QUnit.test('should curry based on the number of arguments provided', function(assert) { + QUnit.test('should curry based on the number of arguments given', function(assert) { assert.expect(3); var curried = _.curry(fn), @@ -3565,7 +3565,7 @@ return slice.call(arguments); } - QUnit.test('should curry based on the number of arguments provided', function(assert) { + QUnit.test('should curry based on the number of arguments given', function(assert) { assert.expect(3); var curried = _.curryRight(fn), @@ -5037,7 +5037,7 @@ assert.deepEqual(_.fill(array, 'a'), ['a', 'a', 'a']); }); - QUnit.test('should use `undefined` for `value` if not provided', function(assert) { + QUnit.test('should use `undefined` for `value` if not given', function(assert) { assert.expect(2); var array = [1, 2, 3], @@ -5666,7 +5666,7 @@ assert.notStrictEqual(func(noop), noop); }); - QUnit.test('`_.' + methodName + '` should return an identity function when no arguments are provided', function(assert) { + QUnit.test('`_.' + methodName + '` should return an identity function when no arguments are given', function(assert) { assert.expect(3); var combined = func(); @@ -6968,7 +6968,7 @@ QUnit.module('lodash.identity'); (function() { - QUnit.test('should return the first argument provided', function(assert) { + QUnit.test('should return the first argument given', function(assert) { assert.expect(1); var object = { 'name': 'fred' }; @@ -13377,7 +13377,7 @@ QUnit.module('lodash.memoize'); (function() { - QUnit.test('should memoize results based on the first argument provided', function(assert) { + QUnit.test('should memoize results based on the first argument given', function(assert) { assert.expect(2); var memoized = _.memoize(function(a, b, c) { @@ -14587,7 +14587,7 @@ assert.expect(8); function message(func, chain) { - return (func === _ ? 'lodash' : 'provided') + ' function should ' + (chain ? '' : 'not ') + 'chain'; + return (func === _ ? 'lodash' : 'given') + ' function should ' + (chain ? '' : 'not ') + 'chain'; } lodashStable.each([_, Wrapper], function(func) { @@ -14620,7 +14620,7 @@ }); }); - QUnit.test('should not extend lodash when an `object` is provided with an empty `options` object', function(assert) { + QUnit.test('should not extend lodash when an `object` is given with an empty `options` object', function(assert) { assert.expect(1); _.mixin({ 'a': noop }, {}); @@ -14785,7 +14785,7 @@ assert.deepEqual(over(5, 10, 18), [10, 100, 18]); }); - QUnit.test('should not transform any arguments if no transforms are provided', function(assert) { + QUnit.test('should not transform any arguments if no transforms are given', function(assert) { assert.expect(1); var over = _.overArgs(fn); @@ -16521,7 +16521,7 @@ assert.deepEqual(array, ['b']); }); - QUnit.test('should return an empty array when no indexes are provided', function(assert) { + QUnit.test('should return an empty array when no indexes are given', function(assert) { assert.expect(4); var array = ['a', 'b', 'c'], @@ -16576,7 +16576,7 @@ assert.deepEqual(actual, [undefined]); }); - QUnit.test('should work with a falsey `array` argument when keys are provided', function(assert) { + QUnit.test('should work with a falsey `array` argument when keys are given', function(assert) { assert.expect(1); var values = falsey.slice(), @@ -16599,7 +16599,7 @@ (function() { var array = Array(1000); - QUnit.test('should return `0` or `1` when arguments are not provided', function(assert) { + QUnit.test('should return `0` or `1` when no arguments are given', function(assert) { assert.expect(1); var actual = lodashStable.map(array, function() { @@ -16721,14 +16721,14 @@ return isRange ? range : range.reverse(); } - QUnit.test('`_.' + methodName + '` should infer the sign of `step` when provided only an `end` argument', function(assert) { + QUnit.test('`_.' + methodName + '` should infer the sign of `step` when only `end` is given', function(assert) { assert.expect(2); assert.deepEqual(func(4), resolve([0, 1, 2, 3])); assert.deepEqual(func(-4), resolve([0, -1, -2, -3])); }); - QUnit.test('`_.' + methodName + '` should infer the sign of `step` when provided only a `start` and `end` argument', function(assert) { + QUnit.test('`_.' + methodName + '` should infer the sign of `step` when only `start` and `end` are given', function(assert) { assert.expect(2); assert.deepEqual(func(1, 5), resolve([1, 2, 3, 4])); @@ -16850,7 +16850,7 @@ assert.deepEqual(actual, expected); }); - QUnit.test('should not rearrange arguments when no indexes are provided', function(assert) { + QUnit.test('should not rearrange arguments when no indexes are given', function(assert) { assert.expect(2); var rearged = _.rearg(fn); @@ -17070,7 +17070,7 @@ assert.strictEqual(actual, undefined); }); - QUnit.test('`_.' + methodName + '` should return `undefined` for empty collections when no `accumulator` is provided (test in IE > 9 and modern browsers)', function(assert) { + QUnit.test('`_.' + methodName + '` should return `undefined` for empty collections when no `accumulator` is given (test in IE > 9 and modern browsers)', function(assert) { assert.expect(2); var array = [], @@ -20336,7 +20336,7 @@ assert.deepEqual(options, {}); }); - QUnit.test('should not modify `_.templateSettings` when `options` are provided', function(assert) { + QUnit.test('should not modify `_.templateSettings` when `options` are given', function(assert) { assert.expect(2); var data = { 'a': 1 }; @@ -21770,7 +21770,7 @@ Foo.prototype.constructor = Foo; }); - QUnit.test('should create an empty object when provided a falsey `object` argument', function(assert) { + QUnit.test('should create an empty object when given a falsey `object` argument', function(assert) { assert.expect(1); var expected = lodashStable.map(falsey, alwaysEmptyObject); @@ -22899,7 +22899,7 @@ assert.deepEqual(actual, [1]); }); - QUnit.test('`_.' + methodName + '` should return a new array when a single array is provided', function(assert) { + QUnit.test('`_.' + methodName + '` should return a new array when a single array is given', function(assert) { assert.expect(1); var array = [1]; @@ -24052,7 +24052,7 @@ assert.ok(lodashStable.isArray(actual), '_.' + methodName + ' returns an array'); var isPull = methodName == 'pull' || methodName == 'pullAll'; - assert.strictEqual(actual === array, isPull, '_.' + methodName + ' should ' + (isPull ? '' : 'not ') + 'return the provided array'); + assert.strictEqual(actual === array, isPull, '_.' + methodName + ' should ' + (isPull ? '' : 'not ') + 'return the given array'); }); }); From 18ae1d7c184aa27e50ee3e70a95ca25bbd9c0e01 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 7 Feb 2016 22:43:13 -0800 Subject: [PATCH 25/28] Ensure `_.add` and `_.subtract` return `0` when no arguments are given. --- lodash.js | 6 ++++++ test/test.js | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lodash.js b/lodash.js index a39806c39e..c303a62b94 100644 --- a/lodash.js +++ b/lodash.js @@ -13862,6 +13862,9 @@ */ function add(augend, addend) { var result; + if (augend === undefined && addend === undefined) { + return 0; + } if (augend !== undefined) { result = augend; } @@ -14072,6 +14075,9 @@ */ function subtract(minuend, subtrahend) { var result; + if (minuend === undefined && subtrahend === undefined) { + return 0; + } if (minuend !== undefined) { result = minuend; } diff --git a/test/test.js b/test/test.js index 5823993453..d5979338eb 100644 --- a/test/test.js +++ b/test/test.js @@ -997,6 +997,12 @@ assert.strictEqual(_.add(-6, -4), -10); }); + QUnit.test('should return `0` when no arguments are given', function(assert) { + assert.expect(1); + + assert.strictEqual(_.add(), 0); + }); + QUnit.test('should not coerce arguments to numbers', function(assert) { assert.expect(2); @@ -19196,6 +19202,12 @@ assert.strictEqual(_.subtract(-6, -4), -2); }); + QUnit.test('should return `0` when no arguments are given', function(assert) { + assert.expect(1); + + assert.strictEqual(_.subtract(), 0); + }); + QUnit.test('should coerce arguments only numbers', function(assert) { assert.expect(2); From dc65792776cf21e88ddc09f663399bd9b91c0c66 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 8 Feb 2016 00:16:31 -0800 Subject: [PATCH 26/28] Add fp tests for `add`, `subtract`, `gt`, `gte`, `lt`, & `lte`. --- test/test-fp.js | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/test/test-fp.js b/test/test-fp.js index a10343e144..9449bd0b0e 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -690,6 +690,21 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('fp.add and fp.subtract'); + + _.each(['add', 'subtract'], function(methodName) { + var func = fp[methodName], + isAdd = methodName == 'add'; + + QUnit.test('`fp.' + methodName + '` should have `rearg` applied', function(assert) { + assert.expect(1); + + assert.strictEqual(func('1')('2'), isAdd ? '12' : -1); + }); + }); + + /*--------------------------------------------------------------------------*/ + QUnit.module('fp.curry and fp.curryRight'); _.each(['curry', 'curryRight'], function(methodName) { @@ -773,7 +788,7 @@ QUnit.module('fp.flow and fp.flowRight'); - _.each(['flow', 'flowRight'], function(methodName, index) { + _.each(['flow', 'flowRight'], function(methodName) { var func = fp[methodName], isFlow = methodName == 'flow'; @@ -829,6 +844,20 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('fp.gt and fp.gte'); + + _.each(['gt', 'gte'], function(methodName) { + var func = fp[methodName]; + + QUnit.test('`fp.' + methodName + '` should have `rearg` applied', function(assert) { + assert.expect(1); + + assert.strictEqual(func(2)(1), true); + }); + }); + + /*--------------------------------------------------------------------------*/ + QUnit.module('fp.inRange'); (function() { @@ -868,12 +897,26 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('fp.lt and fp.lte'); + + _.each(['lt', 'lte'], function(methodName) { + var func = fp[methodName]; + + QUnit.test('`fp.' + methodName + '` should have `rearg` applied', function(assert) { + assert.expect(1); + + assert.strictEqual(func(1)(2), true); + }); + }); + + /*--------------------------------------------------------------------------*/ + QUnit.module('fp.maxBy and fp.minBy'); - _.each(['maxBy', 'minBy'], function(methodName, index) { + _.each(['maxBy', 'minBy'], function(methodName) { var array = [1, 2, 3], func = fp[methodName], - isMax = !index; + isMax = methodName == 'maxBy'; QUnit.test('`fp.' + methodName + '` should work with an `iteratee` argument', function(assert) { assert.expect(1); From c9ca772a326dd951de5b052f882f191c88b79fe0 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 7 Feb 2016 21:49:54 -0800 Subject: [PATCH 27/28] Rebuild lodash and docs. --- dist/lodash.core.js | 16 +- dist/lodash.core.min.js | 4 +- dist/lodash.fp.js | 75 ++-- dist/lodash.fp.min.js | 20 +- dist/lodash.js | 247 ++++++++++--- dist/lodash.min.js | 226 ++++++------ dist/mapping.fp.js | 4 + doc/README.md | 774 ++++++++++++++++++++++++---------------- lodash.js | 4 +- package.json | 2 +- 10 files changed, 862 insertions(+), 510 deletions(-) diff --git a/dist/lodash.core.js b/dist/lodash.core.js index 120fdd8670..ee2a004e74 100644 --- a/dist/lodash.core.js +++ b/dist/lodash.core.js @@ -1,6 +1,6 @@ /** * @license - * lodash 4.2.1 (Custom Build) + * lodash 4.3.0 (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.2.1'; + var VERSION = '4.3.0'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -576,7 +576,7 @@ * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. - * @param {Object} args The arguments provide to `func`. + * @param {Object} args The arguments to provide to `func`. * @returns {number} Returns the timer id. */ function baseDelay(func, wait, args) { @@ -692,7 +692,7 @@ /** * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from those provided. + * `object` function property names filtered from `props`. * * @private * @param {Object} object The object to inspect. @@ -1924,7 +1924,7 @@ * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` through `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` - * is not provided the first element of `collection` is used as the initial + * is not given the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * @@ -3099,7 +3099,7 @@ /** * 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. + * object is given its own enumerable properties are assigned to the created object. * * @static * @memberOf _ @@ -3407,7 +3407,7 @@ /*------------------------------------------------------------------------*/ /** - * This method returns the first argument provided to it. + * This method returns the first argument given to it. * * @static * @memberOf _ @@ -3592,7 +3592,7 @@ } /** - * Generates a unique ID. If `prefix` is provided the ID is appended to it. + * Generates a unique ID. If `prefix` is given the ID is appended to it. * * @static * @memberOf _ diff --git a/dist/lodash.core.min.js b/dist/lodash.core.min.js index fc71235b0d..889fc25b32 100644 --- a/dist/lodash.core.min.js +++ b/dist/lodash.core.min.js @@ -1,6 +1,6 @@ /** * @license - * lodash 4.2.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + * lodash 4.3.0 (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;++rr&&!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 L(n)?n.length?k(n):[]:on(n)},a.values=on,a.extend=Hn,fn(a,a),a.clone=function(n){return X(n)?Mn(n)?k(n):T(n,en(n)):n},a.escape=function(n){return(n=rn(n))&&pn.test(n)?n.replace(ln,i):n},a.every=function(n,t,r){return t=r?an:t,h(n,m(t))},a.find=G,a.forEach=J,a.has=function(n,t){return null!=n&&xn.call(n,t)},a.head=C, a.identity=cn,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; @@ -220,7 +242,7 @@ return /******/ (function(modules) { // webpackBootstrap }, 'runInContext': function(runInContext) { return function(context) { - return baseConvert(util, runInContext(context)); + return baseConvert(util, runInContext(context), undefined, options); }; } }; @@ -232,14 +254,16 @@ return /******/ (function(modules) { // webpackBootstrap return wrapper(func); } var wrapped = func; - if (mutateMap.array[name]) { - wrapped = immutWrap(func, cloneArray); - } - else if (mutateMap.object[name]) { - wrapped = immutWrap(func, createCloner(func)); - } - else if (mutateMap.set[name]) { - wrapped = immutWrap(func, cloneDeep); + if (config.immutable) { + if (mutateMap.array[name]) { + wrapped = immutWrap(func, cloneArray); + } + else if (mutateMap.object[name]) { + wrapped = immutWrap(func, createCloner(func)); + } + else if (mutateMap.set[name]) { + wrapped = immutWrap(func, cloneDeep); + } } var result; each(mapping.caps, function(cap) { @@ -249,19 +273,22 @@ return /******/ (function(modules) { // webpackBootstrap reargIndexes = mapping.iterateeRearg[name], spreadStart = mapping.methodSpread[name]; - result = spreadStart === undefined - ? ary(wrapped, cap) - : spread(wrapped, spreadStart); - - if (cap > 1 && !mapping.skipRearg[name]) { + if (config.fixed) { + result = spreadStart === undefined + ? ary(wrapped, cap) + : spread(wrapped, spreadStart); + } + if (config.rearg && cap > 1 && (forceRearg || !mapping.skipRearg[name])) { result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[cap]); } - if (reargIndexes) { - result = iterateeRearg(result, reargIndexes); - } else if (aryN) { - result = iterateeAry(result, aryN); + if (config.cap) { + if (reargIndexes) { + result = iterateeRearg(result, reargIndexes); + } else if (aryN) { + result = iterateeAry(result, aryN); + } } - if (cap > 1) { + if (config.curry && cap > 1) { result = curry(result, cap); } return false; @@ -544,6 +571,10 @@ return /******/ (function(modules) { // webpackBootstrap 'assignIn': true, 'concat': true, 'difference': true, + 'gt': true, + 'gte': true, + 'lt': true, + 'lte': true, 'matchesProperty': true, 'merge': true, 'partial': true, diff --git a/dist/lodash.fp.min.js b/dist/lodash.fp.min.js index c9170a42ea..b5ddeed5a0 100644 --- a/dist/lodash.fp.min.js +++ b/dist/lodash.fp.min.js @@ -1,12 +1,12 @@ -!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 s=void 0===t&&"string"==typeof r.VERSION,u=s?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,spread:e.spread},c=u.ary,p=u.cloneDeep,l=u.curry,h=u.forEach,f=u.isFunction,d=u.keys,g=u.rearg,y=u.spread,m=function(e,t){return 2==t?function(t,r){return e.apply(void 0,arguments)}:function(t){return e.apply(void 0,arguments)}},v=function(e,t){return 2==t?function(t,r){ -return e(t,r)}:function(t){return e(t)}},R=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)}},x=function(e,t){return E(e,t,!0)},I=function(e,t){return E(e,function(e){return v(e,t)})},O=function(e,t){return E(e,function(e){var r=t.length;return m(g(v(e,r),t),r)})},E=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}},b={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:v(t,r)}},mixin:function(e){return function(t){var r=this;if(!f(r))return e(r,Object(t));var n=[],i=[];return h(d(t),function(e){var a=t[e];f(a)&&(i.push(e),n.push(r.prototype[e]))}),e(r,Object(t)),h(i,function(e,t){var i=n[t];f(i)?r.prototype[e]=i:delete r.prototype[e]}),r}},runInContext:function(t){return function(r){return n(e,t(r))}}},B=function(e,t){e=i.aliasToReal[e]||e;var r=b[e];if(r)return r(t); -var n=t;a.array[e]?n=x(t,R):a.object[e]?n=x(t,W(t)):a.set[e]&&(n=x(t,p));var u;return h(i.caps,function(t){return h(i.aryMethod[t],function(r){if(e==r){var a=!s&&i.iterateeAry[e],o=i.iterateeRearg[e],p=i.methodSpread[e];return u=void 0===p?c(n,t):y(n,p),t>1&&!i.skipRearg[e]&&(u=g(u,i.methodRearg[e]||i.aryRearg[t])),o?u=O(u,o):a&&(u=I(u,a)),t>1&&(u=l(u,t)),!1}}),!u}),u||(u=t),i.placeholder[e]&&(t.placeholder=u.placeholder=o),u};if(!s)return B(t,r);u.placeholder=o;var k=[];return h(i.caps,function(e){ -h(i.aryMethod[e],function(e){var t=u[i.rename[e]||e];t&&k.push([e,B(e,t)])})}),h(k,function(e){u[e[0]]=e[1]}),h(d(u),function(e){h(i.realToAlias[e]||[],function(t){u[t]=u[e]})}),u}var i=r(2),a=i.mutate,o={};e.exports=n},function(e,t){t.aliasToReal={__:"placeholder",all:"some",allPass:"overEvery",apply:"spread",assoc:"set",assocPath:"set",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",each:"forEach",eachRight:"forEachRight",equals:"isEqual",extend:"assignIn",extendWith:"assignInWith", -first:"head",init:"initial",mapObj:"mapValues",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",pickAll:"pick",pipe:"flow",prop:"get",propOf:"propertyOf",propOr:"getOr",somePass:"overSome",unapply:"rest",unnest:"flatten",useWith:"overArgs",whereEq:"filter",zipObj:"zipObject"},t.aryMethod={1:["attempt","ceil","create","curry","curryRight","floor","fromPairs","invert","iteratee","memoize","method","methodOf","mixin","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words"], -2:["add","after","ary","assign","assignIn","at","before","bind","bindKey","chunk","cloneDeepWith","cloneWith","concat","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","delay","difference","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","merge","minBy","omit","omitBy","orderBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","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","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"], +!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(i){if(r[i])return r[i].exports;var n=r[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){function i(e,t){return n(e,e,void 0,t)}var n=r(1);e.exports=i},function(e,t,r){ +function i(e,t,r,s){if(s||(s={}),"function"!=typeof r&&(r=t,t=void 0),null==r)throw new TypeError;var u={cap:"cap"in s?s.cap:!0,curry:"curry"in s?s.curry:!0,fixed:"fixed"in s?s.fixed:!0,immutable:"immutable"in s?s.immutable:!0,rearg:"rearg"in s?s.rearg:!0},c="rearg"in s&&s.rearg,p=void 0===t&&"string"==typeof r.VERSION,l=p?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,spread:e.spread},f=l.ary,h=l.cloneDeep,d=l.curry,g=l.forEach,y=l.isFunction,m=l.keys,v=l.rearg,R=l.spread,W=function(e,t){ +return 2==t?function(t,r){return e.apply(void 0,arguments)}:function(t){return e.apply(void 0,arguments)}},x=function(e,t){return 2==t?function(t,r){return e(t,r)}:function(t){return e(t)}},I=function(e){for(var t=e?e.length:0,r=Array(t);t--;)r[t]=e[t];return r},O=function(e){return function(t){return e({},t)}},b=function(e,t){return k(e,t,!0)},E=function(e,t){return k(e,function(e){return x(e,t)})},B=function(e,t){return k(e,function(e){var r=t.length;return W(v(x(e,r),t),r)})},k=function(e,t,r){ +return function(){for(var i=arguments.length,n=Array(i);i--;)n[i]=arguments[i];n[0]=t(n[0]);var a=e.apply(void 0,n);return r?n[0]:a}},j={iteratee:function(e){return function(){var t=arguments[0],r=arguments[1];if(!u.cap)return e(t,r);r=r>2?r-2:1,t=e(t);var i=t.length;return i&&r>=i?t:x(t,r)}},mixin:function(e){return function(t){var r=this;if(!y(r))return e(r,Object(t));var i=[],n=[];return g(m(t),function(e){var a=t[e];y(a)&&(n.push(e),i.push(r.prototype[e]))}),e(r,Object(t)),g(n,function(e,t){var n=i[t]; +y(n)?r.prototype[e]=n:delete r.prototype[e]}),r}},runInContext:function(t){return function(r){return i(e,t(r),void 0,s)}}},A=function(e,t){e=n.aliasToReal[e]||e;var r=j[e];if(r)return r(t);var i=t;u.immutable&&(a.array[e]?i=b(t,I):a.object[e]?i=b(t,O(t)):a.set[e]&&(i=b(t,h)));var s;return g(n.caps,function(t){return g(n.aryMethod[t],function(r){if(e==r){var a=!p&&n.iterateeAry[e],o=n.iterateeRearg[e],l=n.methodSpread[e];return u.fixed&&(s=void 0===l?f(i,t):R(i,l)),u.rearg&&t>1&&(c||!n.skipRearg[e])&&(s=v(s,n.methodRearg[e]||n.aryRearg[t])), +u.cap&&(o?s=B(s,o):a&&(s=E(s,a))),u.curry&&t>1&&(s=d(s,t)),!1}}),!s}),s||(s=t),n.placeholder[e]&&(t.placeholder=s.placeholder=o),s};if(!p)return A(t,r);l.placeholder=o;var w=[];return g(n.caps,function(e){g(n.aryMethod[e],function(e){var t=l[n.rename[e]||e];t&&w.push([e,A(e,t)])})}),g(w,function(e){l[e[0]]=e[1]}),g(m(l),function(e){g(n.realToAlias[e]||[],function(t){l[t]=l[e]})}),l}var n=r(2),a=n.mutate,o={};e.exports=i},function(e,t){t.aliasToReal={__:"placeholder",all:"some",allPass:"overEvery", +apply:"spread",assoc:"set",assocPath:"set",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",each:"forEach",eachRight:"forEachRight",equals:"isEqual",extend:"assignIn",extendWith:"assignInWith",first:"head",init:"initial",mapObj:"mapValues",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",pickAll:"pick",pipe:"flow",prop:"get",propOf:"propertyOf",propOr:"getOr",somePass:"overSome",unapply:"rest",unnest:"flatten",useWith:"overArgs",whereEq:"filter", +zipObj:"zipObject"},t.aryMethod={1:["attempt","ceil","create","curry","curryRight","floor","fromPairs","invert","iteratee","memoize","method","methodOf","mixin","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words"],2:["add","after","ary","assign","assignIn","at","before","bind","bindKey","chunk","cloneDeepWith","cloneWith","concat","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","delay","difference","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","merge","minBy","omit","omitBy","orderBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","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","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"], 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"]},t.aryRearg={2:[1,0],3:[2,1,0],4:[3,2,0,1]},t.caps=[1,2,3,4],t.iterateeAry={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},t.iterateeRearg={findKey:[1],findLastKey:[1],mapKeys:[1]},t.methodRearg={assignInWith:[1,2,0],assignWith:[1,2,0],clamp:[2,0,1],mergeWith:[1,2,0],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]},t.methodSpread={partial:1,partialRight:1},t.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,unset:!0}},t.placeholder={bind:!0,bindKey:!0,curry:!0,curryRight:!0,partial:!0,partialRight:!0},t.realToAlias=function(){var e=Object.prototype.hasOwnProperty,r=t.aliasToReal,n={}; -for(var i in r){var a=r[i];e.call(n,a)?n[a].push(i):n[a]=[i]}return n}(),t.rename={curryN:"curry",curryRightN:"curryRight",getOr:"get",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart"},t.skipRearg={add:!0,assign:!0,assignIn:!0,concat:!0,difference:!0,matchesProperty:!0,merge:!0,partial:!0,partialRight:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0}}])}); \ No newline at end of file +set:[2,0,1],setWith:[3,1,2,0],slice:[2,0,1],transform:[2,0,1]},t.methodSpread={partial:1,partialRight:1},t.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,unset:!0}},t.placeholder={bind:!0,bindKey:!0,curry:!0,curryRight:!0,partial:!0,partialRight:!0},t.realToAlias=function(){var e=Object.prototype.hasOwnProperty,r=t.aliasToReal,i={}; +for(var n in r){var a=r[n];e.call(i,a)?i[a].push(n):i[a]=[n]}return i}(),t.rename={curryN:"curry",curryRightN:"curryRight",getOr:"get",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart"},t.skipRearg={add:!0,assign:!0,assignIn:!0,concat:!0,difference:!0,gt:!0,gte:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,partial:!0,partialRight:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0}}])}); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index 3476e91e26..125e3422b5 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -1,6 +1,6 @@ /** * @license - * lodash 4.2.1 (Custom Build) + * lodash 4.3.0 (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.2.1'; + var VERSION = '4.3.0'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -82,7 +82,8 @@ setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; var arrayBufferTag = '[object ArrayBuffer]', float32Tag = '[object Float32Array]', @@ -231,8 +232,8 @@ /** Used to assign default `context` object properties. */ var contextProps = [ - 'Array', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', - 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Array', 'Buffer', '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' @@ -1306,7 +1307,8 @@ ); /** Built-in value references. */ - var Reflect = context.Reflect, + var Buffer = moduleExports ? context.Buffer : undefined, + Reflect = context.Reflect, Symbol = context.Symbol, Uint8Array = context.Uint8Array, clearTimeout = context.clearTimeout, @@ -1339,9 +1341,10 @@ /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; - /** Used to detect maps and sets. */ + /** Used to detect maps, sets, and weakmaps. */ var mapCtorString = Map ? funcToString.call(Map) : '', - setCtorString = Set ? funcToString.call(Set) : ''; + setCtorString = Set ? funcToString.call(Set) : '', + weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, @@ -2251,6 +2254,9 @@ var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } if (tag == objectTag || tag == argsTag || (isFunc && !object)) { if (isHostObject(value)) { return object ? value : {}; @@ -2336,7 +2342,7 @@ * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. - * @param {Object} args The arguments provide to `func`. + * @param {Object} args The arguments to provide to `func`. * @returns {number} Returns the timer id. */ function baseDelay(func, wait, args) { @@ -2581,7 +2587,7 @@ /** * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from those provided. + * `object` function property names filtered from `props`. * * @private * @param {Object} object The object to inspect. @@ -3708,18 +3714,37 @@ } /** - * Creates a clone of `buffer`. + * Creates a clone of `buffer`. * * @private - * @param {ArrayBuffer} buffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. */ - function cloneBuffer(buffer) { + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } var Ctor = buffer.constructor, - result = new Ctor(buffer.byteLength), + result = new Ctor(buffer.length); + + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var Ctor = arrayBuffer.constructor, + result = new Ctor(arrayBuffer.byteLength), view = new Uint8Array(result); - view.set(new Uint8Array(buffer)); + view.set(new Uint8Array(arrayBuffer)); return result; } @@ -3785,7 +3810,7 @@ var buffer = typedArray.buffer, Ctor = typedArray.constructor; - return new Ctor(isDeep ? cloneBuffer(buffer) : buffer, typedArray.byteOffset, typedArray.length); + return new Ctor(isDeep ? cloneArrayBuffer(buffer) : buffer, typedArray.byteOffset, typedArray.length); } /** @@ -4853,19 +4878,20 @@ return objectToString.call(value); } - // Fallback for IE 11 providing `toStringTag` values for maps and sets. - if ((Map && getTag(new Map) != mapTag) || (Set && getTag(new Set) != setTag)) { + // Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. + if ((Map && getTag(new Map) != mapTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : null, ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; if (ctorString) { - if (ctorString == mapCtorString) { - return mapTag; - } - if (ctorString == setCtorString) { - return setTag; + switch (ctorString) { + case mapCtorString: return mapTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; } } return result; @@ -4979,7 +5005,7 @@ var Ctor = object.constructor; switch (tag) { case arrayBufferTag: - return cloneBuffer(object); + return cloneArrayBuffer(object); case boolTag: case dateTag: @@ -5026,7 +5052,7 @@ } /** - * Checks if the provided arguments are from an iteratee call. + * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. @@ -5434,7 +5460,7 @@ /** * 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) + * given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. * * @static @@ -5914,8 +5940,8 @@ } /** - * 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) + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. * * @static @@ -6080,7 +6106,7 @@ } /** - * Removes all provided values from `array` using + * Removes all given values from `array` using * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. * @@ -6637,8 +6663,8 @@ } /** - * 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) + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. * * @static @@ -6849,7 +6875,7 @@ } /** - * Creates an array excluding all provided values using + * Creates an array excluding all given values using * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. * @@ -6872,7 +6898,7 @@ /** * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the provided arrays. + * of the given arrays. * * @static * @memberOf _ @@ -7898,7 +7924,7 @@ * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` through `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` - * is not provided the first element of `collection` is used as the initial + * is not given the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * @@ -8627,7 +8653,7 @@ if (maxWait === false) { var leadingCall = leading && !timeoutId; } else { - if (!maxTimeoutId && !leading) { + if (!lastCalled && !maxTimeoutId && !leading) { lastCalled = stamp; } var remaining = maxWait - (stamp - lastCalled), @@ -9426,6 +9452,27 @@ */ var isArray = Array.isArray; + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @type Function + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + function isArrayBuffer(value) { + return isObjectLike(value) && objectToString.call(value) == arrayBufferTag; + } + /** * 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 @@ -9505,6 +9552,26 @@ (isObjectLike(value) && objectToString.call(value) == boolTag); } + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = !Buffer ? constant(false) : function(value) { + return value instanceof Buffer; + }; + /** * Checks if `value` is classified as a `Date` object. * @@ -9838,6 +9905,26 @@ return !!value && typeof value == 'object'; } + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + function isMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + /** * Performs a deep comparison between `object` and `source` to determine if * `object` contains equivalent property values. @@ -10123,6 +10210,26 @@ return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; } + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + function isSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + /** * Checks if `value` is classified as a `String` primitive or object. * @@ -10205,6 +10312,46 @@ return value === undefined; } + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && objectToString.call(value) == weakSetTag; + } + /** * Checks if `value` is less than `other`. * @@ -10639,7 +10786,7 @@ /** * 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. + * object is given its own enumerable properties are assigned to the created object. * * @static * @memberOf _ @@ -12405,7 +12552,7 @@ * in "interpolate" delimiters, HTML-escape interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * properties may be accessed as free variables in the template. If a setting - * object is provided it takes precedence over `_.templateSettings` values. + * object is given it takes precedence over `_.templateSettings` values. * * **Note:** In the development build `_.template` utilizes * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) @@ -13083,9 +13230,9 @@ } /** - * Creates a function that returns the result of invoking the provided - * functions with the `this` binding of the created function, where each - * successive invocation is supplied the return value of the previous. + * Creates a function that returns the result of invoking the given functions + * with the `this` binding of the created function, where each successive + * invocation is supplied the return value of the previous. * * @static * @memberOf _ @@ -13106,7 +13253,7 @@ /** * This method is like `_.flow` except that it creates a function that - * invokes the provided functions from right to left. + * invokes the given functions from right to left. * * @static * @memberOf _ @@ -13126,7 +13273,7 @@ var flowRight = createFlow(true); /** - * This method returns the first argument provided to it. + * This method returns the first argument given to it. * * @static * @memberOf _ @@ -13678,7 +13825,7 @@ } /** - * Generates a unique ID. If `prefix` is provided the ID is appended to it. + * Generates a unique ID. If `prefix` is given the ID is appended to it. * * @static * @memberOf _ @@ -13716,6 +13863,9 @@ */ function add(augend, addend) { var result; + if (augend === undefined && addend === undefined) { + return 0; + } if (augend !== undefined) { result = augend; } @@ -13926,6 +14076,9 @@ */ function subtract(minuend, subtrahend) { var result; + if (minuend === undefined && subtrahend === undefined) { + return 0; + } if (minuend !== undefined) { result = minuend; } @@ -14212,9 +14365,11 @@ lodash.invoke = invoke; lodash.isArguments = isArguments; lodash.isArray = isArray; + lodash.isArrayBuffer = isArrayBuffer; lodash.isArrayLike = isArrayLike; lodash.isArrayLikeObject = isArrayLikeObject; lodash.isBoolean = isBoolean; + lodash.isBuffer = isBuffer; lodash.isDate = isDate; lodash.isElement = isElement; lodash.isEmpty = isEmpty; @@ -14225,6 +14380,7 @@ lodash.isFunction = isFunction; lodash.isInteger = isInteger; lodash.isLength = isLength; + lodash.isMap = isMap; lodash.isMatch = isMatch; lodash.isMatchWith = isMatchWith; lodash.isNaN = isNaN; @@ -14237,10 +14393,13 @@ lodash.isPlainObject = isPlainObject; lodash.isRegExp = isRegExp; lodash.isSafeInteger = isSafeInteger; + lodash.isSet = isSet; lodash.isString = isString; lodash.isSymbol = isSymbol; lodash.isTypedArray = isTypedArray; lodash.isUndefined = isUndefined; + lodash.isWeakMap = isWeakMap; + lodash.isWeakSet = isWeakSet; lodash.join = join; lodash.kebabCase = kebabCase; lodash.last = last; diff --git a/dist/lodash.min.js b/dist/lodash.min.js index dd5cf105a8..0472b5f2c9 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -1,118 +1,120 @@ /** * @license - * lodash 4.2.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + * lodash 4.3.0 (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.length){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,r,e){for(var u=-1,o=n.length;++ut&&!o||!u||r&&!i&&f||e&&f)return 1;if(t>n&&!r||!f||o&&!e&&u||i&&u)return-1}return 0}function R(n){return Bn[n]}function S(n){return zn[n]}function W(n){return"\\"+Fn[n]}function C(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 L(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function $(n,t){for(var r=-1,e=n.length,u=-1,o=[];++rr?false:(r==n.length-1?n.pop():ju.call(n,r,1),true)}function Zn(n,t){var r=qn(n,t);return 0>r?Z:n[r][1]}function qn(n,t){for(var r=n.length;r--;)if(ae(n[r][0],t))return r;return-1}function Pn(n,t,r){var e=qn(n,t);0>e?n.push([t,r]):n[e][1]=r}function Tn(n,t,r,e){return n===Z||ae(n,uu[r])&&!iu.call(e,r)?t:n}function Kn(n,t,r){(r!==Z&&!ae(n[t],r)||typeof t=="number"&&r===Z&&!(t in n))&&(n[t]=r)}function Jn(n,t,r){var e=n[t];(!ae(e,r)||ae(e,uu[t])&&!iu.call(n,t)||r===Z&&!(t in n))&&(n[t]=r); -}function Yn(n,t,r,e){return Tu(n,function(n,u,o){t(e,n,r(n),o)}),e}function Hn(n,t){return n&&Jt(t,$e(t),n)}function Qn(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 nt(n,t,r,e,o,i){var f;if(r&&(f=o?r(n,e,o,i):r(n)),f!==Z)return f;if(!ye(n))return n;if(e=Lo(n)){if(f=Er(n),!t)return Vt(n,f)}else{var c=Ar(n),a="[object Function]"==c||"[object GeneratorFunction]"==c;if("[object Object]"!=c&&"[object Arguments]"!=c&&(!a||o))return Un[c]?Ir(n,c,t):o?n:{}; -if(U(n))return o?n:{};if(f=kr(a?{}:n),!t)return Ht(n,Hn(f,n))}return i||(i=new Fn),(o=i.get(n))?o:(i.set(n,f),(e?u:ct)(n,function(e,u){Jn(f,u,nt(e,t,r,u,n,i))}),e?f:Ht(n,f))}function tt(n){var t=$e(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 rt(n,t,r){if(typeof n!="function")throw new ru("Expected a function");return mu(function(){n.apply(Z,r)},t)}function et(n,t,r,e){var u=-1,o=f,i=true,l=n.length,s=[],h=t.length; -if(!l)return s;r&&(t=a(t,w(r))),e?(o=c,i=false):t.length>=200&&(o=$n,i=false,t=new Ln(t));n:for(;++ur;)n=n[t[r++]];return r&&r==e?n:Z}function ht(n,t){return iu.call(n,t)||typeof n=="object"&&t in n&&null===du(n)}function pt(n,t){return t in Object(n)}function _t(n,t,r){for(var e=r?c:f,u=n.length,o=u,i=Array(u),l=[];o--;){var s=n[o];o&&t&&(s=a(s,w(t))), -i[o]=r||!t&&120>s.length?Z:new Ln(o&&s)}var s=n[0],h=-1,p=s.length,_=i[0];n:for(;++he?c*("desc"==r[e]?-1:1):c;break n}}e=n.b-t.b}return e})}function Et(n,t){return n=Object(n),s(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function kt(n,t){var r={};return ft(n,function(n,e){t(n,e)&&(r[e]=n)}),r}function It(n){return function(t){return null==t?Z:t[n]}}function Rt(n){return function(t){return st(t,n)}}function St(n,t,r){var e=-1,u=t.length,o=n;for(r&&(o=a(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 $t(n,t,Ke,r)}function $t(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=Au((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 Ru(o,4294967294)}function Ft(n,t){for(var r=0,e=n.length,u=n[0],o=t?t(u):u,i=o,f=0,c=[u];++re?t[e]:Z);return i}function Tt(n){ -var t=new n.constructor(n.byteLength);return new _u(t).set(new _u(n)),t}function Kt(n,t,r){for(var e=r.length,u=-1,o=Iu(n.length-e,0),i=-1,f=t.length,c=Array(f+o);++i1?r[u-1]:Z,i=u>2?r[2]:Z,o=typeof o=="function"?(u--,o):Z;for(i&&Sr(r[0],r[1],i)&&(o=3>u?Z:o,u=1),t=Object(t);++ei&&c[0]!==l&&c[i-1]!==l?[]:$(c,l),i-=f.length,e>i?_r(n,t,cr,l,Z,c,f,Z,Z,e-i):r(a,this,c)}var o=or(n);return u}function fr(n){return ce(function(t){t=it(t);var r=t.length,e=r,u=wn.prototype.thru;for(n&&t.reverse();e--;){var o=t[e];if(typeof o!="function")throw new ru("Expected a function");if(u&&!i&&"wrapper"==xr(o))var i=new wn([],true)}for(e=i?e:r;++e=200)return i.plant(e).value();for(var u=0,n=r?t[u].apply(this,n):e;++uy)return _r(n,t,cr,b,r,x,m,f,c,a-y)}if(y=h?r:this,b=p?y[n]:n,f)for(var m=x.length,j=Ru(f.length,m),w=Vt(x);j--;){ -var A=f[j];x[j]=B(A,m)?w[A]:Z}else v&&x.length>1&&x.reverse();return s&&x.length>c&&(x.length=c),this&&this!==Gn&&this instanceof l&&(b=d||or(b)),b.apply(y,x)}var s=128&t,h=1&t,p=2&t,_=8&t,g=16&t,v=512&t,d=p?Z:or(n);return l}function ar(n,t){return function(r,e){return gt(r,n,t(e))}}function lr(n){return ce(function(t){return t=a(it(t),mr()),ce(function(e){var u=this;return n(t,function(n){return r(n,u,e)})})})}function sr(n,t,r){return t=Re(t),n=M(n),t&&t>n?(t-=n,r=r===Z?" ":r+"",n=qe(r,wu(t/M(r))), -kn.test(r)?n.match(En).slice(0,t).join(""):n.slice(0,t)):""}function hr(n,t,e,u){function o(){for(var t=-1,c=arguments.length,a=-1,l=u.length,s=Array(l+c),h=this&&this!==Gn&&this instanceof o?f:n;++at?1:-1:We(e)||0;var u=-1;r=Iu(wu((r-t)/(e||1)),0);for(var o=Array(r);r--;)o[n?r:++u]=t, -t+=e;return o}}function _r(n,t,r,e,u,o,i,f,c,a){var l=8&t;f=f?Vt(f):Z;var s=l?i:Z;i=l?Z:i;var h=l?o:Z;return o=l?Z:o,t=(t|(l?32:64))&~(l?64:32),4&t||(t&=-4),t=[n,t,u,h,s,o,i,f,c,a],r=r.apply(Z,t),Ur(n)&&no(r,t),r.placeholder=e,r}function gr(n){var t=nu[n];return function(n,r){if(n=We(n),r=Re(r)){var e=(Ue(n)+"e").split("e"),e=t(e[0]+"e"+(+e[1]+r)),e=(Ue(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return t(n)}}function vr(n,t,r,e,u,o,i,f){var c=2&t;if(!c&&typeof n!="function")throw new ru("Expected a function"); -var a=e?e.length:0;if(a||(t&=-97,e=u=Z),i=i===Z?i:Iu(Re(i),0),f=f===Z?f:Re(f),a-=u?u.length:0,64&t){var l=e,s=u;e=u=Z}var h=c?Z:Hu(n);return o=[n,t,r,e,u,l,s,o,i,f],h&&(r=o[1],n=h[1],t=r|n,e=128==n&&8==r||128==n&&256==r&&h[8]>=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?Kt(e,r,h[4]):Vt(r),o[4]=e?$(o[3],"__lodash_placeholder__"):Vt(h[4])),(r=h[5])&&(e=o[5],o[5]=e?Gt(e,r,h[6]):Vt(r),o[6]=e?$(o[5],"__lodash_placeholder__"):Vt(h[6])),(r=h[7])&&(o[7]=Vt(r)), -128&n&&(o[8]=null==o[8]?h[8]:Ru(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:Iu(o[9]-a,0),!f&&24&t&&(t&=-25),(h?Ju:no)(t&&1!=t?8==t||16==t?ir(n,t,f):32!=t&&33!=t||u.length?cr.apply(Z,o):hr(n,t,r,e):rr(n,t,r),o)}function dr(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 Zr(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:Re(t), -t=e-t,Bt(n,0,0>t?0:t)):[]}function qr(n){return n?n[0]:Z}function Pr(n){var t=n?n.length:0;return t?n[t-1]:Z}function Tr(n,t){return n&&n.length&&t&&t.length?St(n,t):n}function Kr(n){return n?Cu.call(n):n}function Gr(n){if(!n||!n.length)return[];var t=0;return n=i(n,function(n){return pe(n)?(t=Iu(n.length,t),true):void 0}),m(t,function(t){return a(n,It(t))})}function Vr(n,t){if(!n||!n.length)return[];var e=Gr(n);return null==t?e:a(e,function(n){return r(t,Z,n)})}function Jr(n){return n=yn(n),n.__chain__=true, -n}function Yr(n,t){return t(n)}function Hr(){return this}function Qr(n,t){return typeof t=="function"&&Lo(n)?u(n,t):Tu(n,Mr(t))}function Xr(n,t){var r;if(typeof t=="function"&&Lo(n)){for(r=n.length;r--&&false!==t(n[r],r,n););r=n}else r=Ku(n,Mr(t));return r}function ne(n,t){return(Lo(n)?a:mt)(n,mr(t,3))}function te(n,t){var r=-1,e=Ie(n),u=e.length,o=u-1;for(t=Xn(Re(t),0,u);++r=n&&(t=Z),r}}function ue(n,t,r){return t=r?Z:t,n=vr(n,8,Z,Z,Z,Z,Z,t),n.placeholder=yn.placeholder||ue.placeholder,n}function oe(n,t,r){return t=r?Z:t,n=vr(n,16,Z,Z,Z,Z,Z,t),n.placeholder=yn.placeholder||oe.placeholder,n}function ie(n,t,r){function e(){p&&gu(p),a&&gu(a),g=0,c=a=h=p=_=Z}function u(t,r){r&&gu(r),a=p=_=Z,t&&(g=ko(),l=n.apply(h,c),p||a||(c=h=Z)); -}function o(){var n=t-(ko()-s);0>=n||n>t?u(_,a):p=mu(o,n)}function i(){u(y,p)}function f(){if(c=arguments,s=ko(),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=gu(a)),g=s,l=n.apply(h,c)):a||(a=mu(i,e))}return u&&p?p=gu(p):p||t===d||(p=mu(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 ru("Expected a function");return t=We(t)||0,ye(r)&&(v=!!r.leading,d="maxWait"in r&&Iu(We(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 fe(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 ru("Expected a function");return r.cache=new fe.Cache,r}function ce(n,t){if(typeof n!="function")throw new ru("Expected a function");return t=Iu(t===Z?n.length-1:Re(t),0),function(){for(var e=arguments,u=-1,o=Iu(e.length-t,0),i=Array(o);++ut}function se(n){return pe(n)&&iu.call(n,"callee")&&(!xu.call(n,"callee")||"[object Arguments]"==au.call(n))}function he(n){return null!=n&&!(typeof n=="function"&&ge(n))&&de(Qu(n))}function pe(n){return be(n)&&he(n)}function _e(n){return be(n)&&typeof n.message=="string"&&"[object Error]"==au.call(n); -}function ge(n){return n=ye(n)?au.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function ve(n){return typeof n=="number"&&n==Re(n)}function de(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function ye(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function be(n){return!!n&&typeof n=="object"}function xe(n){return null==n?false:ge(n)?su.test(ou.call(n)):be(n)&&(U(n)?su:vn).test(n)}function me(n){return typeof n=="number"||be(n)&&"[object Number]"==au.call(n); -}function je(n){if(!be(n)||"[object Object]"!=au.call(n)||U(n))return false;var t=uu;return typeof n.constructor=="function"&&(t=du(n)),null===t?true:(n=t.constructor,typeof n=="function"&&n instanceof n&&ou.call(n)==cu)}function we(n){return ye(n)&&"[object RegExp]"==au.call(n)}function Ae(n){return typeof n=="string"||!Lo(n)&&be(n)&&"[object String]"==au.call(n)}function Oe(n){return typeof n=="symbol"||be(n)&&"[object Symbol]"==au.call(n)}function Ee(n){return be(n)&&de(n.length)&&!!Cn[au.call(n)]}function ke(n,t){ -return t>n}function Ie(n){if(!n)return[];if(he(n))return Ae(n)?n.match(En):Vt(n);if(bu&&n[bu])return z(n[bu]());var t=Ar(n);return("[object Map]"==t?L:"[object Set]"==t?F:Ne)(n)}function Re(n){if(!n)return 0===n?n:0;if(n=We(n),n===q||n===-q)return 1.7976931348623157e308*(0>n?-1:1);var t=n%1;return n===n?t?n-t:n:0}function Se(n){return n?Xn(Re(n),0,4294967295):0}function We(n){if(ye(n)&&(n=ge(n.valueOf)?n.valueOf():n,n=ye(n)?n+"":n),typeof n!="string")return 0===n?n:+n;n=n.replace(fn,"");var t=gn.test(n); -return t||dn.test(n)?Nn(n.slice(2),t?2:8):_n.test(n)?P:+n}function Ce(n){return Jt(n,Fe(n))}function Ue(n){if(typeof n=="string")return n;if(null==n)return"";if(Oe(n))return pu?Zu.call(n):"";var t=n+"";return"0"==t&&1/n==-q?"-0":t}function Be(n,t,r){return n=null==n?Z:st(n,t),n===Z?r:n}function ze(n,t){return Or(n,t,ht)}function Le(n,t){return Or(n,t,pt)}function $e(n){var t=Br(n);if(!t&&!he(n))return ku(Object(n));var r,e=Rr(n),u=!!e,e=e||[],o=e.length;for(r in n)!ht(n,r)||u&&("length"==r||B(r,o))||t&&"constructor"==r||e.push(r); -return e}function Fe(n){for(var t=-1,r=Br(n),e=xt(n),u=e.length,o=Rr(n),i=!!o,o=o||[],f=o.length;++tt||t>9007199254740991)return r;do t%2&&(r+=n),t=Au(t/2),n+=n;while(t);return r; -}function Pe(n,t,r){return n=Ue(n),t=r?Z:t,t===Z&&(t=Sn.test(n)?Rn:In),n.match(t)||[]}function Te(n){return function(){return n}}function Ke(n){return n}function Ge(n){return bt(typeof n=="function"?n:nt(n,true))}function Ve(n,t,r){var e=$e(t),o=lt(t,e);null!=r||ye(t)&&(o.length||!e.length)||(r=t,t=n,n=this,o=lt(t,$e(t)));var i=ye(r)&&"chain"in r?r.chain:true,f=ge(n);return u(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__=Vt(this.__actions__)).push({ -func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,l([this.value()],arguments))})}),n}function Je(){}function Ye(n){return Wr(n)?It(n):Rt(n)}function He(n){return n&&n.length?x(n,Ke):0}k=k?Vn.defaults({},k,Vn.pick(Gn,Wn)):Gn;var Qe=k.Date,Xe=k.Error,nu=k.Math,tu=k.RegExp,ru=k.TypeError,eu=k.Array.prototype,uu=k.Object.prototype,ou=k.Function.prototype.toString,iu=uu.hasOwnProperty,fu=0,cu=ou.call(Object),au=uu.toString,lu=Gn._,su=tu("^"+ou.call(iu).replace(un,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),hu=k.f,pu=k.Symbol,_u=k.Uint8Array,gu=k.clearTimeout,vu=hu?hu.g:Z,du=Object.getPrototypeOf,yu=Object.getOwnPropertySymbols,bu=typeof(bu=pu&&pu.iterator)=="symbol"?bu:Z,xu=uu.propertyIsEnumerable,mu=k.setTimeout,ju=eu.splice,wu=nu.ceil,Au=nu.floor,Ou=k.isFinite,Eu=eu.join,ku=Object.keys,Iu=nu.max,Ru=nu.min,Su=k.parseInt,Wu=nu.random,Cu=eu.reverse,Uu=wr(k,"Map"),Bu=wr(k,"Set"),zu=wr(k,"WeakMap"),Lu=wr(Object,"create"),$u=zu&&new zu,Fu=Uu?ou.call(Uu):"",Mu=Bu?ou.call(Bu):"",Nu=pu?pu.prototype:Z,Du=pu?Nu.valueOf:Z,Zu=pu?Nu.toString:Z,qu={}; -yn.templateSettings={escape:Q,evaluate:X,interpolate:nn,variable:"",imports:{_:yn}};var Pu=function(){function n(){}return function(t){if(ye(t)){n.prototype=t;var r=new n;n.prototype=Z}return r||{}}}(),Tu=nr(ct),Ku=nr(at,true),Gu=tr(),Vu=tr(true);vu&&!xu.call({valueOf:1},"valueOf")&&(xt=function(n){return z(vu(n))});var Ju=$u?function(n,t){return $u.set(n,t),n}:Ke,Yu=Bu&&2===new Bu([1,2]).size?function(n){return new Bu(n)}:Je,Hu=$u?function(n){return $u.get(n)}:Je,Qu=It("length"),Xu=yu||function(){return[]; -};(Uu&&"[object Map]"!=Ar(new Uu)||Bu&&"[object Set]"!=Ar(new Bu))&&(Ar=function(n){var t=au.call(n);if(n="[object Object]"==t?n.constructor:null,n=typeof n=="function"?ou.call(n):""){if(n==Fu)return"[object Map]";if(n==Mu)return"[object Set]"}return t});var no=function(){var n=0,t=0;return function(r,e){var u=ko(),o=16-(u-t);if(t=u,o>0){if(150<=++n)return r}else n=0;return Ju(r,e)}}(),to=ce(function(n,t){Lo(n)||(n=null==n?[]:[Object(n)]),t=it(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 Vr(n,t)}),xo=ce(function(n){function t(t){return Qn(t,n)}n=it(n);var r=n.length,e=r?n[0]:0,u=this.__wrapped__;return 1>=r&&!this.__actions__.length&&u instanceof An&&B(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:Yr,args:[t],thisArg:Z}),new wn(u,this.__chain__).thru(function(n){return r&&!n.length&&n.push(Z),n})):this.thru(t)}),mo=Qt(function(n,t,r){iu.call(n,r)?++n[r]:n[r]=1; -}),jo=Qt(function(n,t,r){iu.call(n,r)?n[r].push(t):n[r]=[t]}),wo=ce(function(n,t,e){var u=-1,o=typeof t=="function",i=Wr(t),f=he(n)?Array(n.length):[];return Tu(n,function(n){var c=o?t:i&&null!=n?n[t]:Z;f[++u]=c?r(c,n,e):vt(n,t,e)}),f}),Ao=Qt(function(n,t,r){n[r]=t}),Oo=Qt(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),Eo=ce(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Sr(n,t[0],t[1])?t=[]:r>2&&Sr(t[0],t[1],t[2])&&(t.length=1),Ot(n,it(t),[])}),ko=Qe.now,Io=ce(function(n,t,r){ -var e=1;if(r.length)var u=$(r,yn.placeholder||Io.placeholder),e=32|e;return vr(n,e,t,r,u)}),Ro=ce(function(n,t,r){var e=3;if(r.length)var u=$(r,yn.placeholder||Ro.placeholder),e=32|e;return vr(t,e,n,r,u)}),So=ce(function(n,t){return rt(n,1,t)}),Wo=ce(function(n,t,r){return rt(n,We(t)||0,r)}),Co=ce(function(n,t){t=a(it(t),mr());var e=t.length;return ce(function(u){for(var o=-1,i=Ru(u.length,e);++oe.length?Pn(e,n,t):(r.array=null,r.map=new zn(e))),(r=r.map)&&r.set(n,t),this},fe.Cache=zn,yn.after=function(n,t){if(typeof t!="function")throw new ru("Expected a function");return n=Re(n),function(){return 1>--n?t.apply(this,arguments):void 0}},yn.ary=re,yn.assign=$o,yn.assignIn=Fo,yn.assignInWith=Mo,yn.assignWith=No,yn.at=Do,yn.before=ee,yn.bind=Io,yn.bindAll=ii,yn.bindKey=Ro,yn.chain=Jr,yn.chunk=function(n,t){t=Iu(Re(t),0); -var r=n?n.length:0;if(!r||1>t)return[];for(var e=0,u=-1,o=Array(wu(r/t));r>e;)o[++u]=Bt(n,e,e+=t);return o},yn.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:Re(e),0>e&&(e+=u),e=r>e?0:Se(e);e>r;)n[r++]=t;return n},yn.filter=function(n,t){return(Lo(n)?i:ot)(n,mr(t,3))},yn.flatMap=function(n,t){return it(ne(n,t))},yn.flatten=function(n){return n&&n.length?it(n):[]},yn.flattenDeep=function(n){return n&&n.length?it(n,true):[]},yn.flip=function(n){return vr(n,512)},yn.flow=fi,yn.flowRight=ci,yn.fromPairs=function(n){for(var t=-1,r=n?n.length:0,e={};++tt?0:t)):[]},yn.takeRight=function(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:Re(t),t=e-t,Bt(n,0>t?0:t,e)):[]},yn.takeRightWhile=function(n,t){return n&&n.length?Dt(n,mr(t,3),false,true):[]},yn.takeWhile=function(n,t){return n&&n.length?Dt(n,mr(t,3)):[]},yn.tap=function(n,t){return t(n),n},yn.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new ru("Expected a function");return ye(r)&&(e="leading"in r?!!r.leading:e, -u="trailing"in r?!!r.trailing:u),ie(n,t,{leading:e,maxWait:t,trailing:u})},yn.thru=Yr,yn.toArray=Ie,yn.toPairs=Me,yn.toPairsIn=function(n){return j(n,Fe(n))},yn.toPath=function(n){return Lo(n)?a(n,String):$r(n)},yn.toPlainObject=Ce,yn.transform=function(n,t,r){var e=Lo(n)||Ee(n);if(t=mr(t,4),null==r)if(e||ye(n)){var o=n.constructor;r=e?Lo(n)?new o:[]:Pu(ge(o)?o.prototype:Z)}else r={};return(e?u:ct)(n,function(n,e,u){return t(r,n,e,u)}),r},yn.unary=function(n){return re(n,1)},yn.union=lo,yn.unionBy=so, -yn.unionWith=ho,yn.uniq=function(n){return n&&n.length?Nt(n):[]},yn.uniqBy=function(n,t){return n&&n.length?Nt(n,mr(t)):[]},yn.uniqWith=function(n,t){return n&&n.length?Nt(n,Z,t):[]},yn.unset=function(n,t){var r;if(null==n)r=true;else{r=n;var e=t,e=Wr(e,r)?[e+""]:Mt(e);r=Lr(r,e),e=Pr(e),r=null!=r&&ze(r,e)?delete r[e]:true}return r},yn.unzip=Gr,yn.unzipWith=Vr,yn.values=Ne,yn.valuesIn=function(n){return null==n?A(n,Fe(n)):[]},yn.without=po,yn.words=Pe,yn.wrap=function(n,t){return t=null==t?Ke:t,Uo(t,n); -},yn.xor=_o,yn.xorBy=go,yn.xorWith=vo,yn.zip=yo,yn.zipObject=function(n,t){return Pt(n||[],t||[],Jn)},yn.zipObjectDeep=function(n,t){return Pt(n||[],t||[],Ut)},yn.zipWith=bo,yn.extend=Fo,yn.extendWith=Mo,Ve(yn,yn),yn.add=function(n,t){var r;return n!==Z&&(r=n),t!==Z&&(r=r===Z?t:r+t),r},yn.attempt=oi,yn.camelCase=Ho,yn.capitalize=De,yn.ceil=vi,yn.clamp=function(n,t,r){return r===Z&&(r=t,t=Z),r!==Z&&(r=We(r),r=r===r?r:0),t!==Z&&(t=We(t),t=t===t?t:0),Xn(We(n),t,r)},yn.clone=function(n){return nt(n)}, -yn.cloneDeep=function(n){return nt(n,true)},yn.cloneDeepWith=function(n,t){return nt(n,true,t)},yn.cloneWith=function(n,t){return nt(n,false,t)},yn.deburr=Ze,yn.endsWith=function(n,t,r){n=Ue(n),t=typeof t=="string"?t:t+"";var e=n.length;return r=r===Z?e:Xn(Re(r),0,e),r-=t.length,r>=0&&n.indexOf(t,r)==r},yn.eq=ae,yn.escape=function(n){return(n=Ue(n))&&H.test(n)?n.replace(J,S):n},yn.escapeRegExp=function(n){return(n=Ue(n))&&on.test(n)?n.replace(un,"\\$&"):n},yn.every=function(n,t,r){var e=Lo(n)?o:ut;return r&&Sr(n,t,r)&&(t=Z), -e(n,mr(t,3))},yn.find=function(n,t){if(t=mr(t,3),Lo(n)){var r=v(n,t);return r>-1?n[r]:Z}return g(n,t,Tu)},yn.findIndex=function(n,t){return n&&n.length?v(n,mr(t,3)):-1},yn.findKey=function(n,t){return g(n,mr(t,3),ct,true)},yn.findLast=function(n,t){if(t=mr(t,3),Lo(n)){var r=v(n,t,true);return r>-1?n[r]:Z}return g(n,t,Ku)},yn.findLastIndex=function(n,t){return n&&n.length?v(n,mr(t,3),true):-1},yn.findLastKey=function(n,t){return g(n,mr(t,3),at,true)},yn.floor=di,yn.forEach=Qr,yn.forEachRight=Xr,yn.forIn=function(n,t){ -return null==n?n:Gu(n,Mr(t),Fe)},yn.forInRight=function(n,t){return null==n?n:Vu(n,Mr(t),Fe)},yn.forOwn=function(n,t){return n&&ct(n,Mr(t))},yn.forOwnRight=function(n,t){return n&&at(n,Mr(t))},yn.get=Be,yn.gt=le,yn.gte=function(n,t){return n>=t},yn.has=ze,yn.hasIn=Le,yn.head=qr,yn.identity=Ke,yn.includes=function(n,t,r,e){return n=he(n)?n:Ne(n),r=r&&!e?Re(r):0,e=n.length,0>r&&(r=Iu(e+r,0)),Ae(n)?e>=r&&-1r&&(r=Iu(e+r,0)),d(n,t,r)):-1},yn.inRange=function(n,t,r){return t=We(t)||0,r===Z?(r=t,t=0):r=We(r)||0,n=We(n),n>=Ru(t,r)&&n=-9007199254740991&&9007199254740991>=n},yn.isString=Ae,yn.isSymbol=Oe,yn.isTypedArray=Ee,yn.isUndefined=function(n){return n===Z},yn.join=function(n,t){return n?Eu.call(n,t):""},yn.kebabCase=Qo,yn.last=Pr,yn.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(r!==Z&&(u=Re(r), -u=(0>u?Iu(e+u,0):Ru(u,e-1))+1),t!==t)return C(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},yn.lowerCase=Xo,yn.lowerFirst=ni,yn.lt=ke,yn.lte=function(n,t){return t>=n},yn.max=function(n){return n&&n.length?_(n,Ke,le):Z},yn.maxBy=function(n,t){return n&&n.length?_(n,mr(t),le):Z},yn.mean=function(n){return He(n)/(n?n.length:0)},yn.min=function(n){return n&&n.length?_(n,Ke,ke):Z},yn.minBy=function(n,t){return n&&n.length?_(n,mr(t),ke):Z},yn.noConflict=function(){return Gn._===this&&(Gn._=lu),this; -},yn.noop=Je,yn.now=ko,yn.pad=function(n,t,r){n=Ue(n),t=Re(t);var e=M(n);return t&&t>e?(e=(t-e)/2,t=Au(e),e=wu(e),sr("",t,r)+n+sr("",e,r)):n},yn.padEnd=function(n,t,r){return n=Ue(n),n+sr(n,t,r)},yn.padStart=function(n,t,r){return n=Ue(n),sr(n,t,r)+n},yn.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),n=Ue(n).replace(fn,""),Su(n,t||(pn.test(n)?16:10))},yn.random=function(n,t,r){if(r&&typeof r!="boolean"&&Sr(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=We(n)||0,t===Z?(t=n,n=0):t=We(t)||0),n>t){var e=n;n=t,t=e}return r||n%1||t%1?(r=Wu(),Ru(n+r*(t-n+Mn("1e-"+((r+"").length-1))),t)):Ct(n,t)},yn.reduce=function(n,t,r){var e=Lo(n)?s:y,u=3>arguments.length;return e(n,mr(t,4),r,u,Tu)},yn.reduceRight=function(n,t,r){var e=Lo(n)?h:y,u=3>arguments.length;return e(n,mr(t,4),r,u,Ku)},yn.repeat=qe,yn.replace=function(){var n=arguments,t=Ue(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},yn.result=function(n,t,r){if(Wr(t,n))e=null==n?Z:n[t];else{ -t=Mt(t);var e=Be(n,t);n=Lr(n,t)}return e===Z&&(e=r),ge(e)?e.call(n):e},yn.round=yi,yn.runInContext=D,yn.sample=function(n){n=he(n)?n:Ne(n);var t=n.length;return t>0?n[Ct(0,t-1)]:Z},yn.size=function(n){if(null==n)return 0;if(he(n)){var t=n.length;return t&&Ae(n)?M(n):t}return $e(n).length},yn.snakeCase=ri,yn.some=function(n,t,r){var e=Lo(n)?p:zt;return r&&Sr(n,t,r)&&(t=Z),e(n,mr(t,3))},yn.sortedIndex=function(n,t){return Lt(n,t)},yn.sortedIndexBy=function(n,t,r){return $t(n,t,mr(r))},yn.sortedIndexOf=function(n,t){ -var r=n?n.length:0;if(r){var e=Lt(n,t);if(r>e&&ae(n[e],t))return e}return-1},yn.sortedLastIndex=function(n,t){return Lt(n,t,true)},yn.sortedLastIndexBy=function(n,t,r){return $t(n,t,mr(r),true)},yn.sortedLastIndexOf=function(n,t){if(n&&n.length){var r=Lt(n,t,true)-1;if(ae(n[r],t))return r}return-1},yn.startCase=ei,yn.startsWith=function(n,t,r){return n=Ue(n),r=Xn(Re(r),0,n.length),n.lastIndexOf(t,r)==r},yn.subtract=function(n,t){var r;return n!==Z&&(r=n),t!==Z&&(r=r===Z?t:r-t),r},yn.sum=He,yn.sumBy=function(n,t){ -return n&&n.length?x(n,mr(t)):0},yn.template=function(n,t,r){var e=yn.templateSettings;r&&Sr(n,t,r)&&(t=Z),n=Ue(n),t=Mo({},t,e,Tn),r=Mo({},t.imports,e.imports,Tn);var u,o,i=$e(r),f=A(r,i),c=0;r=t.interpolate||xn;var a="__p+='";r=tu((t.escape||xn).source+"|"+r.source+"|"+(r===nn?sn:xn).source+"|"+(t.evaluate||xn).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(mn,W),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(T,""):a).replace(K,"$1").replace(G,"$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=oi(function(){return Function(i,l+"return "+a).apply(Z,f)}),t.source=a,_e(t))throw t;return t},yn.times=function(n,t){ -if(n=Re(n),1>n||n>9007199254740991)return[];var r=4294967295,e=Ru(n,4294967295);for(t=Mr(t),n-=4294967295,e=m(e,t);++r=o)return n; -if(o=r-M(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),we(u)){if(n.slice(o).search(u)){var f=r;for(u.global||(u=tu(u.source,Ue(hn.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},yn.unescape=function(n){return(n=Ue(n))&&Y.test(n)?n.replace(V,N):n},yn.uniqueId=function(n){var t=++fu;return Ue(n)+t},yn.upperCase=ui,yn.upperFirst=ti,yn.each=Qr, -yn.eachRight=Xr,yn.first=qr,Ve(yn,function(){var n={};return ct(yn,function(t,r){iu.call(yn.prototype,r)||(n[r]=t)}),n}(),{chain:false}),yn.VERSION="4.2.1",u("bind bindKey curry curryRight partial partialRight".split(" "),function(n){yn[n].placeholder=yn}),u(["drop","take"],function(n,t){An.prototype[n]=function(r){var e=this.__filtered__;if(e&&!t)return new An(this);r=r===Z?1:Iu(Re(r),0);var u=this.clone();return e?u.__takeCount__=Ru(r,u.__takeCount__):u.__views__.push({size:Ru(r,4294967295),type:n+(0>u.__dir__?"Right":"") -}),u},An.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),u(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;An.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:mr(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),u(["head","last"],function(n,t){var r="take"+(t?"Right":"");An.prototype[n]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");An.prototype[n]=function(){return this.__filtered__?new An(this):this[r](1); -}}),An.prototype.compact=function(){return this.filter(Ke)},An.prototype.find=function(n){return this.filter(n).head()},An.prototype.findLast=function(n){return this.reverse().find(n)},An.prototype.invokeMap=ce(function(n,t){return typeof n=="function"?new An(this):this.map(function(r){return vt(r,n,t)})}),An.prototype.reject=function(n){return n=mr(n,3),this.filter(function(t){return!n(t)})},An.prototype.slice=function(n,t){n=Re(n);var r=this;return r.__filtered__&&(n>0||0>t)?new An(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)), -t!==Z&&(t=Re(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},An.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},An.prototype.toArray=function(){return this.take(4294967295)},ct(An.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=yn[e?"take"+("last"==t?"Right":""):t],o=e||/^find/.test(t);u&&(yn.prototype[t]=function(){function t(n){return n=u.apply(yn,l([n],f)),e&&h?n[0]:n}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof An,a=f[0],s=c||Lo(i); -s&&r&&typeof a=="function"&&1!=a.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,a=o&&!h,c=c&&!p;return!o&&s?(i=c?i:new An(this),i=n.apply(i,f),i.__actions__.push({func:Yr,args:[t],thisArg:Z}),new wn(i,h)):a&&c?n.apply(this,f):(i=this.thru(t),a?e?i.value()[0]:i.value():i)})}),u("pop push shift sort splice unshift".split(" "),function(n){var t=eu[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);yn.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){ -return t.apply(r,n)})}}),ct(An.prototype,function(n,t){var r=yn[t];if(r){var e=r.name+"";(qu[e]||(qu[e]=[])).push({name:t,func:r})}}),qu[cr(Z,2).name]=[{name:"wrapper",func:Z}],An.prototype.clone=function(){var n=new An(this.__wrapped__);return n.__actions__=Vt(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Vt(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Vt(this.__views__),n},An.prototype.reverse=function(){if(this.__filtered__){var n=new An(this); -n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},An.prototype.value=function(){var n,t=this.__wrapped__.value(),r=this.__dir__,e=Lo(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 Zt(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}},yn.prototype.plant=function(n){for(var t,r=this;r instanceof jn;){var e=Nr(r);e.__index__=0,e.__values__=Z,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},yn.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof An?(this.__actions__.length&&(n=new An(this)),n=n.reverse(),n.__actions__.push({func:Yr,args:[Kr],thisArg:Z}),new wn(n,this.__chain__)):this.thru(Kr)},yn.prototype.toJSON=yn.prototype.valueOf=yn.prototype.value=function(){return Zt(this.__wrapped__,this.__actions__); -},bu&&(yn.prototype[bu]=Hr),yn}var Z,q=1/0,P=NaN,T=/\b__p\+='';/g,K=/\b(__p\+=)''\+/g,G=/(__e\(.*?\)|\b__t\))\+'';/g,V=/&(?:amp|lt|gt|quot|#39|#96);/g,J=/[&<>"'`]/g,Y=RegExp(V.source),H=RegExp(J.source),Q=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,nn=/<%=([\s\S]+?)%>/g,tn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rn=/^\w*$/,en=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,un=/[\\^$.*+?()[\]{}|]/g,on=RegExp(un.source),fn=/^\s+|\s+$/g,cn=/^\s+/,an=/\s+$/,ln=/\\(\\)?/g,sn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,hn=/\w*$/,pn=/^0x/i,_n=/^[-+]0x[0-9a-f]+$/i,gn=/^0b[01]+$/i,vn=/^\[object .+?Constructor\]$/,dn=/^0o[0-7]+$/i,yn=/^(?:0|[1-9]\d*)$/,bn=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xn=/($^)/,mn=/['\n\r\u2028\u2029\\]/g,jn="[\\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])?)*",wn="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+jn,An="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",On=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),En=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+An+jn,"g"),kn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),In=/[a-zA-Z0-9]+/g,Rn=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+",wn].join("|"),"g"),Sn=/[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wn="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(" "),Cn={}; -Cn["[object Float32Array]"]=Cn["[object Float64Array]"]=Cn["[object Int8Array]"]=Cn["[object Int16Array]"]=Cn["[object Int32Array]"]=Cn["[object Uint8Array]"]=Cn["[object Uint8ClampedArray]"]=Cn["[object Uint16Array]"]=Cn["[object Uint32Array]"]=true,Cn["[object Arguments]"]=Cn["[object Array]"]=Cn["[object ArrayBuffer]"]=Cn["[object Boolean]"]=Cn["[object Date]"]=Cn["[object Error]"]=Cn["[object Function]"]=Cn["[object Map]"]=Cn["[object Number]"]=Cn["[object Object]"]=Cn["[object RegExp]"]=Cn["[object Set]"]=Cn["[object String]"]=Cn["[object WeakMap]"]=false; -var Un={};Un["[object Arguments]"]=Un["[object Array]"]=Un["[object ArrayBuffer]"]=Un["[object Boolean]"]=Un["[object Date]"]=Un["[object Float32Array]"]=Un["[object Float64Array]"]=Un["[object Int8Array]"]=Un["[object Int16Array]"]=Un["[object Int32Array]"]=Un["[object Map]"]=Un["[object Number]"]=Un["[object Object]"]=Un["[object RegExp]"]=Un["[object Set]"]=Un["[object String]"]=Un["[object Symbol]"]=Un["[object Uint8Array]"]=Un["[object Uint8ClampedArray]"]=Un["[object Uint16Array]"]=Un["[object Uint32Array]"]=true, -Un["[object Error]"]=Un["[object Function]"]=Un["[object WeakMap]"]=false;var Bn={"\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={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ln={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},$n={"function":true,object:true},Fn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029" -},Mn=parseFloat,Nn=parseInt,Dn=$n[typeof exports]&&exports&&!exports.nodeType?exports:null,Zn=$n[typeof module]&&module&&!module.nodeType?module:null,qn=k($n[typeof self]&&self),Pn=k($n[typeof window]&&window),Tn=Zn&&Zn.exports===Dn?Dn:null,Kn=k($n[typeof this]&&this),Gn=k(Dn&&Zn&&typeof global=="object"&&global)||Pn!==(Kn&&Kn.window)&&Pn||qn||Kn||Function("return this")(),Vn=D();(Pn||qn||{})._=Vn,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Vn}):Dn&&Zn?(Tn&&((Zn.exports=Vn)._=Vn), -Dn._=Vn):Gn._=Vn}).call(this); \ No newline at end of file +var u=n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function p(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 S(n){return Un[n]}function R(n){return zn[n]}function W(n){return"\\"+$n[n]}function B(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 M(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():Ou.call(n,r,1),true)}function Zn(n,t){var r=qn(n,t);return 0>r?Z:n[r][1]}function qn(n,t){for(var r=n.length;r--;)if(se(n[r][0],t))return r;return-1}function Pn(n,t,r){var e=qn(n,t);0>e?n.push([t,r]):n[e][1]=r}function Tn(n,t,r,e){return n===Z||se(n,iu[r])&&!cu.call(e,r)?t:n}function Gn(n,t,r){(r!==Z&&!se(n[t],r)||typeof t=="number"&&r===Z&&!(t in n))&&(n[t]=r)}function Yn(n,t,r){var e=n[t];(!se(e,r)||se(e,iu[t])&&!cu.call(n,t)||r===Z&&!(t in n))&&(n[t]=r); +}function Hn(n,t,r,e){return Ju(n,function(n,u,o){t(e,n,r(n),o)}),e}function Qn(n,t){return n&&Ht(t,Fe(t),n)}function Xn(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 tt(n,t,r,e,o,i){var f;if(r&&(f=o?r(n,e,o,i):r(n)),f!==Z)return f;if(!xe(n))return n;if(e=No(n)){if(f=Ir(n),!t)return Yt(n,f)}else{var c=kr(n),a="[object Function]"==c||"[object GeneratorFunction]"==c;if(Do(n))return Kt(n,t); +if("[object Object]"!=c&&"[object Arguments]"!=c&&(!a||o))return Cn[c]?Rr(n,c,t):o?n:{};if(C(n))return o?n:{};if(f=Sr(a?{}:n),!t)return Xt(n,Qn(f,n))}return i||(i=new $n),(o=i.get(n))?o:(i.set(n,f),(e?u:at)(n,function(e,u){Yn(f,u,tt(e,t,r,u,n,i))}),e?f:Xt(n,f))}function rt(n){var t=Fe(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 et(n,t,r){if(typeof n!="function")throw new uu("Expected a function"); +return Au(function(){n.apply(Z,r)},t)}function ut(n,t,r,e){var u=-1,o=f,i=true,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=a(t,w(r))),e?(o=c,i=false):t.length>=200&&(o=Ln,i=false,t=new Mn(t));n:for(;++ur;)n=n[t[r++]];return r&&r==e?n:Z}function pt(n,t){return cu.call(n,t)||typeof n=="object"&&t in n&&null===xu(n)}function _t(n,t){return t in Object(n); +}function gt(n,t,r){for(var e=r?c:f,u=n.length,o=u,i=Array(u),l=[];o--;){var s=n[o];o&&t&&(s=a(s,w(t))),i[o]=r||!t&&120>s.length?Z:new Mn(o&&s)}var s=n[0],h=-1,p=s.length,_=i[0];n:for(;++h=f){e=c;break n}e=c*("desc"==r[e]?-1:1);break n}}e=n.b-t.b}return e})}function Et(n,t){return n=Object(n),s(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function It(n,t){var r={};return ct(n,function(n,e){t(n,e)&&(r[e]=n)}),r}function St(n){return function(t){return null==t?Z:t[n]}}function Rt(n){return function(t){return ht(t,n)}}function Wt(n,t,r){ +var e=-1,u=t.length,o=n;for(r&&(o=a(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 $t(n,t,Ve,r)}function $t(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=Eu((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 Bu(o,4294967294)}function Ft(n,t){for(var r=0,e=n.length,u=n[0],o=t?t(u):u,i=o,f=0,c=[u];++re?t[e]:Z);return i}function Kt(n,t){if(t)return n.slice();var r=new n.constructor(n.length);return n.copy(r),r}function Gt(n){var t=new n.constructor(n.byteLength);return new du(t).set(new du(n)),t}function Vt(n,t,r){for(var e=r.length,u=-1,o=Wu(n.length-e,0),i=-1,f=t.length,c=Array(f+o);++i1?r[u-1]:Z,i=u>2?r[2]:Z,o=typeof o=="function"?(u--, +o):Z;for(i&&Br(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?vr(n,t,lr,l,Z,c,f,Z,Z,e-i):r(a,this,c)}var o=fr(n);return u}function ar(n){return le(function(t){t=ft(t);var r=t.length,e=r,u=wn.prototype.thru; +for(n&&t.reverse();e--;){var o=t[e];if(typeof o!="function")throw new uu("Expected a function");if(u&&!i&&"wrapper"==mr(o))var i=new wn([],true)}for(e=i?e:r;++e=200)return i.plant(e).value();for(var u=0,n=r?t[u].apply(this,n):e;++uy)return vr(n,t,lr,b,r,x,j,f,c,a-y)}if(y=h?r:this,b=p?y[n]:n,f)for(var j=x.length,m=Bu(f.length,j),w=Yt(x);m--;){var A=f[m];x[m]=U(A,j)?w[A]:Z}else v&&x.length>1&&x.reverse();return s&&x.length>c&&(x.length=c),this&&this!==Vn&&this instanceof l&&(b=d||fr(b)),b.apply(y,x)}var s=128&t,h=1&t,p=2&t,_=8&t,g=16&t,v=512&t,d=p?Z:fr(n); +return l}function sr(n,t){return function(r,e){return vt(r,n,t(e),{})}}function hr(n){return le(function(t){return t=a(ft(t),wr()),le(function(e){var u=this;return n(t,function(n){return r(n,u,e)})})})}function pr(n,t,r){return t=We(t),n=F(n),t&&t>n?(t-=n,r=r===Z?" ":r+"",n=Te(r,ku(t/F(r))),En.test(r)?n.match(kn).slice(0,t).join(""):n.slice(0,t)):""}function _r(n,t,e,u){function o(){for(var t=-1,c=arguments.length,a=-1,l=u.length,s=Array(l+c),h=this&&this!==Vn&&this instanceof o?f:n;++at?1:-1:Ce(e)||0;var u=-1;r=Wu(ku((r-t)/(e||1)),0);for(var o=Array(r);r--;)o[n?r:++u]=t,t+=e;return o}}function vr(n,t,r,e,u,o,i,f,c,a){var l=8&t;f=f?Yt(f):Z;var s=l?i:Z;i=l?Z:i;var h=l?o:Z;return o=l?Z:o,t=(t|(l?32:64))&~(l?64:32),4&t||(t&=-4),t=[n,t,u,h,s,o,i,f,c,a],r=r.apply(Z,t), +zr(n)&&uo(r,t),r.placeholder=e,r}function dr(n){var t=ru[n];return function(n,r){if(n=Ce(n),r=We(r)){var e=(ze(n)+"e").split("e"),e=t(e[0]+"e"+(+e[1]+r)),e=(ze(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return t(n)}}function yr(n,t,r,e,u,o,i,f){var c=2&t;if(!c&&typeof n!="function")throw new uu("Expected a function");var a=e?e.length:0;if(a||(t&=-97,e=u=Z),i=i===Z?i:Wu(We(i),0),f=f===Z?f:We(f),a-=u?u.length:0,64&t){var l=e,s=u;e=u=Z}var h=c?Z:to(n);return o=[n,t,r,e,u,l,s,o,i,f],h&&(r=o[1],n=h[1], +t=r|n,e=128==n&&8==r||128==n&&256==r&&h[8]>=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?Vt(e,r,h[4]):Yt(r),o[4]=e?L(o[3],"__lodash_placeholder__"):Yt(h[4])),(r=h[5])&&(e=o[5],o[5]=e?Jt(e,r,h[6]):Yt(r),o[6]=e?L(o[5],"__lodash_placeholder__"):Yt(h[6])),(r=h[7])&&(o[7]=Yt(r)),128&n&&(o[8]=null==o[8]?h[8]:Bu(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),c=t&&1!=t?8==t||16==t?cr(n,t,f):32!=t&&33!=t||u.length?lr.apply(Z,o):_r(n,t,r,e):ur(n,t,r),(h?Xu:uo)(c,o)}function br(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 Pr(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:We(t),t=e-t,zt(n,0,0>t?0:t)):[]}function Tr(n){return n?n[0]:Z}function Kr(n){var t=n?n.length:0;return t?n[t-1]:Z}function Gr(n,t){return n&&n.length&&t&&t.length?Wt(n,t):n; +}function Vr(n){return n?zu.call(n):n}function Jr(n){if(!n||!n.length)return[];var t=0;return n=i(n,function(n){return ge(n)?(t=Wu(n.length,t),true):void 0}),j(t,function(t){return a(n,St(t))})}function Yr(n,t){if(!n||!n.length)return[];var e=Jr(n);return null==t?e:a(e,function(n){return r(t,Z,n)})}function Hr(n){return n=yn(n),n.__chain__=true,n}function Qr(n,t){return t(n)}function Xr(){return this}function ne(n,t){return typeof t=="function"&&No(n)?u(n,t):Ju(n,Dr(t))}function te(n,t){var r;if(typeof t=="function"&&No(n)){ +for(r=n.length;r--&&false!==t(n[r],r,n););r=n}else r=Yu(n,Dr(t));return r}function re(n,t){return(No(n)?a:mt)(n,wr(t,3))}function ee(n,t){var r=-1,e=Re(n),u=e.length,o=u-1;for(t=nt(We(t),0,u);++r=n&&(t=Z),r}}function ie(n,t,r){ +return t=r?Z:t,n=yr(n,8,Z,Z,Z,Z,Z,t),n.placeholder=yn.placeholder||ie.placeholder,n}function fe(n,t,r){return t=r?Z:t,n=yr(n,16,Z,Z,Z,Z,Z,t),n.placeholder=yn.placeholder||fe.placeholder,n}function ce(n,t,r){function e(){p&&yu(p),a&&yu(a),g=0,c=a=h=p=_=Z}function u(t,r){r&&yu(r),a=p=_=Z,t&&(g=Wo(),l=n.apply(h,c),p||a||(c=h=Z))}function o(){var n=t-(Wo()-s);0>=n||n>t?u(_,a):p=Au(o,n)}function i(){u(y,p)}function f(){if(c=arguments,s=Wo(),h=this,_=y&&(p||!v),false===d)var r=v&&!p;else{g||a||v||(g=s);var e=d-(s-g),u=0>=e||e>d; +u?(a&&(a=yu(a)),g=s,l=n.apply(h,c)):a||(a=Au(i,e))}return u&&p?p=yu(p):p||t===d||(p=Au(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 uu("Expected a function");return t=Ce(t)||0,xe(r)&&(v=!!r.leading,d="maxWait"in r&&Wu(Ce(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 ae(n,t){if(typeof n!="function"||t&&typeof t!="function")throw new uu("Expected a function"); +var r=function(){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)};return r.cache=new ae.Cache,r}function le(n,t){if(typeof n!="function")throw new uu("Expected a function");return t=Wu(t===Z?n.length-1:We(t),0),function(){for(var e=arguments,u=-1,o=Wu(e.length-t,0),i=Array(o);++ut}function pe(n){return ge(n)&&cu.call(n,"callee")&&(!wu.call(n,"callee")||"[object Arguments]"==su.call(n))}function _e(n){return null!=n&&!(typeof n=="function"&&de(n))&&be(ro(n))}function ge(n){return je(n)&&_e(n)}function ve(n){return je(n)&&typeof n.message=="string"&&"[object Error]"==su.call(n)}function de(n){return n=xe(n)?su.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function ye(n){ +return typeof n=="number"&&n==We(n)}function be(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function xe(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function je(n){return!!n&&typeof n=="object"}function me(n){return null==n?false:de(n)?pu.test(fu.call(n)):je(n)&&(C(n)?pu:vn).test(n)}function we(n){return typeof n=="number"||je(n)&&"[object Number]"==su.call(n)}function Ae(n){if(!je(n)||"[object Object]"!=su.call(n)||C(n))return false;var t=iu;return typeof n.constructor=="function"&&(t=xu(n)), +null===t?true:(n=t.constructor,typeof n=="function"&&n instanceof n&&fu.call(n)==lu)}function Oe(n){return xe(n)&&"[object RegExp]"==su.call(n)}function ke(n){return typeof n=="string"||!No(n)&&je(n)&&"[object String]"==su.call(n)}function Ee(n){return typeof n=="symbol"||je(n)&&"[object Symbol]"==su.call(n)}function Ie(n){return je(n)&&be(n.length)&&!!Bn[su.call(n)]}function Se(n,t){return t>n}function Re(n){if(!n)return[];if(_e(n))return ke(n)?n.match(kn):Yt(n);if(mu&&n[mu])return z(n[mu]());var t=kr(n); +return("[object Map]"==t?M:"[object Set]"==t?$:Ze)(n)}function We(n){if(!n)return 0===n?n:0;if(n=Ce(n),n===q||n===-q)return 1.7976931348623157e308*(0>n?-1:1);var t=n%1;return n===n?t?n-t:n:0}function Be(n){return n?nt(We(n),0,4294967295):0}function Ce(n){if(xe(n)&&(n=de(n.valueOf)?n.valueOf():n,n=xe(n)?n+"":n),typeof n!="string")return 0===n?n:+n;n=n.replace(fn,"");var t=gn.test(n);return t||dn.test(n)?Nn(n.slice(2),t?2:8):_n.test(n)?P:+n}function Ue(n){return Ht(n,Ne(n))}function ze(n){if(typeof n=="string")return n; +if(null==n)return"";if(Ee(n))return vu?Ku.call(n):"";var t=n+"";return"0"==t&&1/n==-q?"-0":t}function Me(n,t,r){return n=null==n?Z:ht(n,t),n===Z?r:n}function Le(n,t){return Er(n,t,pt)}function $e(n,t){return Er(n,t,_t)}function Fe(n){var t=Mr(n);if(!t&&!_e(n))return Ru(Object(n));var r,e=Wr(n),u=!!e,e=e||[],o=e.length;for(r in n)!pt(n,r)||u&&("length"==r||U(r,o))||t&&"constructor"==r||e.push(r);return e}function Ne(n){for(var t=-1,r=Mr(n),e=jt(n),u=e.length,o=Wr(n),i=!!o,o=o||[],f=o.length;++tt||t>9007199254740991)return r;do t%2&&(r+=n),t=Eu(t/2),n+=n;while(t);return r}function Ke(n,t,r){return n=ze(n),t=r?Z:t,t===Z&&(t=Rn.test(n)?Sn:In),n.match(t)||[]}function Ge(n){ +return function(){return n}}function Ve(n){return n}function Je(n){return xt(typeof n=="function"?n:tt(n,true))}function Ye(n,t,r){var e=Fe(t),o=st(t,e);null!=r||xe(t)&&(o.length||!e.length)||(r=t,t=n,n=this,o=st(t,Fe(t)));var i=xe(r)&&"chain"in r?r.chain:true,f=de(n);return u(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__=Yt(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,l([this.value()],arguments)); +})}),n}function He(){}function Qe(n){return Cr(n)?St(n):Rt(n)}function Xe(n){return n&&n.length?x(n,Ve):0}E=E?Jn.defaults({},E,Jn.pick(Vn,Wn)):Vn;var nu=E.Date,tu=E.Error,ru=E.Math,eu=E.RegExp,uu=E.TypeError,ou=E.Array.prototype,iu=E.Object.prototype,fu=E.Function.prototype.toString,cu=iu.hasOwnProperty,au=0,lu=fu.call(Object),su=iu.toString,hu=Vn._,pu=eu("^"+fu.call(cu).replace(un,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_u=Kn?E.Buffer:Z,gu=E.Reflect,vu=E.Symbol,du=E.Uint8Array,yu=E.clearTimeout,bu=gu?gu.enumerate:Z,xu=Object.getPrototypeOf,ju=Object.getOwnPropertySymbols,mu=typeof(mu=vu&&vu.iterator)=="symbol"?mu:Z,wu=iu.propertyIsEnumerable,Au=E.setTimeout,Ou=ou.splice,ku=ru.ceil,Eu=ru.floor,Iu=E.isFinite,Su=ou.join,Ru=Object.keys,Wu=ru.max,Bu=ru.min,Cu=E.parseInt,Uu=ru.random,zu=ou.reverse,Mu=Or(E,"Map"),Lu=Or(E,"Set"),$u=Or(E,"WeakMap"),Fu=Or(Object,"create"),Nu=$u&&new $u,Du=Mu?fu.call(Mu):"",Zu=Lu?fu.call(Lu):"",qu=$u?fu.call($u):"",Pu=vu?vu.prototype:Z,Tu=vu?Pu.valueOf:Z,Ku=vu?Pu.toString:Z,Gu={}; +yn.templateSettings={escape:Q,evaluate:X,interpolate:nn,variable:"",imports:{_:yn}};var Vu=function(){function n(){}return function(t){if(xe(t)){n.prototype=t;var r=new n;n.prototype=Z}return r||{}}}(),Ju=rr(at),Yu=rr(lt,true),Hu=er(),Qu=er(true);bu&&!wu.call({valueOf:1},"valueOf")&&(jt=function(n){return z(bu(n))});var Xu=Nu?function(n,t){return Nu.set(n,t),n}:Ve,no=Lu&&2===new Lu([1,2]).size?function(n){return new Lu(n)}:He,to=Nu?function(n){return Nu.get(n)}:He,ro=St("length"),eo=ju||function(){return[]; +};(Mu&&"[object Map]"!=kr(new Mu)||Lu&&"[object Set]"!=kr(new Lu)||$u&&"[object WeakMap]"!=kr(new $u))&&(kr=function(n){var t=su.call(n);if(n="[object Object]"==t?n.constructor:null,n=typeof n=="function"?fu.call(n):"")switch(n){case Du:return"[object Map]";case Zu:return"[object Set]";case qu:return"[object WeakMap]"}return t});var uo=function(){var n=0,t=0;return function(r,e){var u=Wo(),o=16-(u-t);if(t=u,o>0){if(150<=++n)return r}else n=0;return Xu(r,e)}}(),oo=le(function(n,t){No(n)||(n=null==n?[]:[Object(n)]), +t=ft(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 Yr(n,t)}),Ao=le(function(n){n=ft(n);var t=n.length,r=t?n[0]:0,e=this.__wrapped__,u=function(t){return Xn(t,n)};return 1>=t&&!this.__actions__.length&&e instanceof An&&U(r)?(e=e.slice(r,+r+(t?1:0)),e.__actions__.push({func:Qr,args:[u],thisArg:Z}),new wn(e,this.__chain__).thru(function(n){return t&&!n.length&&n.push(Z), +n})):this.thru(u)}),Oo=nr(function(n,t,r){cu.call(n,r)?++n[r]:n[r]=1}),ko=nr(function(n,t,r){cu.call(n,r)?n[r].push(t):n[r]=[t]}),Eo=le(function(n,t,e){var u=-1,o=typeof t=="function",i=Cr(t),f=_e(n)?Array(n.length):[];return Ju(n,function(n){var c=o?t:i&&null!=n?n[t]:Z;f[++u]=c?r(c,n,e):dt(n,t,e)}),f}),Io=nr(function(n,t,r){n[r]=t}),So=nr(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),Ro=le(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Br(n,t[0],t[1])?t=[]:r>2&&Br(t[0],t[1],t[2])&&(t.length=1), +kt(n,ft(t),[])}),Wo=nu.now,Bo=le(function(n,t,r){var e=1;if(r.length)var u=L(r,yn.placeholder||Bo.placeholder),e=32|e;return yr(n,e,t,r,u)}),Co=le(function(n,t,r){var e=3;if(r.length)var u=L(r,yn.placeholder||Co.placeholder),e=32|e;return yr(t,e,n,r,u)}),Uo=le(function(n,t){return et(n,1,t)}),zo=le(function(n,t,r){return et(n,Ce(t)||0,r)}),Mo=le(function(n,t){t=a(ft(t),wr());var e=t.length;return le(function(u){for(var o=-1,i=Bu(u.length,e);++oe.length?Pn(e,n,t):(r.array=null,r.map=new zn(e))),(r=r.map)&&r.set(n,t),this},ae.Cache=zn,yn.after=function(n,t){if(typeof t!="function")throw new uu("Expected a function");return n=We(n),function(){return 1>--n?t.apply(this,arguments):void 0}},yn.ary=ue,yn.assign=Zo,yn.assignIn=qo,yn.assignInWith=Po,yn.assignWith=To,yn.at=Ko,yn.before=oe,yn.bind=Bo,yn.bindAll=si,yn.bindKey=Co,yn.chain=Hr,yn.chunk=function(n,t){t=Wu(We(t),0); +var r=n?n.length:0;if(!r||1>t)return[];for(var e=0,u=-1,o=Array(ku(r/t));r>e;)o[++u]=zt(n,e,e+=t);return o},yn.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:We(e),0>e&&(e+=u),e=r>e?0:Be(e);e>r;)n[r++]=t;return n},yn.filter=function(n,t){return(No(n)?i:it)(n,wr(t,3))},yn.flatMap=function(n,t){return ft(re(n,t))},yn.flatten=function(n){return n&&n.length?ft(n):[]},yn.flattenDeep=function(n){return n&&n.length?ft(n,true):[]},yn.flip=function(n){return yr(n,512)},yn.flow=hi,yn.flowRight=pi,yn.fromPairs=function(n){for(var t=-1,r=n?n.length:0,e={};++tt?0:t)):[]},yn.takeRight=function(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:We(t),t=e-t,zt(n,0>t?0:t,e)):[]},yn.takeRightWhile=function(n,t){return n&&n.length?Zt(n,wr(t,3),false,true):[]},yn.takeWhile=function(n,t){return n&&n.length?Zt(n,wr(t,3)):[]},yn.tap=function(n,t){return t(n),n},yn.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new uu("Expected a function");return xe(r)&&(e="leading"in r?!!r.leading:e, +u="trailing"in r?!!r.trailing:u),ce(n,t,{leading:e,maxWait:t,trailing:u})},yn.thru=Qr,yn.toArray=Re,yn.toPairs=De,yn.toPairsIn=function(n){return m(n,Ne(n))},yn.toPath=function(n){return No(n)?a(n,String):Fr(n)},yn.toPlainObject=Ue,yn.transform=function(n,t,r){var e=No(n)||Ie(n);if(t=wr(t,4),null==r)if(e||xe(n)){var o=n.constructor;r=e?No(n)?new o:[]:Vu(de(o)?o.prototype:Z)}else r={};return(e?u:at)(n,function(n,e,u){return t(r,n,e,u)}),r},yn.unary=function(n){return ue(n,1)},yn.union=_o,yn.unionBy=go, +yn.unionWith=vo,yn.uniq=function(n){return n&&n.length?Dt(n):[]},yn.uniqBy=function(n,t){return n&&n.length?Dt(n,wr(t)):[]},yn.uniqWith=function(n,t){return n&&n.length?Dt(n,Z,t):[]},yn.unset=function(n,t){var r;if(null==n)r=true;else{r=n;var e=t,e=Cr(e,r)?[e+""]:Nt(e);r=$r(r,e),e=Kr(e),r=null!=r&&Le(r,e)?delete r[e]:true}return r},yn.unzip=Jr,yn.unzipWith=Yr,yn.values=Ze,yn.valuesIn=function(n){return null==n?A(n,Ne(n)):[]},yn.without=yo,yn.words=Ke,yn.wrap=function(n,t){return t=null==t?Ve:t,Lo(t,n); +},yn.xor=bo,yn.xorBy=xo,yn.xorWith=jo,yn.zip=mo,yn.zipObject=function(n,t){return Tt(n||[],t||[],Yn)},yn.zipObjectDeep=function(n,t){return Tt(n||[],t||[],Ut)},yn.zipWith=wo,yn.extend=qo,yn.extendWith=Po,Ye(yn,yn),yn.add=function(n,t){var r;return n===Z&&t===Z?0:(n!==Z&&(r=n),t!==Z&&(r=r===Z?t:r+t),r)},yn.attempt=li,yn.camelCase=ri,yn.capitalize=qe,yn.ceil=ji,yn.clamp=function(n,t,r){return r===Z&&(r=t,t=Z),r!==Z&&(r=Ce(r),r=r===r?r:0),t!==Z&&(t=Ce(t),t=t===t?t:0),nt(Ce(n),t,r)},yn.clone=function(n){ +return tt(n)},yn.cloneDeep=function(n){return tt(n,true)},yn.cloneDeepWith=function(n,t){return tt(n,true,t)},yn.cloneWith=function(n,t){return tt(n,false,t)},yn.deburr=Pe,yn.endsWith=function(n,t,r){n=ze(n),t=typeof t=="string"?t:t+"";var e=n.length;return r=r===Z?e:nt(We(r),0,e),r-=t.length,r>=0&&n.indexOf(t,r)==r},yn.eq=se,yn.escape=function(n){return(n=ze(n))&&H.test(n)?n.replace(J,R):n},yn.escapeRegExp=function(n){return(n=ze(n))&&on.test(n)?n.replace(un,"\\$&"):n},yn.every=function(n,t,r){var e=No(n)?o:ot; +return r&&Br(n,t,r)&&(t=Z),e(n,wr(t,3))},yn.find=function(n,t){if(t=wr(t,3),No(n)){var r=v(n,t);return r>-1?n[r]:Z}return g(n,t,Ju)},yn.findIndex=function(n,t){return n&&n.length?v(n,wr(t,3)):-1},yn.findKey=function(n,t){return g(n,wr(t,3),at,true)},yn.findLast=function(n,t){if(t=wr(t,3),No(n)){var r=v(n,t,true);return r>-1?n[r]:Z}return g(n,t,Yu)},yn.findLastIndex=function(n,t){return n&&n.length?v(n,wr(t,3),true):-1},yn.findLastKey=function(n,t){return g(n,wr(t,3),lt,true)},yn.floor=mi,yn.forEach=ne,yn.forEachRight=te, +yn.forIn=function(n,t){return null==n?n:Hu(n,Dr(t),Ne)},yn.forInRight=function(n,t){return null==n?n:Qu(n,Dr(t),Ne)},yn.forOwn=function(n,t){return n&&at(n,Dr(t))},yn.forOwnRight=function(n,t){return n&<(n,Dr(t))},yn.get=Me,yn.gt=he,yn.gte=function(n,t){return n>=t},yn.has=Le,yn.hasIn=$e,yn.head=Tr,yn.identity=Ve,yn.includes=function(n,t,r,e){return n=_e(n)?n:Ze(n),r=r&&!e?We(r):0,e=n.length,0>r&&(r=Wu(e+r,0)),ke(n)?e>=r&&-1r&&(r=Wu(e+r,0)),d(n,t,r)):-1},yn.inRange=function(n,t,r){return t=Ce(t)||0,r===Z?(r=t,t=0):r=Ce(r)||0,n=Ce(n),n>=Bu(t,r)&&n=-9007199254740991&&9007199254740991>=n},yn.isSet=function(n){return je(n)&&"[object Set]"==kr(n)},yn.isString=ke,yn.isSymbol=Ee, +yn.isTypedArray=Ie,yn.isUndefined=function(n){return n===Z},yn.isWeakMap=function(n){return je(n)&&"[object WeakMap]"==kr(n)},yn.isWeakSet=function(n){return je(n)&&"[object WeakSet]"==su.call(n)},yn.join=function(n,t){return n?Su.call(n,t):""},yn.kebabCase=ei,yn.last=Kr,yn.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(r!==Z&&(u=We(r),u=(0>u?Wu(e+u,0):Bu(u,e-1))+1),t!==t)return B(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},yn.lowerCase=ui,yn.lowerFirst=oi,yn.lt=Se, +yn.lte=function(n,t){return t>=n},yn.max=function(n){return n&&n.length?_(n,Ve,he):Z},yn.maxBy=function(n,t){return n&&n.length?_(n,wr(t),he):Z},yn.mean=function(n){return Xe(n)/(n?n.length:0)},yn.min=function(n){return n&&n.length?_(n,Ve,Se):Z},yn.minBy=function(n,t){return n&&n.length?_(n,wr(t),Se):Z},yn.noConflict=function(){return Vn._===this&&(Vn._=hu),this},yn.noop=He,yn.now=Wo,yn.pad=function(n,t,r){n=ze(n),t=We(t);var e=F(n);return t&&t>e?(e=(t-e)/2,t=Eu(e),e=ku(e),pr("",t,r)+n+pr("",e,r)):n; +},yn.padEnd=function(n,t,r){return n=ze(n),n+pr(n,t,r)},yn.padStart=function(n,t,r){return n=ze(n),pr(n,t,r)+n},yn.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),n=ze(n).replace(fn,""),Cu(n,t||(pn.test(n)?16:10))},yn.random=function(n,t,r){if(r&&typeof r!="boolean"&&Br(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=Ce(n)||0,t===Z?(t=n,n=0):t=Ce(t)||0),n>t){var e=n;n=t,t=e}return r||n%1||t%1?(r=Uu(),Bu(n+r*(t-n+Fn("1e-"+((r+"").length-1))),t)):Ct(n,t); +},yn.reduce=function(n,t,r){var e=No(n)?s:y,u=3>arguments.length;return e(n,wr(t,4),r,u,Ju)},yn.reduceRight=function(n,t,r){var e=No(n)?h:y,u=3>arguments.length;return e(n,wr(t,4),r,u,Yu)},yn.repeat=Te,yn.replace=function(){var n=arguments,t=ze(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},yn.result=function(n,t,r){if(Cr(t,n))e=null==n?Z:n[t];else{t=Nt(t);var e=Me(n,t);n=$r(n,t)}return e===Z&&(e=r),de(e)?e.call(n):e},yn.round=wi,yn.runInContext=D,yn.sample=function(n){n=_e(n)?n:Ze(n);var t=n.length; +return t>0?n[Ct(0,t-1)]:Z},yn.size=function(n){if(null==n)return 0;if(_e(n)){var t=n.length;return t&&ke(n)?F(n):t}return Fe(n).length},yn.snakeCase=fi,yn.some=function(n,t,r){var e=No(n)?p:Mt;return r&&Br(n,t,r)&&(t=Z),e(n,wr(t,3))},yn.sortedIndex=function(n,t){return Lt(n,t)},yn.sortedIndexBy=function(n,t,r){return $t(n,t,wr(r))},yn.sortedIndexOf=function(n,t){var r=n?n.length:0;if(r){var e=Lt(n,t);if(r>e&&se(n[e],t))return e}return-1},yn.sortedLastIndex=function(n,t){return Lt(n,t,true)},yn.sortedLastIndexBy=function(n,t,r){ +return $t(n,t,wr(r),true)},yn.sortedLastIndexOf=function(n,t){if(n&&n.length){var r=Lt(n,t,true)-1;if(se(n[r],t))return r}return-1},yn.startCase=ci,yn.startsWith=function(n,t,r){return n=ze(n),r=nt(We(r),0,n.length),n.lastIndexOf(t,r)==r},yn.subtract=function(n,t){var r;return n===Z&&t===Z?0:(n!==Z&&(r=n),t!==Z&&(r=r===Z?t:r-t),r)},yn.sum=Xe,yn.sumBy=function(n,t){return n&&n.length?x(n,wr(t)):0},yn.template=function(n,t,r){var e=yn.templateSettings;r&&Br(n,t,r)&&(t=Z),n=ze(n),t=Po({},t,e,Tn),r=Po({},t.imports,e.imports,Tn); +var u,o,i=Fe(r),f=A(r,i),c=0;r=t.interpolate||xn;var a="__p+='";r=eu((t.escape||xn).source+"|"+r.source+"|"+(r===nn?sn:xn).source+"|"+(t.evaluate||xn).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(jn,W),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(T,""):a).replace(K,"$1").replace(G,"$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=li(function(){return Function(i,l+"return "+a).apply(Z,f)}),t.source=a,ve(t))throw t;return t},yn.times=function(n,t){if(n=We(n),1>n||n>9007199254740991)return[];var r=4294967295,e=Bu(n,4294967295);for(t=Dr(t),n-=4294967295,e=j(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),Oe(u)){if(n.slice(o).search(u)){var f=r;for(u.global||(u=eu(u.source,ze(hn.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},yn.unescape=function(n){return(n=ze(n))&&Y.test(n)?n.replace(V,N):n},yn.uniqueId=function(n){var t=++au;return ze(n)+t},yn.upperCase=ai,yn.upperFirst=ii,yn.each=ne,yn.eachRight=te,yn.first=Tr,Ye(yn,function(){var n={};return at(yn,function(t,r){cu.call(yn.prototype,r)||(n[r]=t)}),n}(),{chain:false}),yn.VERSION="4.3.0",u("bind bindKey curry curryRight partial partialRight".split(" "),function(n){yn[n].placeholder=yn; +}),u(["drop","take"],function(n,t){An.prototype[n]=function(r){var e=this.__filtered__;if(e&&!t)return new An(this);r=r===Z?1:Wu(We(r),0);var u=this.clone();return e?u.__takeCount__=Bu(r,u.__takeCount__):u.__views__.push({size:Bu(r,4294967295),type:n+(0>u.__dir__?"Right":"")}),u},An.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),u(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;An.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({ +iteratee:wr(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),u(["head","last"],function(n,t){var r="take"+(t?"Right":"");An.prototype[n]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");An.prototype[n]=function(){return this.__filtered__?new An(this):this[r](1)}}),An.prototype.compact=function(){return this.filter(Ve)},An.prototype.find=function(n){return this.filter(n).head()},An.prototype.findLast=function(n){return this.reverse().find(n); +},An.prototype.invokeMap=le(function(n,t){return typeof n=="function"?new An(this):this.map(function(r){return dt(r,n,t)})}),An.prototype.reject=function(n){return n=wr(n,3),this.filter(function(t){return!n(t)})},An.prototype.slice=function(n,t){n=We(n);var r=this;return r.__filtered__&&(n>0||0>t)?new An(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==Z&&(t=We(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},An.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},An.prototype.toArray=function(){ +return this.take(4294967295)},at(An.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=yn[e?"take"+("last"==t?"Right":""):t],o=e||/^find/.test(t);u&&(yn.prototype[t]=function(){var t=this.__wrapped__,i=e?[1]:arguments,f=t instanceof An,c=i[0],a=f||No(t),s=function(n){return n=u.apply(yn,l([n],i)),e&&h?n[0]:n};a&&r&&typeof c=="function"&&1!=c.length&&(f=a=false);var h=this.__chain__,p=!!this.__actions__.length,c=o&&!h,f=f&&!p;return!o&&a?(t=f?t:new An(this), +t=n.apply(t,i),t.__actions__.push({func:Qr,args:[s],thisArg:Z}),new wn(t,h)):c&&f?n.apply(this,i):(t=this.thru(s),c?e?t.value()[0]:t.value():t)})}),u("pop push shift sort splice unshift".split(" "),function(n){var t=ou[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);yn.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),at(An.prototype,function(n,t){var r=yn[t];if(r){var e=r.name+"";(Gu[e]||(Gu[e]=[])).push({ +name:t,func:r})}}),Gu[lr(Z,2).name]=[{name:"wrapper",func:Z}],An.prototype.clone=function(){var n=new An(this.__wrapped__);return n.__actions__=Yt(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Yt(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Yt(this.__views__),n},An.prototype.reverse=function(){if(this.__filtered__){var n=new An(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},An.prototype.value=function(){ +var n,t=this.__wrapped__.value(),r=this.__dir__,e=No(t),u=0>r,o=e?t.length:0;n=0;for(var i=o,f=this.__views__,c=-1,a=f.length;++co||o==n&&a==n)return qt(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}},yn.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},yn.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof An?(this.__actions__.length&&(n=new An(this)),n=n.reverse(),n.__actions__.push({func:Qr,args:[Vr],thisArg:Z}),new wn(n,this.__chain__)):this.thru(Vr)},yn.prototype.toJSON=yn.prototype.valueOf=yn.prototype.value=function(){return qt(this.__wrapped__,this.__actions__)},mu&&(yn.prototype[mu]=Xr), +yn}var Z,q=1/0,P=NaN,T=/\b__p\+='';/g,K=/\b(__p\+=)''\+/g,G=/(__e\(.*?\)|\b__t\))\+'';/g,V=/&(?:amp|lt|gt|quot|#39|#96);/g,J=/[&<>"'`]/g,Y=RegExp(V.source),H=RegExp(J.source),Q=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,nn=/<%=([\s\S]+?)%>/g,tn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rn=/^\w*$/,en=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,un=/[\\^$.*+?()[\]{}|]/g,on=RegExp(un.source),fn=/^\s+|\s+$/g,cn=/^\s+/,an=/\s+$/,ln=/\\(\\)?/g,sn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,hn=/\w*$/,pn=/^0x/i,_n=/^[-+]0x[0-9a-f]+$/i,gn=/^0b[01]+$/i,vn=/^\[object .+?Constructor\]$/,dn=/^0o[0-7]+$/i,yn=/^(?:0|[1-9]\d*)$/,bn=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xn=/($^)/,jn=/['\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])?)*",wn="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+mn,An="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",On=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),kn=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+An+mn,"g"),En=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),In=/[a-zA-Z0-9]+/g,Sn=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+",wn].join("|"),"g"),Rn=/[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wn="Array Buffer 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(" "),Bn={}; +Bn["[object Float32Array]"]=Bn["[object Float64Array]"]=Bn["[object Int8Array]"]=Bn["[object Int16Array]"]=Bn["[object Int32Array]"]=Bn["[object Uint8Array]"]=Bn["[object Uint8ClampedArray]"]=Bn["[object Uint16Array]"]=Bn["[object Uint32Array]"]=true,Bn["[object Arguments]"]=Bn["[object Array]"]=Bn["[object ArrayBuffer]"]=Bn["[object Boolean]"]=Bn["[object Date]"]=Bn["[object Error]"]=Bn["[object Function]"]=Bn["[object Map]"]=Bn["[object Number]"]=Bn["[object Object]"]=Bn["[object RegExp]"]=Bn["[object Set]"]=Bn["[object String]"]=Bn["[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={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Mn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ln={"function":true,object:true},$n={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029" +},Fn=parseFloat,Nn=parseInt,Dn=Ln[typeof exports]&&exports&&!exports.nodeType?exports:null,Zn=Ln[typeof module]&&module&&!module.nodeType?module:null,qn=E(Dn&&Zn&&typeof global=="object"&&global),Pn=E(Ln[typeof self]&&self),Tn=E(Ln[typeof window]&&window),Kn=Zn&&Zn.exports===Dn?Dn:null,Gn=E(Ln[typeof this]&&this),Vn=qn||Tn!==(Gn&&Gn.window)&&Tn||Pn||Gn||Function("return this")(),Jn=D();(Tn||Pn||{})._=Jn,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Jn; +}):Dn&&Zn?(Kn&&((Zn.exports=Jn)._=Jn),Dn._=Jn):Vn._=Jn}).call(this); \ No newline at end of file diff --git a/dist/mapping.fp.js b/dist/mapping.fp.js index ed1dfc73ec..d012b2e30a 100644 --- a/dist/mapping.fp.js +++ b/dist/mapping.fp.js @@ -282,6 +282,10 @@ return /******/ (function(modules) { // webpackBootstrap 'assignIn': true, 'concat': true, 'difference': true, + 'gt': true, + 'gte': true, + 'lt': true, + 'lte': true, 'matchesProperty': true, 'merge': true, 'partial': true, diff --git a/doc/README.md b/doc/README.md index d6aa8342c7..86924f0193 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,4 +1,4 @@ -# lodash v4.2.1 +# lodash v4.3.0 @@ -150,9 +150,11 @@ * `_.gte` * `_.isArguments` * `_.isArray` +* `_.isArrayBuffer` * `_.isArrayLike` * `_.isArrayLikeObject` * `_.isBoolean` +* `_.isBuffer` * `_.isDate` * `_.isElement` * `_.isEmpty` @@ -163,6 +165,7 @@ * `_.isFunction` * `_.isInteger` * `_.isLength` +* `_.isMap` * `_.isMatch` * `_.isMatchWith` * `_.isNaN` @@ -175,10 +178,13 @@ * `_.isPlainObject` * `_.isRegExp` * `_.isSafeInteger` +* `_.isSet` * `_.isString` * `_.isSymbol` * `_.isTypedArray` * `_.isUndefined` +* `_.isWeakMap` +* `_.isWeakSet` * `_.lt` * `_.lte` * `_.toArray` @@ -389,7 +395,7 @@ ### `_.chunk(array, [size=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5359 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.chunk "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5385 "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 +423,7 @@ _.chunk(['a', 'b', 'c', 'd'], 3); ### `_.compact(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5390 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.compact "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5416 "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 +446,7 @@ _.compact([0, 1, false, 2, '', 3]); ### `_.concat(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5426 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.concat "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5452 "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,10 +476,10 @@ console.log(array); ### `_.difference(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5450 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.difference "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5476 "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) +given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) for equality comparisons. #### Arguments @@ -495,7 +501,7 @@ _.difference([3, 2, 1], [4, 2]); ### `_.differenceBy(array, [values], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5477 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differenceby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5503 "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 +531,7 @@ _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); ### `_.differenceWith(array, [values], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5506 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differencewith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5532 "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 +559,7 @@ _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); ### `_.drop(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5540 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.drop "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5566 "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 +591,7 @@ _.drop([1, 2, 3], 0); ### `_.dropRight(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5573 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5599 "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 +623,7 @@ _.dropRight([1, 2, 3], 0); ### `_.dropRightWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5617 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5643 "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 +666,7 @@ _.dropRightWhile(users, 'active'); ### `_.dropWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5657 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropwhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5683 "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 +709,7 @@ _.dropWhile(users, 'active'); ### `_.fill(array, value, [start=0], [end=array.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5691 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.fill "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5717 "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 +747,7 @@ _.fill([4, 6, 8, 10], '*', 1, 3); ### `_.findIndex(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5736 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5762 "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 +789,7 @@ _.findIndex(users, 'active'); ### `_.findLastIndex(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5775 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5801 "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 +831,7 @@ _.findLastIndex(users, 'active'); ### `_.flatten(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5794 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatten "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5820 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatten "See the npm package") Flattens `array` a single level. @@ -847,7 +853,7 @@ _.flatten([1, [2, 3, [4]]]); ### `_.flattenDeep(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5812 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5838 "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`. @@ -869,7 +875,7 @@ _.flattenDeep([1, [2, 3, [4]]]); ### `_.fromPairs(pairs)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5831 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.frompairs "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5857 "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`. @@ -892,7 +898,7 @@ _.fromPairs([['fred', 30], ['barney', 40]]); ### `_.head(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5860 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.head "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5886 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.head "See the npm package") Gets the first element of `array`. @@ -920,7 +926,7 @@ _.head([]); ### `_.indexOf(array, value, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5886 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.indexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5912 "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) @@ -951,7 +957,7 @@ _.indexOf([1, 2, 1, 2], 2, 2); ### `_.initial(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5911 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.initial "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5937 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.initial "See the npm package") Gets all but the last element of `array`. @@ -973,10 +979,10 @@ _.initial([1, 2, 3]); ### `_.intersection([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5930 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersection "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5956 "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) +Creates an array of unique values that are included in all given arrays +using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) for equality comparisons. #### Arguments @@ -997,7 +1003,7 @@ _.intersection([2, 1], [4, 2], [1, 2]); ### `_.intersectionBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5957 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L5983 "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 @@ -1026,7 +1032,7 @@ _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); ### `_.intersectionWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L5990 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6016 "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 @@ -1054,7 +1060,7 @@ _.intersectionWith(objects, others, _.isEqual); ### `_.join(array, [separator=','])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6018 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.join "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6044 "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`. @@ -1077,7 +1083,7 @@ _.join(['a', 'b', 'c'], '~'); ### `_.last(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6035 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.last "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6061 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.last "See the npm package") Gets the last element of `array`. @@ -1099,7 +1105,7 @@ _.last([1, 2, 3]); ### `_.lastIndexOf(array, value, [fromIndex=array.length-1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6060 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lastindexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6086 "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. @@ -1128,9 +1134,9 @@ _.lastIndexOf([1, 2, 1, 2], 2, 2); ### `_.pull(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6102 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pull "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6128 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pull "See the npm package") -Removes all provided values from `array` using +Removes all given values from `array` using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) for equality comparisons.
@@ -1159,7 +1165,7 @@ console.log(array); ### `_.pullAll(array, values)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6123 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullall "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6149 "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.
@@ -1188,7 +1194,7 @@ console.log(array); ### `_.pullAllBy(array, values, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6151 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullallby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6177 "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 generate the criterion @@ -1220,7 +1226,7 @@ console.log(array); ### `_.pullAt(array, [indexes])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6181 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullat "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6207 "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. @@ -1253,7 +1259,7 @@ console.log(evens); ### `_.remove(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6215 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.remove "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6241 "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 @@ -1289,7 +1295,7 @@ console.log(evens); ### `_.reverse()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6257 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reverse "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6283 "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. @@ -1318,7 +1324,7 @@ console.log(array); ### `_.slice(array, [start=0], [end=array.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6275 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.slice "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6301 "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`.
@@ -1341,7 +1347,7 @@ to ensure dense arrays are returned. ### `_.sortedIndex(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6309 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6335 "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. @@ -1368,7 +1374,7 @@ _.sortedIndex([4, 5], 4); ### `_.sortedIndexBy(array, value, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6336 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6362 "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 @@ -1400,7 +1406,7 @@ _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); ### `_.sortedIndexOf(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6355 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6381 "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`. @@ -1424,7 +1430,7 @@ _.sortedIndexOf([1, 1, 2, 2], 2); ### `_.sortedLastIndex(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6382 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6408 "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 @@ -1449,7 +1455,7 @@ _.sortedLastIndex([4, 5], 4); ### `_.sortedLastIndexBy(array, value, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6404 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6430 "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 @@ -1476,7 +1482,7 @@ _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); ### `_.sortedLastIndexOf(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6423 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6449 "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`. @@ -1500,7 +1506,7 @@ _.sortedLastIndexOf([1, 1, 2, 2], 2); ### `_.sortedUniq(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6448 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6474 "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. @@ -1523,7 +1529,7 @@ _.sortedUniq([1, 1, 2]); ### `_.sortedUniqBy(array, [iteratee])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6469 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6495 "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. @@ -1547,7 +1553,7 @@ _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); ### `_.tail(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6488 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tail "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6514 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tail "See the npm package") Gets all but the first element of `array`. @@ -1569,7 +1575,7 @@ _.tail([1, 2, 3]); ### `_.take(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6516 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.take "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6542 "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. @@ -1601,7 +1607,7 @@ _.take([1, 2, 3], 0); ### `_.takeRight(array, [n=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6548 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takeright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6574 "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. @@ -1633,7 +1639,7 @@ _.takeRight([1, 2, 3], 0); ### `_.takeRightWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6592 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6618 "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 @@ -1676,7 +1682,7 @@ _.takeRightWhile(users, 'active'); ### `_.takeWhile(array, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6632 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takewhile "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6658 "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 @@ -1719,10 +1725,10 @@ _.takeWhile(users, 'active'); ### `_.union([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6653 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.union "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6679 "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) +Creates an array of unique values, in order, from all given arrays using +[`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) for equality comparisons. #### Arguments @@ -1743,7 +1749,7 @@ _.union([2, 1], [4, 2], [1, 2]); ### `_.unionBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6677 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6703 "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 @@ -1772,7 +1778,7 @@ _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); ### `_.unionWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6704 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6730 "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 @@ -1800,7 +1806,7 @@ _.unionWith(objects, others, _.isEqual); ### `_.uniq(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6728 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniq "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6754 "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) @@ -1825,7 +1831,7 @@ _.uniq([2, 1, 2]); ### `_.uniqBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6754 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6780 "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 @@ -1854,7 +1860,7 @@ _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); ### `_.uniqWith(array, [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6778 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6804 "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 @@ -1881,7 +1887,7 @@ _.uniqWith(objects, _.isEqual); ### `_.unzip(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6802 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzip "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6828 "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 @@ -1908,7 +1914,7 @@ _.unzip(zipped); ### `_.unzipWith(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6837 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzipwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6863 "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 @@ -1936,9 +1942,9 @@ _.unzipWith(zipped, _.add); ### `_.without(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6866 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.without "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6892 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.without "See the npm package") -Creates an array excluding all provided values using +Creates an array excluding all given values using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) for equality comparisons. @@ -1961,10 +1967,10 @@ _.without([1, 2, 1, 3], 1, 2); ### `_.xor([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6886 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xor "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6912 "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. +of the given arrays. #### Arguments 1. `[arrays]` *(...Array)*: The arrays to inspect. @@ -1984,7 +1990,7 @@ _.xor([2, 1], [4, 2]); ### `_.xorBy([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6910 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6936 "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 @@ -2013,7 +2019,7 @@ _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); ### `_.xorWith([arrays], [comparator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6937 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6963 "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 @@ -2041,7 +2047,7 @@ _.xorWith(objects, others, _.isEqual); ### `_.zip([arrays])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6960 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zip "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L6986 "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 @@ -2065,7 +2071,7 @@ _.zip(['fred', 'barney'], [30, 40], [true, false]); ### `_.zipObject([props=[]], [values=[]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6977 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7003 "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. @@ -2089,7 +2095,7 @@ _.zipObject(['a', 'b'], [1, 2]); ### `_.zipObjectDeep([props=[]], [values=[]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L6995 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobjectdeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7021 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobjectdeep "See the npm package") This method is like `_.zipObject` except that it supports property paths. @@ -2112,7 +2118,7 @@ _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); ### `_.zipWith([arrays], [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7017 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7043 "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 @@ -2145,7 +2151,7 @@ _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { ### `_.countBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7399 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.countby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7425 "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 @@ -2174,7 +2180,7 @@ _.countBy(['one', 'two', 'three'], 'length'); ### `_.every(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7437 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.every "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7463 "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 @@ -2216,7 +2222,7 @@ _.every(users, 'active'); ### `_.filter(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7478 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.filter "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7504 "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:
@@ -2258,7 +2264,7 @@ _.filter(users, 'active'); ### `_.find(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7517 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.find "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7543 "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:
@@ -2301,7 +2307,7 @@ _.find(users, 'active'); ### `_.findLast(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7543 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlast "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7569 "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. @@ -2327,7 +2333,7 @@ _.findLast([1, 2, 3, 4], function(n) { ### `_.flatMap(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7572 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmap "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7598 "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 `collection` through `iteratee` and concating its result to the other mapped values. @@ -2356,7 +2362,7 @@ _.flatMap([1, 2], duplicate); ### `_.forEach(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7604 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreach "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7630 "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). @@ -2396,7 +2402,7 @@ _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { ### `_.forEachRight(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7628 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreachright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7654 "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. @@ -2425,7 +2431,7 @@ _.forEachRight([1, 2], function(value) { ### `_.groupBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7655 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.groupby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7681 "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 @@ -2455,7 +2461,7 @@ _.groupBy(['one', 'two', 'three'], 'length'); ### `_.includes(collection, value, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7691 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.includes "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7717 "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) @@ -2491,7 +2497,7 @@ _.includes('pebbles', 'eb'); ### `_.invokeMap(collection, path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7726 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invokemap "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7752 "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 @@ -2521,7 +2527,7 @@ _.invokeMap([123, 456], String.prototype.split, ''); ### `_.keyBy(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7766 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keyby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7792 "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 @@ -2557,7 +2563,7 @@ _.keyBy(array, 'dir'); ### `_.map(collection, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7811 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.map "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7837 "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:
@@ -2609,7 +2615,7 @@ _.map(users, 'user'); ### `_.orderBy(collection, [iteratees=[_.identity]], [orders])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7843 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.orderby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7869 "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 @@ -2644,7 +2650,7 @@ _.orderBy(users, ['user', 'age'], ['asc', 'desc']); ### `_.partition(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7892 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partition "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7918 "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, the second of which @@ -2688,12 +2694,12 @@ _.partition(users, 'active'); ### `_.reduce(collection, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7931 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduce "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7957 "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 invocation is supplied the return value of the previous. If `accumulator` -is not provided the first element of `collection` is used as the initial +is not given the first element of `collection` is used as the initial value. The iteratee is invoked with four arguments:
(accumulator, value, index|key, collection).
@@ -2734,7 +2740,7 @@ _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { ### `_.reduceRight(collection, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7958 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduceright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7984 "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. @@ -2763,7 +2769,7 @@ _.reduceRight(array, function(flattened, other) { ### `_.reject(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7997 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8023 "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. @@ -2804,7 +2810,7 @@ _.reject(users, 'active'); ### `_.sample(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8018 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sample "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8044 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sample "See the npm package") Gets a random element from `collection`. @@ -2826,7 +2832,7 @@ _.sample([1, 2, 3, 4]); ### `_.sampleSize(collection, [n=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8043 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.samplesize "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8069 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.samplesize "See the npm package") Gets `n` random elements at unique keys from `collection` up to the size of `collection`. @@ -2853,7 +2859,7 @@ _.sampleSize([1, 2, 3], 4); ### `_.shuffle(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8075 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.shuffle "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8101 "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). @@ -2876,7 +2882,7 @@ _.shuffle([1, 2, 3, 4]); ### `_.size(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8099 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.size "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8125 "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. @@ -2905,7 +2911,7 @@ _.size('pebbles'); ### `_.some(collection, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8144 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.some "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8170 "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 @@ -2947,7 +2953,7 @@ _.some(users, 'active'); ### `_.sortBy(collection, [iteratees=[_.identity]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8185 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8211 "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 @@ -2994,7 +3000,7 @@ _.sortBy(users, 'user', function(o) { ### `_.now()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8216 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.now "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8242 "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). @@ -3022,7 +3028,7 @@ _.defer(function(stamp) { ### `_.after(n, func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8243 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.after "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8269 "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. @@ -3054,7 +3060,7 @@ _.forEach(saves, function(type) { ### `_.ary(func, [n=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8271 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ary "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8297 "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. @@ -3078,7 +3084,7 @@ _.map(['6', '8', '10'], _.ary(parseInt, 1)); ### `_.before(n, func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8293 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.before "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8319 "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 @@ -3103,7 +3109,7 @@ jQuery(element).on('click', _.before(5, addContactToList)); ### `_.bind(func, thisArg, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8345 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bind "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8371 "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 @@ -3149,7 +3155,7 @@ bound('hi'); ### `_.bindKey(object, key, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8400 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindkey "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8426 "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. @@ -3204,7 +3210,7 @@ bound('hi'); ### `_.curry(func, [arity=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8451 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curry "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8477 "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 @@ -3254,7 +3260,7 @@ curried(1)(_, 3)(2); ### `_.curryRight(func, [arity=func.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8495 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curryright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8521 "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`. @@ -3301,7 +3307,7 @@ curried(3)(1, _)(2); ### `_.debounce(func, [wait=0], [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8551 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.debounce "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8577 "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 @@ -3358,7 +3364,7 @@ jQuery(window).on('popstate', debounced.cancel); ### `_.defer(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8683 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defer "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8709 "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. @@ -3384,7 +3390,7 @@ _.defer(function(text) { ### `_.delay(func, wait, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8705 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.delay "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8731 "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. @@ -3411,7 +3417,7 @@ _.delay(function(text) { ### `_.flip(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8726 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flip "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8752 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flip "See the npm package") Creates a function that invokes `func` with arguments reversed. @@ -3437,7 +3443,7 @@ flipped('a', 'b', 'c', 'd'); ### `_.memoize(func, [resolver])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8772 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.memoize "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8798 "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 @@ -3489,7 +3495,7 @@ _.memoize.Cache = WeakMap; ### `_.negate(predicate)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8811 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.negate "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8837 "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 @@ -3517,7 +3523,7 @@ _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); ### `_.once(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8837 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.once "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8863 "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 @@ -3543,7 +3549,7 @@ initialize(); ### `_.overArgs(func, [transforms])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8872 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overargs "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8898 "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`. @@ -3582,7 +3588,7 @@ func(10, 5); ### `_.partial(func, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8919 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partial "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8945 "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 @@ -3625,7 +3631,7 @@ greetFred('hi'); ### `_.partialRight(func, [partials])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8957 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partialright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L8983 "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. @@ -3667,7 +3673,7 @@ sayHelloTo('fred'); ### `_.rearg(func, indexes)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L8986 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rearg "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9012 "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 @@ -3697,7 +3703,7 @@ rearged('b', 'c', 'a') ### `_.rest(func, [start=func.length-1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9012 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rest "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9038 "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. @@ -3729,7 +3735,7 @@ say('hello', 'fred', 'barney', 'pebbles'); ### `_.spread(func, [start=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9072 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.spread "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9098 "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). @@ -3770,7 +3776,7 @@ numbers.then(_.spread(function(x, y) { ### `_.throttle(func, [wait=0], [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9128 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.throttle "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9154 "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` @@ -3819,7 +3825,7 @@ jQuery(window).on('popstate', throttled.cancel); ### `_.unary(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9156 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unary "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9182 "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. @@ -3842,7 +3848,7 @@ _.map(['6', '8', '10'], _.unary(parseInt)); ### `_.wrap(value, wrapper)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9181 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.wrap "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9207 "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 @@ -3878,7 +3884,7 @@ p('fred, barney, & pebbles'); ### `_.clone(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9212 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clone "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9238 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clone "See the npm package") Creates a shallow clone of `value`.
@@ -3912,7 +3918,7 @@ console.log(shallow[0] === objects[0]); ### `_.cloneDeep(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9265 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9291 "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`. @@ -3937,7 +3943,7 @@ console.log(deep[0] === objects[0]); ### `_.cloneDeepWith(value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9295 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9321 "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`. @@ -3972,7 +3978,7 @@ console.log(el.childNodes.length); ### `_.cloneWith(value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9245 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonewith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9271 "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` @@ -4010,7 +4016,7 @@ console.log(el.childNodes.length); ### `_.eq(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9329 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.eq "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9355 "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. @@ -4049,7 +4055,7 @@ _.eq(NaN, NaN); ### `_.gt(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9353 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gt "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9379 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gt "See the npm package") Checks if `value` is greater than `other`. @@ -4078,7 +4084,7 @@ _.gt(1, 3); ### `_.gte(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9377 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gte "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9403 "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`. @@ -4107,7 +4113,7 @@ _.gte(1, 3); ### `_.isArguments(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9397 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarguments "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9423 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarguments "See the npm package") Checks if `value` is likely an `arguments` object. @@ -4132,7 +4138,7 @@ _.isArguments([1, 2, 3]); ### `_.isArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9426 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarray "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9452 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarray "See the npm package") Checks if `value` is classified as an `Array` object. @@ -4162,8 +4168,33 @@ _.isArray(_.noop); +### `_.isArrayBuffer(value)` +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9471 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraybuffer "See the npm package") + +Checks if `value` is classified as an `ArrayBuffer` object. + +#### Arguments +1. `value` *(*)*: The value to check. + +#### Returns +*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. + +#### Example +```js +_.isArrayBuffer(new ArrayBuffer(2)); +// => true + +_.isArrayBuffer(new Array(2)); +// => false +``` +* * * + + + + + ### `_.isArrayLike(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9453 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylike "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9500 "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 @@ -4196,7 +4227,7 @@ _.isArrayLike(_.noop); ### `_.isArrayLikeObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9482 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9529 "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. @@ -4228,7 +4259,7 @@ _.isArrayLikeObject(_.noop); ### `_.isBoolean(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9502 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isboolean "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9549 "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. @@ -4252,8 +4283,33 @@ _.isBoolean(null); +### `_.isBuffer(value)` +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9570 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isbuffer "See the npm package") + +Checks if `value` is a buffer. + +#### Arguments +1. `value` *(*)*: The value to check. + +#### Returns +*(boolean)*: Returns `true` if `value` is a buffer, else `false`. + +#### Example +```js +_.isBuffer(new Buffer(2)); +// => true + +_.isBuffer(new Uint8Array(2)); +// => false +``` +* * * + + + + + ### `_.isDate(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9523 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isdate "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9590 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isdate "See the npm package") Checks if `value` is classified as a `Date` object. @@ -4278,7 +4334,7 @@ _.isDate('Mon April 23 2012'); ### `_.isElement(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9543 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iselement "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9610 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iselement "See the npm package") Checks if `value` is likely a DOM element. @@ -4303,7 +4359,7 @@ _.isElement(''); ### `_.isEmpty(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9574 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isempty "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9641 "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 @@ -4339,7 +4395,7 @@ _.isEmpty({ 'a': 1 }); ### `_.isEqual(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9614 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequal "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9681 "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. @@ -4376,7 +4432,7 @@ object === other; ### `_.isEqualWith(value, other, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9649 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequalwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9716 "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 @@ -4416,7 +4472,7 @@ _.isEqualWith(array, other, customizer); ### `_.isError(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9672 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iserror "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9739 "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. @@ -4442,7 +4498,7 @@ _.isError(Error); ### `_.isFinite(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9701 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfinite "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9768 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfinite "See the npm package") Checks if `value` is a finite primitive number.
@@ -4476,7 +4532,7 @@ _.isFinite(Infinity); ### `_.isFunction(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9721 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfunction "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9788 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfunction "See the npm package") Checks if `value` is classified as a `Function` object. @@ -4501,7 +4557,7 @@ _.isFunction(/abc/); ### `_.isInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9753 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isinteger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9820 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isinteger "See the npm package") Checks if `value` is an integer.
@@ -4535,7 +4591,7 @@ _.isInteger('3'); ### `_.isLength(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9781 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.islength "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9848 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.islength "See the npm package") Checks if `value` is a valid array-like length.
@@ -4568,8 +4624,33 @@ _.isLength('3'); +### `_.isMap(value)` +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9923 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismap "See the npm package") + +Checks if `value` is classified as a `Map` object. + +#### Arguments +1. `value` *(*)*: The value to check. + +#### Returns +*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. + +#### Example +```js +_.isMap(new Map); +// => true + +_.isMap(new WeakMap); +// => false +``` +* * * + + + + + ### `_.isMatch(object, source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9862 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatch "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9949 "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. @@ -4601,7 +4682,7 @@ _.isMatch(object, { 'age': 36 }); ### `_.isMatchWith(object, source, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9897 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9984 "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 @@ -4641,7 +4722,7 @@ _.isMatchWith(object, source, customizer); ### `_.isNaN(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9927 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnan "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10014 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnan "See the npm package") Checks if `value` is `NaN`.
@@ -4676,7 +4757,7 @@ _.isNaN(undefined); ### `_.isNative(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9949 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnative "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10036 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnative "See the npm package") Checks if `value` is a native function. @@ -4701,7 +4782,7 @@ _.isNative(_); ### `_.isNil(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9999 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnil "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10086 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnil "See the npm package") Checks if `value` is `null` or `undefined`. @@ -4729,7 +4810,7 @@ _.isNil(NaN); ### `_.isNull(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9976 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnull "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10063 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnull "See the npm package") Checks if `value` is `null`. @@ -4754,7 +4835,7 @@ _.isNull(void 0); ### `_.isNumber(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10028 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnumber "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10115 "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.
@@ -4789,7 +4870,7 @@ _.isNumber('3'); ### `_.isObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9808 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9875 "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('')`) @@ -4821,7 +4902,7 @@ _.isObject(null); ### `_.isObjectLike(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L9836 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L9903 "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". @@ -4853,7 +4934,7 @@ _.isObjectLike(null); ### `_.isPlainObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10060 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isplainobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10147 "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`. @@ -4889,7 +4970,7 @@ _.isPlainObject(Object.create(null)); ### `_.isRegExp(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10092 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isregexp "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10179 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isregexp "See the npm package") Checks if `value` is classified as a `RegExp` object. @@ -4914,7 +4995,7 @@ _.isRegExp('/abc/'); ### `_.isSafeInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10121 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10208 "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. @@ -4948,8 +5029,33 @@ _.isSafeInteger('3'); +### `_.isSet(value)` +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10228 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isset "See the npm package") + +Checks if `value` is classified as a `Set` object. + +#### Arguments +1. `value` *(*)*: The value to check. + +#### Returns +*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. + +#### Example +```js +_.isSet(new Set); +// => true + +_.isSet(new WeakSet); +// => false +``` +* * * + + + + + ### `_.isString(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10141 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isstring "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10248 "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. @@ -4974,7 +5080,7 @@ _.isString(1); ### `_.isSymbol(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10162 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issymbol "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10269 "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. @@ -4999,7 +5105,7 @@ _.isSymbol('abc'); ### `_.isTypedArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10183 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.istypedarray "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10290 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.istypedarray "See the npm package") Checks if `value` is classified as a typed array. @@ -5024,7 +5130,7 @@ _.isTypedArray([]); ### `_.isUndefined(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10203 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isundefined "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10310 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isundefined "See the npm package") Checks if `value` is `undefined`. @@ -5048,8 +5154,58 @@ _.isUndefined(null); +### `_.isWeakMap(value)` +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10330 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isweakmap "See the npm package") + +Checks if `value` is classified as a `WeakMap` object. + +#### Arguments +1. `value` *(*)*: The value to check. + +#### Returns +*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. + +#### Example +```js +_.isWeakMap(new WeakMap); +// => true + +_.isWeakMap(new Map); +// => false +``` +* * * + + + + + +### `_.isWeakSet(value)` +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10350 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isweakset "See the npm package") + +Checks if `value` is classified as a `WeakSet` object. + +#### Arguments +1. `value` *(*)*: The value to check. + +#### Returns +*(boolean)*: Returns `true` if `value` is correctly classified, else `false`. + +#### Example +```js +_.isWeakSet(new WeakSet); +// => true + +_.isWeakSet(new Set); +// => false +``` +* * * + + + + + ### `_.lt(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10227 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lt "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10374 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lt "See the npm package") Checks if `value` is less than `other`. @@ -5078,7 +5234,7 @@ _.lt(3, 1); ### `_.lte(value, other)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10251 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lte "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10398 "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`. @@ -5107,7 +5263,7 @@ _.lte(3, 1); ### `_.toArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10277 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toarray "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10424 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toarray "See the npm package") Converts `value` to an array. @@ -5138,7 +5294,7 @@ _.toArray(null); ### `_.toInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10317 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tointeger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10464 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tointeger "See the npm package") Converts `value` to an integer.
@@ -5172,7 +5328,7 @@ _.toInteger('3'); ### `_.toLength(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10355 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolength "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10502 "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. @@ -5207,7 +5363,7 @@ _.toLength('3'); ### `_.toNumber(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10381 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tonumber "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10528 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tonumber "See the npm package") Converts `value` to a number. @@ -5238,7 +5394,7 @@ _.toNumber('3'); ### `_.toPlainObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10419 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toplainobject "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10566 "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. @@ -5270,7 +5426,7 @@ _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); ### `_.toSafeInteger(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10446 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10593 "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. @@ -5302,7 +5458,7 @@ _.toSafeInteger('3'); ### `_.toString(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10470 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tostring "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10617 "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. @@ -5337,7 +5493,7 @@ _.toString([1, 2, 3]); ### `_.add(augend, addend)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13716 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.add "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13863 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.add "See the npm package") Adds two numbers. @@ -5360,7 +5516,7 @@ _.add(6, 4); ### `_.ceil(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13747 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ceil "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13897 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ceil "See the npm package") Computes `number` rounded up to `precision`. @@ -5389,7 +5545,7 @@ _.ceil(6040, -2); ### `_.floor(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13769 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.floor "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13919 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.floor "See the npm package") Computes `number` rounded down to `precision`. @@ -5418,7 +5574,7 @@ _.floor(4060, -2); ### `_.max(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13788 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.max "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13938 "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. @@ -5444,7 +5600,7 @@ _.max([]); ### `_.maxBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13816 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.maxby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13966 "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 @@ -5475,7 +5631,7 @@ _.maxBy(objects, 'n'); ### `_.mean(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13835 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mean "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13985 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mean "See the npm package") Computes the mean of the values in `array`. @@ -5497,7 +5653,7 @@ _.mean([4, 2, 8, 6]); ### `_.min(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13856 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.min "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L14006 "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. @@ -5523,7 +5679,7 @@ _.min([]); ### `_.minBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13884 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.minby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L14034 "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 @@ -5554,7 +5710,7 @@ _.minBy(objects, 'n'); ### `_.round(number, [precision=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13910 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.round "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L14060 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.round "See the npm package") Computes `number` rounded to `precision`. @@ -5583,7 +5739,7 @@ _.round(4060, -2); ### `_.subtract(minuend, subtrahend)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13926 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.subtract "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L14076 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.subtract "See the npm package") Subtract two numbers. @@ -5606,7 +5762,7 @@ _.subtract(6, 4); ### `_.sum(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13950 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sum "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L14103 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sum "See the npm package") Computes the sum of the values in `array`. @@ -5628,7 +5784,7 @@ _.sum([4, 2, 8, 6]); ### `_.sumBy(array, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13978 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sumby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L14131 "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. @@ -5665,7 +5821,7 @@ _.sumBy(objects, 'n'); ### `_.clamp(number, [lower], upper)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11745 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clamp "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11892 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clamp "See the npm package") Clamps `number` within the inclusive `lower` and `upper` bounds. @@ -5692,7 +5848,7 @@ _.clamp(10, -5, 5); ### `_.inRange(number, [start=0], end)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11797 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.inrange "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11944 "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`. @@ -5737,7 +5893,7 @@ _.inRange(-3, -2, -6); ### `_.random([lower=0], [upper=1], [floating])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11839 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.random "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11986 "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 @@ -5783,7 +5939,7 @@ _.random(1.2, 5.2); ### `_.assign(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10517 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assign "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10664 "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 @@ -5823,7 +5979,7 @@ _.assign({ 'a': 1 }, new Foo, new Bar); ### `_.assignIn(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10550 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10697 "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. @@ -5864,7 +6020,7 @@ _.assignIn({ 'a': 1 }, new Foo, new Bar); ### `_.assignInWith(object, sources, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10581 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assigninwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10728 "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` @@ -5903,7 +6059,7 @@ defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); ### `_.assignWith(object, sources, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10611 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10758 "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` @@ -5939,7 +6095,7 @@ defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); ### `_.at(object, [paths])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10635 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.at "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10782 "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`. @@ -5967,10 +6123,10 @@ _.at(['a', 'b', 'c'], 0, 2); ### `_.create(prototype, [properties])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10671 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.create "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10818 "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. +object is given its own enumerable properties are assigned to the created object. #### Arguments 1. `prototype` *(Object)*: The object to inherit from. @@ -6008,7 +6164,7 @@ circle instanceof Shape; ### `_.defaults(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10695 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaults "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10842 "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`. @@ -6037,7 +6193,7 @@ _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); ### `_.defaultsDeep(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10718 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10865 "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. @@ -6064,7 +6220,7 @@ _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'ag ### `_.findKey(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10756 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findkey "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10903 "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. @@ -6106,7 +6262,7 @@ _.findKey(users, 'active'); ### `_.findLastKey(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10793 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastkey "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10940 "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. @@ -6148,7 +6304,7 @@ _.findLastKey(users, 'active'); ### `_.forIn(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10823 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10970 "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:
@@ -6183,7 +6339,7 @@ _.forIn(new Foo, function(value, key) { ### `_.forInRight(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10851 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forinright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L10998 "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. @@ -6216,7 +6372,7 @@ _.forInRight(new Foo, function(value, key) { ### `_.forOwn(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10881 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forown "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11028 "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:
@@ -6251,7 +6407,7 @@ _.forOwn(new Foo, function(value, key) { ### `_.forOwnRight(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10909 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forownright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11056 "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. @@ -6284,7 +6440,7 @@ _.forOwnRight(new Foo, function(value, key) { ### `_.functions(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10934 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functions "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11081 "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`. @@ -6314,7 +6470,7 @@ _.functions(new Foo); ### `_.functionsIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10959 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functionsin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11106 "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`. @@ -6344,7 +6500,7 @@ _.functionsIn(new Foo); ### `_.get(object, path, [defaultValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L10987 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.get "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11134 "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. @@ -6377,7 +6533,7 @@ _.get(object, 'a.b.c', 'default'); ### `_.has(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11018 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.has "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11165 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.has "See the npm package") Checks if `path` is a direct property of `object`. @@ -6412,7 +6568,7 @@ _.has(other, 'a'); ### `_.hasIn(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11047 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.hasin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11194 "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`. @@ -6446,7 +6602,7 @@ _.hasIn(object, 'b'); ### `_.invert(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11068 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invert "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11215 "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 @@ -6472,7 +6628,7 @@ _.invert(object); ### `_.invertBy(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11097 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invertby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11244 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invertby "See the npm package") This method is like `_.invert` except that the inverted object is generated from the results of running each element of `object` through `iteratee`. @@ -6506,7 +6662,7 @@ _.invertBy(object, function(value) { ### `_.invoke(object, path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11122 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invoke "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11269 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invoke "See the npm package") Invokes the method at `path` of `object`. @@ -6532,7 +6688,7 @@ _.invoke(object, 'a[0].b.c.slice', 1, 3); ### `_.keys(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11151 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keys "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11298 "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`.
@@ -6569,7 +6725,7 @@ _.keys('hi'); ### `_.keysIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11193 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keysin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11340 "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`.
@@ -6601,7 +6757,7 @@ _.keysIn(new Foo); ### `_.mapKeys(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11231 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapkeys "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11378 "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 @@ -6628,7 +6784,7 @@ _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { ### `_.mapValues(object, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11266 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapvalues "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11413 "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 @@ -6662,7 +6818,7 @@ _.mapValues(users, 'age'); ### `_.merge(object, [sources])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11305 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.merge "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11452 "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 @@ -6701,7 +6857,7 @@ _.merge(users, ages); ### `_.mergeWith(object, sources, customizer)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11346 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mergewith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11493 "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 @@ -6748,7 +6904,7 @@ _.mergeWith(object, other, customizer); ### `_.omit(object, [props])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11368 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omit "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11515 "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. @@ -6774,7 +6930,7 @@ _.omit(object, ['a', 'c']); ### `_.omitBy(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11394 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omitby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11541 "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` @@ -6801,7 +6957,7 @@ _.omitBy(object, _.isNumber); ### `_.pick(object, [props])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11418 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pick "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11565 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pick "See the npm package") Creates an object composed of the picked `object` properties. @@ -6826,7 +6982,7 @@ _.pick(object, ['a', 'c']); ### `_.pickBy(object, [predicate=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11439 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pickby "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11586 "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 two arguments: (value, key). @@ -6852,7 +7008,7 @@ _.pickBy(object, _.isNumber); ### `_.result(object, path, [defaultValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11471 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.result "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11618 "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 @@ -6889,7 +7045,7 @@ _.result(object, 'a[0].b.c3', _.constant('default')); ### `_.set(object, path, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11512 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.set "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11659 "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 @@ -6926,7 +7082,7 @@ console.log(object.x[0].y.z); ### `_.setWith(object, path, value, [customizer])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11537 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.setwith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11684 "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` @@ -6957,7 +7113,7 @@ _.setWith({ '0': { 'length': 2 } }, '[0][1][2]', 3, Object); ### `_.toPairs(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11562 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairs "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11709 "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`. @@ -6986,7 +7142,7 @@ _.toPairs(new Foo); ### `_.toPairsIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11586 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairsin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11733 "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`. @@ -7015,7 +7171,7 @@ _.toPairsIn(new Foo); ### `_.transform(object, [iteratee=_.identity], [accumulator])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11618 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.transform "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11765 "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 @@ -7052,7 +7208,7 @@ _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { ### `_.unset(object, path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11666 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unset "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11813 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unset "See the npm package") Removes the property at `path` of `object`.
@@ -7088,7 +7244,7 @@ console.log(object); ### `_.values(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11695 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.values "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11842 "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`.
@@ -7123,7 +7279,7 @@ _.values('hi'); ### `_.valuesIn(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11721 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.valuesin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L11868 "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`.
@@ -7161,7 +7317,7 @@ _.valuesIn(new Foo); ### `_(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L1466 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L1469 "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 @@ -7291,7 +7447,7 @@ _.isArray(squares.value()); ### `_.chain(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7054 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7080 "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`. @@ -7327,7 +7483,7 @@ var youngest = _ ### `_.tap(value, interceptor)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7082 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7108 "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 @@ -7358,7 +7514,7 @@ _([1, 2, 3]) ### `_.thru(value, interceptor)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7109 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7135 "View in source") [Ⓣ][1] This method is like `_.tap` except that it returns the result of `interceptor`. The purpose of this method is to "pass thru" values replacing intermediate @@ -7389,7 +7545,7 @@ _(' abc ') ### `_.prototype[Symbol.iterator]()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7280 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7306 "View in source") [Ⓣ][1] Enables the wrapper to be iterable. @@ -7413,7 +7569,7 @@ Array.from(wrapped); ### `_.prototype.at([paths])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7132 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7158 "View in source") [Ⓣ][1] This method is the wrapper version of `_.at`. @@ -7440,7 +7596,7 @@ _(['a', 'b', 'c']).at(0, 2).value(); ### `_.prototype.chain()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7178 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7204 "View in source") [Ⓣ][1] Enables explicit method chaining on the wrapper object. @@ -7473,7 +7629,7 @@ _(users) ### `_.prototype.commit()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7207 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7233 "View in source") [Ⓣ][1] Executes the chained sequence and returns the wrapped result. @@ -7505,7 +7661,7 @@ console.log(array); ### `_.prototype.flatMap([iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7228 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7254 "View in source") [Ⓣ][1] This method is the wrapper version of `_.flatMap`. @@ -7531,7 +7687,7 @@ _([1, 2]).flatMap(duplicate).value(); ### `_.prototype.next()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7253 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7279 "View in source") [Ⓣ][1] Gets the next value on a wrapped object following the [iterator protocol](https://mdn.io/iteration_protocols#iterator). @@ -7559,7 +7715,7 @@ wrapped.next(); ### `_.prototype.plant(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7307 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7333 "View in source") [Ⓣ][1] Creates a clone of the chained sequence planting `value` as the wrapped value. @@ -7591,7 +7747,7 @@ wrapped.value(); ### `_.prototype.reverse()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7346 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7372 "View in source") [Ⓣ][1] This method is the wrapper version of `_.reverse`.
@@ -7618,7 +7774,7 @@ console.log(array); ### `_.prototype.value()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L7373 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L7399 "View in source") [Ⓣ][1] Executes the chained sequence to extract the unwrapped value. @@ -7646,7 +7802,7 @@ _([1, 2, 3]).value(); ### `_.camelCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11899 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.camelcase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12046 "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). @@ -7674,7 +7830,7 @@ _.camelCase('__foo_bar__'); ### `_.capitalize([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11918 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.capitalize "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12065 "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. @@ -7697,7 +7853,7 @@ _.capitalize('FRED'); ### `_.deburr([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11936 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.deburr "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12083 "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). @@ -7720,7 +7876,7 @@ _.deburr('déjà vu'); ### `_.endsWith([string=''], [target], [position=string.length])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L11962 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.endswith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12109 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.endswith "See the npm package") Checks if `string` ends with the given target string. @@ -7750,7 +7906,7 @@ _.endsWith('abc', 'b', 2); ### `_.escape([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12007 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escape "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12154 "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. @@ -7795,7 +7951,7 @@ _.escape('fred, barney, & pebbles'); ### `_.escapeRegExp([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12028 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12175 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package") Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. @@ -7818,7 +7974,7 @@ _.escapeRegExp('[lodash](https://lodash.com/)'); ### `_.kebabCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12054 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.kebabcase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12201 "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). @@ -7846,7 +8002,7 @@ _.kebabCase('__foo_bar__'); ### `_.lowerCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12077 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowercase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12224 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowercase "See the npm package") Converts `string`, as space separated words, to lower case. @@ -7874,7 +8030,7 @@ _.lowerCase('__FOO_BAR__'); ### `_.lowerFirst([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12097 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12244 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package") Converts the first character of `string` to lower case. @@ -7899,7 +8055,7 @@ _.lowerFirst('FRED'); ### `_.pad([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12139 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pad "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12286 "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`. @@ -7930,7 +8086,7 @@ _.pad('abc', 3); ### `_.padEnd([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12176 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padend "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12323 "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`. @@ -7961,7 +8117,7 @@ _.padEnd('abc', 3); ### `_.padStart([string=''], [length=0], [chars=' '])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12203 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padstart "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12350 "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`. @@ -7992,7 +8148,7 @@ _.padStart('abc', 3); ### `_.parseInt(string, [radix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12231 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.parseint "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12378 "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, @@ -8024,7 +8180,7 @@ _.map(['6', '08', '10'], _.parseInt); ### `_.repeat([string=''], [n=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12263 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.repeat "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12410 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.repeat "See the npm package") Repeats the given string `n` times. @@ -8053,7 +8209,7 @@ _.repeat('abc', 0); ### `_.replace([string=''], pattern, replacement)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12301 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.replace "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12448 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.replace "See the npm package") Replaces matches for `pattern` in `string` with `replacement`.
@@ -8080,7 +8236,7 @@ _.replace('Hi Fred', 'Fred', 'Barney'); ### `_.snakeCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12327 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.snakecase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12474 "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). @@ -8108,7 +8264,7 @@ _.snakeCase('--foo-bar'); ### `_.split([string=''], separator, [limit])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12348 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.split "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12495 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.split "See the npm package") Splits `string` by `separator`.
@@ -8135,7 +8291,7 @@ _.split('a-b-c', '-', 2); ### `_.startCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12371 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startcase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12518 "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). @@ -8163,7 +8319,7 @@ _.startCase('__foo_bar__'); ### `_.startsWith([string=''], [target], [position=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12396 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startswith "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12543 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startswith "See the npm package") Checks if `string` starts with the given target string. @@ -8193,13 +8349,13 @@ _.startsWith('abc', 'b', 1); ### `_.template([string=''], [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12498 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.template "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12645 "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 "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data properties may be accessed as free variables in the template. If a setting -object is provided it takes precedence over `_.templateSettings` values. +object is given it takes precedence over `_.templateSettings` values.

**Note:** In the development build `_.template` utilizes @@ -8300,7 +8456,7 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\ ### `_.toLower([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12623 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolower "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12770 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolower "See the npm package") Converts `string`, as a whole, to lower case. @@ -8328,7 +8484,7 @@ _.toLower('__FOO_BAR__'); ### `_.toUpper([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12646 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toupper "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12793 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toupper "See the npm package") Converts `string`, as a whole, to upper case. @@ -8356,7 +8512,7 @@ _.toUpper('__foo_bar__'); ### `_.trim([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12671 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trim "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12818 "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`. @@ -8385,7 +8541,7 @@ _.map([' foo ', ' bar '], _.trim); ### `_.trimEnd([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12707 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimend "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12854 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimend "See the npm package") Removes trailing whitespace or specified characters from `string`. @@ -8411,7 +8567,7 @@ _.trimEnd('-_-abc-_-', '_-'); ### `_.trimStart([string=''], [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12741 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimstart "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12888 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimstart "See the npm package") Removes leading whitespace or specified characters from `string`. @@ -8437,7 +8593,7 @@ _.trimStart('-_-abc-_-', '_-'); ### `_.truncate([string=''], [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12793 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.truncate "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12940 "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 @@ -8482,7 +8638,7 @@ _.truncate('hi-diddly-ho there, neighborino', { ### `_.unescape([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12867 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unescape "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13014 "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 @@ -8510,7 +8666,7 @@ _.unescape('fred, barney, & pebbles'); ### `_.upperCase([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12893 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uppercase "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13040 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uppercase "See the npm package") Converts `string`, as space separated words, to upper case. @@ -8538,7 +8694,7 @@ _.upperCase('__foo_bar__'); ### `_.upperFirst([string=''])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12115 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.upperfirst "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L12262 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.upperfirst "See the npm package") Converts the first character of `string` to upper case. @@ -8563,7 +8719,7 @@ _.upperFirst('FRED'); ### `_.words([string=''], [pattern])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12915 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.words "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13062 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.words "See the npm package") Splits `string` into an array of its words. @@ -8595,7 +8751,7 @@ _.words('fred, barney, & pebbles', /[^, ]+/g); ### `_.attempt(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12947 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.attempt "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13094 "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. @@ -8624,7 +8780,7 @@ if (_.isError(elements)) { ### `_.bindAll(object, methodNames)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L12981 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindall "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13128 "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. @@ -8659,7 +8815,7 @@ jQuery(element).on('click', view.onClick); ### `_.cond(pairs)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13016 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.cond "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13163 "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 @@ -8696,7 +8852,7 @@ func({ 'a': '1', 'b': '2' }); ### `_.conforms(source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13058 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.conforms "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13205 "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 @@ -8725,7 +8881,7 @@ _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) })); ### `_.constant(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13078 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.constant "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13225 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.constant "See the npm package") Creates a function that returns `value`. @@ -8750,11 +8906,11 @@ getter() === object; ### `_.flow([funcs])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13104 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flow "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13251 "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 -successive invocation is supplied the return value of the previous. +Creates a function that returns the result of invoking the given functions +with the `this` binding of the created function, where each successive +invocation is supplied the return value of the previous. #### Arguments 1. `[funcs]` *(...(Function|Function[])*: Functions to invoke. @@ -8779,10 +8935,10 @@ addSquare(1, 2); ### `_.flowRight([funcs])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13125 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flowright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13272 "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. +invokes the given functions from right to left. #### Arguments 1. `[funcs]` *(...(Function|Function[])*: Functions to invoke. @@ -8807,9 +8963,9 @@ addSquare(1, 2); ### `_.identity(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13142 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.identity "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13289 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.identity "See the npm package") -This method returns the first argument provided to it. +This method returns the first argument given to it. #### Arguments 1. `value` *(*)*: Any value. @@ -8831,7 +8987,7 @@ _.identity(object) === object; ### `_.iteratee([func=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13175 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iteratee "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13322 "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 @@ -8869,7 +9025,7 @@ _.filter(users, 'age > 36'); ### `_.matches(source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13201 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matches "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13348 "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 @@ -8901,7 +9057,7 @@ _.filter(users, _.matches({ 'age': 40, 'active': false })); ### `_.matchesProperty(path, srcValue)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13228 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matchesproperty "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13375 "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 @@ -8934,7 +9090,7 @@ _.find(users, _.matchesProperty('user', 'fred')); ### `_.method(path, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13255 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.method "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13402 "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. @@ -8966,7 +9122,7 @@ _.invokeMap(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c'); ### `_.methodOf(object, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13283 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.methodof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13430 "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 @@ -8997,7 +9153,7 @@ _.map([['a', '2'], ['c', '0']], _.methodOf(object)); ### `_.mixin([object=lodash], source, [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13325 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mixin "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13472 "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 @@ -9042,7 +9198,7 @@ _('fred').vowels(); ### `_.noConflict()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13373 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noconflict "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13520 "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. @@ -9061,7 +9217,7 @@ var lodash = _.noConflict(); ### `_.noop()` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13394 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noop "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13541 "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. @@ -9080,7 +9236,7 @@ _.noop(object) === undefined; ### `_.nthArg([n=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13413 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ntharg "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13560 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ntharg "See the npm package") Creates a function that returns its nth argument. @@ -9104,7 +9260,7 @@ func('a', 'b', 'c'); ### `_.over(iteratees)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13436 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.over "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13583 "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. @@ -9129,7 +9285,7 @@ func(1, 2, 3, 4); ### `_.overEvery(predicates)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13460 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overevery "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13607 "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. @@ -9160,7 +9316,7 @@ func(NaN); ### `_.overSome(predicates)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13484 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.oversome "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13631 "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. @@ -9191,7 +9347,7 @@ func(NaN); ### `_.property(path)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13507 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.property "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13654 "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. @@ -9221,7 +9377,7 @@ _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); ### `_.propertyOf(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13531 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.propertyof "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13678 "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`. @@ -9250,7 +9406,7 @@ _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); ### `_.range([start=0], end, [step=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13576 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.range "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13723 "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 @@ -9299,7 +9455,7 @@ _.range(0); ### `_.rangeRight([start=0], end, [step=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13612 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rangeright "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13759 "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. @@ -9342,7 +9498,7 @@ _.rangeRight(0); ### `_.runInContext([context=root])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L1266 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.runincontext "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L1267 "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. @@ -9386,7 +9542,7 @@ var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; ### `_.times(n, [iteratee=_.identity])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13632 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.times "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13779 "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). @@ -9413,7 +9569,7 @@ _.times(3, String); ### `_.toPath(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13675 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topath "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13822 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topath "See the npm package") Converts `value` to a property path array. @@ -9447,9 +9603,9 @@ console.log(path === newPath); ### `_.uniqueId([prefix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L13695 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqueid "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L13842 "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. +Generates a unique ID. If `prefix` is given the ID is appended to it. #### Arguments 1. `[prefix]` *(string)*: The value to prefix the ID with. @@ -9478,7 +9634,7 @@ _.uniqueId(); ### `_.VERSION` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L14328 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L14487 "View in source") [Ⓣ][1] (string): The semantic version number. @@ -9489,7 +9645,7 @@ _.uniqueId(); ### `_.templateSettings` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L1511 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.templatesettings "See the npm package") +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L1514 "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 @@ -9502,7 +9658,7 @@ alternative delimiters. ### `_.templateSettings.escape` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L1519 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L1522 "View in source") [Ⓣ][1] (RegExp): Used to detect `data` property values to be HTML-escaped. @@ -9513,7 +9669,7 @@ alternative delimiters. ### `_.templateSettings.evaluate` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L1527 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L1530 "View in source") [Ⓣ][1] (RegExp): Used to detect code to be evaluated. @@ -9524,7 +9680,7 @@ alternative delimiters. ### `_.templateSettings.imports` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L1551 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L1554 "View in source") [Ⓣ][1] (Object): Used to import variables into the compiled template. @@ -9535,7 +9691,7 @@ alternative delimiters. ### `_.templateSettings.interpolate` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L1535 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L1538 "View in source") [Ⓣ][1] (RegExp): Used to detect `data` property values to inject. @@ -9546,7 +9702,7 @@ alternative delimiters. ### `_.templateSettings.variable` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L1543 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L1546 "View in source") [Ⓣ][1] (string): Used to reference the data object in the template text. @@ -9563,7 +9719,7 @@ alternative delimiters. ### `_.templateSettings.imports._` -# [Ⓢ](https://github.com/lodash/lodash/blob/4.2.1/lodash.js#L1559 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/4.3.0/lodash.js#L1562 "View in source") [Ⓣ][1] A reference to the `lodash` function. diff --git a/lodash.js b/lodash.js index c303a62b94..954f4404d5 100644 --- a/lodash.js +++ b/lodash.js @@ -1,6 +1,6 @@ /** * @license - * lodash 4.2.1 + * lodash 4.3.0 * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors @@ -12,7 +12,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.2.1'; + var VERSION = '4.3.0'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, diff --git a/package.json b/package.json index bf5ceed3c5..5807ecf026 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lodash", - "version": "4.2.2-pre", + "version": "4.3.0", "main": "lodash.js", "private": true, "devDependencies": { From 8debfc6e6cd38bbaa926b42066a60f6540c9ca43 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 7 Feb 2016 22:45:38 -0800 Subject: [PATCH 28/28] Bump to v4.3.0. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 61f3f6c1f3..77bcf52aba 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lodash v4.2.1 +# lodash v4.3.0 The [lodash](https://lodash.com/) library exported as a [UMD](https://github.com/umdjs/umd) module. @@ -29,11 +29,11 @@ numbers, objects, strings, etc. Lodash’s modular methods can be used for: ## Download -Lodash is released under the [MIT license](https://raw.githubusercontent.com/lodash/lodash/4.2.1/LICENSE) & supports [modern environments](#support).
+Lodash is released under the [MIT license](https://raw.githubusercontent.com/lodash/lodash/4.3.0/LICENSE) & supports [modern environments](#support).
Review the [build differences](https://github.com/lodash/lodash/wiki/build-differences) & pick the one that’s right for you. - * [Core build](https://raw.githubusercontent.com/lodash/lodash/4.2.1/dist/lodash.core.js) ([~4 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.2.1/dist/lodash.core.min.js)) - * [Full build](https://raw.githubusercontent.com/lodash/lodash/4.2.1/dist/lodash.js) ([~20 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.2.1/dist/lodash.min.js)) + * [Core build](https://raw.githubusercontent.com/lodash/lodash/4.3.0/dist/lodash.core.js) ([~4 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.3.0/dist/lodash.core.min.js)) + * [Full build](https://raw.githubusercontent.com/lodash/lodash/4.3.0/dist/lodash.js) ([~20 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.3.0/dist/lodash.min.js)) ## Module Formats