diff --git a/README.md b/README.md
index a4bdfc0b3..ac3a12496 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# lodash v4.2.3
+# lodash v4.2.4
The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method.
diff --git a/lodash.template/LICENSE b/lodash.template/LICENSE
index bcbe13d67..e0c69d560 100644
--- a/lodash.template/LICENSE
+++ b/lodash.template/LICENSE
@@ -1,23 +1,47 @@
-The MIT License (MIT)
+Copyright jQuery Foundation and other contributors
-Copyright 2012-2016 The Dojo Foundation
-Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
+Based on Underscore.js, copyright 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:
+This software consists of voluntary contributions made by many
+individuals. For exact contribution history, see the revision history
+available at https://github.com/lodash/lodash
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
+The following license applies to all parts of this software except as
+documented below:
-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.
+====
+
+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 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.
+
+====
+
+Copyright and related rights for sample code are waived via CC0. Sample
+code is defined as all source code displayed within the prose of the
+documentation.
+
+CC0: http://creativecommons.org/publicdomain/zero/1.0/
+
+====
+
+Files located in the node_modules and vendor directories are externally
+maintained libraries used by this software which have their own
+licenses; we recommend you read them, as their terms may differ from the
+terms above.
diff --git a/lodash.template/README.md b/lodash.template/README.md
index e84537412..4aba6ed16 100644
--- a/lodash.template/README.md
+++ b/lodash.template/README.md
@@ -1,4 +1,4 @@
-# lodash.template v4.2.3
+# lodash.template v4.2.4
The [lodash](https://lodash.com/) method `_.template` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var template = require('lodash.template');
```
-See the [documentation](https://lodash.com/docs#template) or [package source](https://github.com/lodash/lodash/blob/4.2.3-npm-packages/lodash.template) for more details.
+See the [documentation](https://lodash.com/docs#template) or [package source](https://github.com/lodash/lodash/blob/4.2.4-npm-packages/lodash.template) for more details.
diff --git a/lodash.template/index.js b/lodash.template/index.js
index d73995b31..5a5a2d245 100644
--- a/lodash.template/index.js
+++ b/lodash.template/index.js
@@ -1,10 +1,10 @@
/**
- * lodash 4.2.3 (Custom Build)
+ * lodash 4.2.4 (Custom Build)
* Build: `lodash modularize exports="npm" -o ./`
- * Copyright 2012-2016 The Dojo Foundation
+ * Copyright jQuery Foundation and other contributors
+ * Released under MIT license
* Based on Underscore.js 1.8.3
- * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
var assignInWith = require('lodash.assigninwith'),
keys = require('lodash.keys'),
@@ -26,7 +26,10 @@ var reEmptyStringLeading = /\b__p \+= '';/g,
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
-/** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */
+/**
+ * Used to match
+ * [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components).
+ */
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
/** Used to detect unsigned integer values. */
@@ -55,7 +58,7 @@ var stringEscapes = {
* @private
* @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`.
- * @param {...*} args The arguments to invoke `func` with.
+ * @param {Array} args The arguments to invoke `func` with.
* @returns {*} Returns the result of `func`.
*/
function apply(func, thisArg, args) {
@@ -137,7 +140,8 @@ var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
@@ -176,8 +180,9 @@ function baseProperty(key) {
/**
* Gets the "length" property value of `object`.
*
- * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
- * that affects Safari on at least iOS 8.1-8.3 ARM64.
+ * **Note:** This function is used to avoid a
+ * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
+ * Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
@@ -192,7 +197,8 @@ var getLength = baseProperty('length');
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
+ * else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
@@ -200,19 +206,22 @@ function isIterateeCall(value, index, object) {
}
var type = typeof index;
if (type == 'number'
- ? (isArrayLike(object) && isIndex(index, object.length))
- : (type == 'string' && index in object)) {
+ ? (isArrayLike(object) && isIndex(index, object.length))
+ : (type == 'string' && index in object)
+ ) {
return eq(object[index], value);
}
return false;
}
/**
- * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * Performs a
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
+ * @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
@@ -248,6 +257,7 @@ function eq(value, other) {
*
* @static
* @memberOf _
+ * @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
@@ -275,9 +285,11 @@ function isArrayLike(value) {
*
* @static
* @memberOf _
+ * @since 3.0.0
* @category Lang
* @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
+ * @returns {boolean} Returns `true` if `value` is an error object,
+ * else `false`.
* @example
*
* _.isError(new Error);
@@ -299,9 +311,11 @@ function isError(value) {
*
* @static
* @memberOf _
+ * @since 0.1.0
* @category Lang
* @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @returns {boolean} Returns `true` if `value` is correctly classified,
+ * else `false`.
* @example
*
* _.isFunction(_);
@@ -321,13 +335,16 @@ function isFunction(value) {
/**
* Checks if `value` is a valid array-like length.
*
- * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
+ * **Note:** This function is loosely based on
+ * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
*
* @static
* @memberOf _
+ * @since 4.0.0
* @category Lang
* @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ * @returns {boolean} Returns `true` if `value` is a valid length,
+ * else `false`.
* @example
*
* _.isLength(3);
@@ -348,11 +365,13 @@ function isLength(value) {
}
/**
- * 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('')`)
+ * Checks if `value` is the
+ * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
+ * @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
@@ -381,6 +400,7 @@ function isObject(value) {
*
* @static
* @memberOf _
+ * @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
@@ -407,7 +427,7 @@ function isObjectLike(value) {
* 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 given 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)
@@ -420,17 +440,24 @@ function isObjectLike(value) {
* [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
*
* @static
+ * @since 0.1.0
* @memberOf _
* @category String
* @param {string} [string=''] The template string.
- * @param {Object} [options] The options object.
- * @param {RegExp} [options.escape] The HTML "escape" delimiter.
- * @param {RegExp} [options.evaluate] The "evaluate" delimiter.
- * @param {Object} [options.imports] An object to import into the template as free variables.
- * @param {RegExp} [options.interpolate] The "interpolate" delimiter.
- * @param {string} [options.sourceURL] The sourceURL of the template's compiled source.
- * @param {string} [options.variable] The data object variable name.
- * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
+ * @param {Object} [options={}] The options object.
+ * @param {RegExp} [options.escape=_.templateSettings.escape]
+ * The HTML "escape" delimiter.
+ * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
+ * The "evaluate" delimiter.
+ * @param {Object} [options.imports=_.templateSettings.imports]
+ * An object to import into the template as free variables.
+ * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
+ * The "interpolate" delimiter.
+ * @param {string} [options.sourceURL='templateSources[n]']
+ * The sourceURL of the compiled template.
+ * @param {string} [options.variable='obj']
+ * The data object variable name.
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the compiled template function.
* @example
*
@@ -479,7 +506,7 @@ function isObjectLike(value) {
* // Use the `sourceURL` option to specify a custom sourceURL for the template.
* var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
* compiled(data);
- * // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector
+ * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
*
* // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
* var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
@@ -499,7 +526,8 @@ function isObjectLike(value) {
* ');
*/
function template(string, options, guard) {
- // Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/)
+ // Based on John Resig's `tmpl` implementation
+ // (http://ejohn.org/blog/javascript-micro-templating/)
// and Laura Doktorova's doT.js (https://github.com/olado/doT).
var settings = templateSettings.imports._.templateSettings || templateSettings;
@@ -607,8 +635,10 @@ function template(string, options, guard) {
*
* @static
* @memberOf _
+ * @since 3.0.0
* @category Util
* @param {Function} func The function to attempt.
+ * @param {...*} [args] The arguments to invoke `func` with.
* @returns {*} Returns the `func` result or error object.
* @example
*
diff --git a/lodash.template/package.json b/lodash.template/package.json
index 56011533d..302595fe4 100644
--- a/lodash.template/package.json
+++ b/lodash.template/package.json
@@ -1,6 +1,6 @@
{
"name": "lodash.template",
- "version": "4.2.3",
+ "version": "4.2.4",
"description": "The lodash method `_.template` exported as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",
diff --git a/lodash.toarray/README.md b/lodash.toarray/README.md
index 8a88d0da9..5c2b8888c 100644
--- a/lodash.toarray/README.md
+++ b/lodash.toarray/README.md
@@ -1,4 +1,4 @@
-# lodash.toarray v4.2.3
+# lodash.toarray v4.2.4
The [lodash](https://lodash.com/) method `_.toArray` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var toArray = require('lodash.toarray');
```
-See the [documentation](https://lodash.com/docs#toArray) or [package source](https://github.com/lodash/lodash/blob/4.2.3-npm-packages/lodash.toarray) for more details.
+See the [documentation](https://lodash.com/docs#toArray) or [package source](https://github.com/lodash/lodash/blob/4.2.4-npm-packages/lodash.toarray) for more details.
diff --git a/lodash.toarray/index.js b/lodash.toarray/index.js
index 8551baa25..a6bc8cf96 100644
--- a/lodash.toarray/index.js
+++ b/lodash.toarray/index.js
@@ -1,5 +1,5 @@
/**
- * lodash 4.2.3 (Custom Build)
+ * lodash (Custom Build)
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors
* Released under MIT license
@@ -24,7 +24,10 @@ var funcTag = '[object Function]',
var dataViewTag = '[object DataView]';
-/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */
+/**
+ * Used to match `RegExp`
+ * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
+ */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
@@ -129,11 +132,11 @@ function iteratorToArray(iterator) {
}
/**
- * Converts `map` to an array.
+ * Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
- * @returns {Array} Returns the converted array.
+ * @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
@@ -146,11 +149,11 @@ function mapToArray(map) {
}
/**
- * Converts `set` to an array.
+ * Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
- * @returns {Array} Returns the converted array.
+ * @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
@@ -183,7 +186,8 @@ var funcToString = Function.prototype.toString;
var hasOwnProperty = objectProto.hasOwnProperty;
/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
@@ -206,18 +210,18 @@ var DataView = getNative(root, 'DataView'),
WeakMap = getNative(root, 'WeakMap');
/** Used to detect maps, sets, and weakmaps. */
-var dataViewCtorString = DataView ? (DataView + '') : '',
- mapCtorString = Map ? funcToString.call(Map) : '',
- promiseCtorString = Promise ? funcToString.call(Promise) : '',
- setCtorString = Set ? funcToString.call(Set) : '',
- weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : '';
+var dataViewCtorString = toSource(DataView),
+ mapCtorString = toSource(Map),
+ promiseCtorString = toSource(Promise),
+ setCtorString = toSource(Set),
+ weakMapCtorString = toSource(WeakMap);
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
- * @returns {Function} Returns the new function.
+ * @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
@@ -290,8 +294,8 @@ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(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) : '';
+ Ctor = result == objectTag ? value.constructor : undefined,
+ ctorString = Ctor ? toSource(Ctor) : undefined;
if (ctorString) {
switch (ctorString) {
@@ -306,6 +310,25 @@ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
};
}
+/**
+ * Converts `func` to its source code.
+ *
+ * @private
+ * @param {Function} func The function to process.
+ * @returns {string} Returns the source code.
+ */
+function toSource(func) {
+ if (func != null) {
+ try {
+ return funcToString.call(func);
+ } catch (e) {}
+ try {
+ return (func + '');
+ } catch (e) {}
+ }
+ return '';
+}
+
/**
* Checks if `value` is classified as an `Array` object.
*
@@ -421,8 +444,9 @@ function isLength(value) {
}
/**
- * 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('')`)
+ * Checks if `value` is the
+ * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
@@ -496,14 +520,11 @@ function isObjectLike(value) {
* // => false
*/
function isNative(value) {
- if (value == null) {
+ if (!isObject(value)) {
return false;
}
- if (isFunction(value)) {
- return reIsNative.test(funcToString.call(value));
- }
- return isObjectLike(value) &&
- (isHostObject(value) ? reIsNative : reIsHostCtor).test(value);
+ var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
+ return pattern.test(toSource(value));
}
/**
diff --git a/lodash.toarray/package.json b/lodash.toarray/package.json
index 50e1217c5..57d205fe0 100644
--- a/lodash.toarray/package.json
+++ b/lodash.toarray/package.json
@@ -1,6 +1,6 @@
{
"name": "lodash.toarray",
- "version": "4.2.3",
+ "version": "4.2.4",
"description": "The lodash method `_.toArray` exported as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",