Compare commits

...

3 Commits

Author SHA1 Message Date
John-David Dalton
ecb20e4c11 Bump to v4.2.5. 2019-07-09 21:54:38 -07:00
John-David Dalton
efac96034f Bump to v4.2.4. 2019-07-09 21:54:37 -07:00
John-David Dalton
de03050e76 Bump to v4.2.3. 2019-07-09 21:54:37 -07:00
9 changed files with 262 additions and 133 deletions

View File

@@ -1,4 +1,4 @@
# lodash v4.2.2 # lodash v4.2.5
The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method. The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method.

View File

@@ -1,23 +1,47 @@
The MIT License (MIT) Copyright jQuery Foundation and other contributors <https://jquery.org/>
Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> Based on Underscore.js, copyright Jeremy Ashkenas,
Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
Permission is hereby granted, free of charge, to any person obtaining a copy This software consists of voluntary contributions made by many
of this software and associated documentation files (the "Software"), to deal individuals. For exact contribution history, see the revision history
in the Software without restriction, including without limitation the rights available at https://github.com/lodash/lodash
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 The following license applies to all parts of this software except as
copies or substantial portions of the Software. 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 Permission is hereby granted, free of charge, to any person obtaining
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER a copy of this software and associated documentation files (the
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, "Software"), to deal in the Software without restriction, including
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE without limitation the rights to use, copy, modify, merge, publish,
SOFTWARE. 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.

View File

@@ -1,4 +1,4 @@
# lodash.template v4.2.2 # lodash.template v4.2.5
The [lodash](https://lodash.com/) method `_.template` exported as a [Node.js](https://nodejs.org/) module. 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'); var template = require('lodash.template');
``` ```
See the [documentation](https://lodash.com/docs#template) or [package source](https://github.com/lodash/lodash/blob/4.2.2-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.5-npm-packages/lodash.template) for more details.

View File

@@ -1,10 +1,10 @@
/** /**
* lodash 4.2.2 (Custom Build) <https://lodash.com/> * lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./` * Build: `lodash modularize exports="npm" -o ./`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> * Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
*/ */
var assignInWith = require('lodash.assigninwith'), var assignInWith = require('lodash.assigninwith'),
keys = require('lodash.keys'), keys = require('lodash.keys'),
@@ -26,7 +26,10 @@ var reEmptyStringLeading = /\b__p \+= '';/g,
reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/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; var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
/** Used to detect unsigned integer values. */ /** Used to detect unsigned integer values. */
@@ -55,7 +58,7 @@ var stringEscapes = {
* @private * @private
* @param {Function} func The function to invoke. * @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`. * @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`. * @returns {*} Returns the result of `func`.
*/ */
function apply(func, thisArg, args) { function apply(func, thisArg, args) {
@@ -116,20 +119,6 @@ function escapeStringChar(chr) {
return '\\' + stringEscapes[chr]; return '\\' + stringEscapes[chr];
} }
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
length = length == null ? MAX_SAFE_INTEGER : length;
return value > -1 && value % 1 == 0 && value < length;
}
/** Used for built-in method references. */ /** Used for built-in method references. */
var objectProto = Object.prototype; var objectProto = Object.prototype;
@@ -137,7 +126,8 @@ var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty; 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. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -165,7 +155,7 @@ function assignInDefaults(objValue, srcValue, key, object) {
* *
* @private * @private
* @param {string} key The key of the property to get. * @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) { function baseProperty(key) {
return function(object) { return function(object) {
@@ -176,8 +166,9 @@ function baseProperty(key) {
/** /**
* Gets the "length" property value of `object`. * 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) * **Note:** This function is used to avoid a
* that affects Safari on at least iOS 8.1-8.3 ARM64. * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
@@ -185,6 +176,21 @@ function baseProperty(key) {
*/ */
var getLength = baseProperty('length'); var getLength = baseProperty('length');
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
}
/** /**
* Checks if the given arguments are from an iteratee call. * Checks if the given arguments are from an iteratee call.
* *
@@ -192,7 +198,8 @@ var getLength = baseProperty('length');
* @param {*} value The potential iteratee value argument. * @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument. * @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object 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) { function isIterateeCall(value, index, object) {
if (!isObject(object)) { if (!isObject(object)) {
@@ -200,19 +207,22 @@ function isIterateeCall(value, index, object) {
} }
var type = typeof index; var type = typeof index;
if (type == 'number' if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length)) ? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)) { : (type == 'string' && index in object)
) {
return eq(object[index], value); return eq(object[index], value);
} }
return false; 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. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to compare. * @param {*} value The value to compare.
* @param {*} other The other value to compare. * @param {*} other The other value to compare.
@@ -248,6 +258,7 @@ function eq(value, other) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
@@ -275,9 +286,11 @@ function isArrayLike(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 3.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @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 * @example
* *
* _.isError(new Error); * _.isError(new Error);
@@ -299,9 +312,11 @@ function isError(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @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 * @example
* *
* _.isFunction(_); * _.isFunction(_);
@@ -321,13 +336,16 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * 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 * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @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 * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -348,11 +366,13 @@ function isLength(value) {
} }
/** /**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. * Checks if `value` is the
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * [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 * @static
* @memberOf _ * @memberOf _
* @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
@@ -381,6 +401,7 @@ function isObject(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
@@ -407,7 +428,7 @@ function isObjectLike(value) {
* in "interpolate" delimiters, HTML-escape interpolated data properties in * in "interpolate" delimiters, HTML-escape interpolated data properties in
* "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
* properties may be accessed as free variables in the template. If a setting * 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 * **Note:** In the development build `_.template` utilizes
* [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
@@ -420,17 +441,24 @@ function isObjectLike(value) {
* [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
* *
* @static * @static
* @since 0.1.0
* @memberOf _ * @memberOf _
* @category String * @category String
* @param {string} [string=''] The template string. * @param {string} [string=''] The template string.
* @param {Object} [options] The options object. * @param {Object} [options={}] The options object.
* @param {RegExp} [options.escape] The HTML "escape" delimiter. * @param {RegExp} [options.escape=_.templateSettings.escape]
* @param {RegExp} [options.evaluate] The "evaluate" delimiter. * The HTML "escape" delimiter.
* @param {Object} [options.imports] An object to import into the template as free variables. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
* @param {RegExp} [options.interpolate] The "interpolate" delimiter. * The "evaluate" delimiter.
* @param {string} [options.sourceURL] The sourceURL of the template's compiled source. * @param {Object} [options.imports=_.templateSettings.imports]
* @param {string} [options.variable] The data object variable name. * An object to import into the template as free variables.
* @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. * @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. * @returns {Function} Returns the compiled template function.
* @example * @example
* *
@@ -459,12 +487,6 @@ function isObjectLike(value) {
* compiled({ 'user': 'pebbles' }); * compiled({ 'user': 'pebbles' });
* // => 'hello pebbles!' * // => 'hello pebbles!'
* *
* // Use custom template delimiters.
* _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
* var compiled = _.template('hello {{ user }}!');
* compiled({ 'user': 'mustache' });
* // => 'hello mustache!'
*
* // Use backslashes to treat delimiters as plain text. * // Use backslashes to treat delimiters as plain text.
* var compiled = _.template('<%= "\\<%- value %\\>" %>'); * var compiled = _.template('<%= "\\<%- value %\\>" %>');
* compiled({ 'value': 'ignored' }); * compiled({ 'value': 'ignored' });
@@ -479,7 +501,7 @@ function isObjectLike(value) {
* // Use the `sourceURL` option to specify a custom sourceURL for the template. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
* var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
* compiled(data); * 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. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
* var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
@@ -490,16 +512,23 @@ function isObjectLike(value) {
* // return __p; * // return __p;
* // } * // }
* *
* // Use custom template delimiters.
* _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
* var compiled = _.template('hello {{ user }}!');
* compiled({ 'user': 'mustache' });
* // => 'hello mustache!'
*
* // Use the `source` property to inline compiled templates for meaningful * // Use the `source` property to inline compiled templates for meaningful
* // line numbers in error messages and stack traces. * // line numbers in error messages and stack traces.
* fs.writeFileSync(path.join(cwd, 'jst.js'), '\ * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
* var JST = {\ * var JST = {\
* "main": ' + _.template(mainText).source + '\ * "main": ' + _.template(mainText).source + '\
* };\ * };\
* '); * ');
*/ */
function template(string, options, guard) { 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). // and Laura Doktorova's doT.js (https://github.com/olado/doT).
var settings = templateSettings.imports._.templateSettings || templateSettings; var settings = templateSettings.imports._.templateSettings || templateSettings;
@@ -607,8 +636,10 @@ function template(string, options, guard) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 3.0.0
* @category Util * @category Util
* @param {Function} func The function to attempt. * @param {Function} func The function to attempt.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {*} Returns the `func` result or error object. * @returns {*} Returns the `func` result or error object.
* @example * @example
* *

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.template", "name": "lodash.template",
"version": "4.2.2", "version": "4.2.5",
"description": "The lodash method `_.template` exported as a module.", "description": "The lodash method `_.template` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",
@@ -15,7 +15,7 @@
"repository": "lodash/lodash", "repository": "lodash/lodash",
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" },
"dependencies": { "dependencies": {
"lodash._reinterpolate": "^3.0.0", "lodash._reinterpolate": "~3.0.0",
"lodash.assigninwith": "^4.0.0", "lodash.assigninwith": "^4.0.0",
"lodash.keys": "^4.0.0", "lodash.keys": "^4.0.0",
"lodash.rest": "^4.0.0", "lodash.rest": "^4.0.0",

View File

@@ -1,23 +1,47 @@
The MIT License (MIT) Copyright jQuery Foundation and other contributors <https://jquery.org/>
Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> Based on Underscore.js, copyright Jeremy Ashkenas,
Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
Permission is hereby granted, free of charge, to any person obtaining a copy This software consists of voluntary contributions made by many
of this software and associated documentation files (the "Software"), to deal individuals. For exact contribution history, see the revision history
in the Software without restriction, including without limitation the rights available at https://github.com/lodash/lodash
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 The following license applies to all parts of this software except as
copies or substantial portions of the Software. 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 Permission is hereby granted, free of charge, to any person obtaining
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER a copy of this software and associated documentation files (the
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, "Software"), to deal in the Software without restriction, including
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE without limitation the rights to use, copy, modify, merge, publish,
SOFTWARE. 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.

View File

@@ -1,4 +1,4 @@
# lodash.toarray v4.2.2 # lodash.toarray v4.2.4
The [lodash](https://lodash.com/) method `_.toArray` exported as a [Node.js](https://nodejs.org/) module. 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'); var toArray = require('lodash.toarray');
``` ```
See the [documentation](https://lodash.com/docs#toArray) or [package source](https://github.com/lodash/lodash/blob/4.2.2-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.

View File

@@ -1,10 +1,10 @@
/** /**
* lodash 4.2.2 (Custom Build) <https://lodash.com/> * lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./` * Build: `lodash modularize exports="npm" -o ./`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> * Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
*/ */
var keys = require('lodash.keys'), var keys = require('lodash.keys'),
root = require('lodash._root'); root = require('lodash._root');
@@ -17,14 +17,20 @@ var funcTag = '[object Function]',
genTag = '[object GeneratorFunction]', genTag = '[object GeneratorFunction]',
mapTag = '[object Map]', mapTag = '[object Map]',
objectTag = '[object Object]', objectTag = '[object Object]',
promiseTag = '[object Promise]',
setTag = '[object Set]', setTag = '[object Set]',
stringTag = '[object String]', stringTag = '[object String]',
weakMapTag = '[object WeakMap]'; weakMapTag = '[object WeakMap]';
/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ var dataViewTag = '[object DataView]';
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari > 5). */ /** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/; var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used to compose unicode character classes. */ /** Used to compose unicode character classes. */
@@ -126,11 +132,11 @@ function iteratorToArray(iterator) {
} }
/** /**
* Converts `map` to an array. * Converts `map` to its key-value pairs.
* *
* @private * @private
* @param {Object} map The map to convert. * @param {Object} map The map to convert.
* @returns {Array} Returns the converted array. * @returns {Array} Returns the key-value pairs.
*/ */
function mapToArray(map) { function mapToArray(map) {
var index = -1, var index = -1,
@@ -143,11 +149,11 @@ function mapToArray(map) {
} }
/** /**
* Converts `set` to an array. * Converts `set` to an array of its values.
* *
* @private * @private
* @param {Object} set The set to convert. * @param {Object} set The set to convert.
* @returns {Array} Returns the converted array. * @returns {Array} Returns the values.
*/ */
function setToArray(set) { function setToArray(set) {
var index = -1, var index = -1,
@@ -180,7 +186,8 @@ var funcToString = Function.prototype.toString;
var hasOwnProperty = objectProto.hasOwnProperty; 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. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -196,21 +203,25 @@ var Symbol = root.Symbol,
iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined; iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map'), var DataView = getNative(root, 'DataView'),
Map = getNative(root, 'Map'),
Promise = getNative(root, 'Promise'),
Set = getNative(root, 'Set'), Set = getNative(root, 'Set'),
WeakMap = getNative(root, 'WeakMap'); WeakMap = getNative(root, 'WeakMap');
/** Used to detect maps, sets, and weakmaps. */ /** Used to detect maps, sets, and weakmaps. */
var mapCtorString = Map ? funcToString.call(Map) : '', var dataViewCtorString = toSource(DataView),
setCtorString = Set ? funcToString.call(Set) : '', mapCtorString = toSource(Map),
weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/** /**
* The base implementation of `_.property` without support for deep paths. * The base implementation of `_.property` without support for deep paths.
* *
* @private * @private
* @param {string} key The key of the property to get. * @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) { function baseProperty(key) {
return function(object) { return function(object) {
@@ -240,8 +251,9 @@ function copyArray(source, array) {
/** /**
* Gets the "length" property value of `object`. * 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) * **Note:** This function is used to avoid a
* that affects Safari on at least iOS 8.1-8.3 ARM64. * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
@@ -273,18 +285,23 @@ function getTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
// Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. // Fallback for data views, maps, sets, and weak maps in IE 11,
if ((Map && getTag(new Map) != mapTag) || // for data views in Edge, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) ||
(Set && getTag(new Set) != setTag) || (Set && getTag(new Set) != setTag) ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) { (WeakMap && getTag(new WeakMap) != weakMapTag)) {
getTag = function(value) { getTag = function(value) {
var result = objectToString.call(value), var result = objectToString.call(value),
Ctor = result == objectTag ? value.constructor : null, Ctor = result == objectTag ? value.constructor : undefined,
ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; ctorString = Ctor ? toSource(Ctor) : undefined;
if (ctorString) { if (ctorString) {
switch (ctorString) { switch (ctorString) {
case dataViewCtorString: return dataViewTag;
case mapCtorString: return mapTag; case mapCtorString: return mapTag;
case promiseCtorString: return promiseTag;
case setCtorString: return setTag; case setCtorString: return setTag;
case weakMapCtorString: return weakMapTag; case weakMapCtorString: return weakMapTag;
} }
@@ -293,15 +310,36 @@ if ((Map && getTag(new Map) != mapTag) ||
}; };
} }
/**
* 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. * Checks if `value` is classified as an `Array` object.
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 0.1.0
* @type {Function} * @type {Function}
* @category Lang * @category Lang
* @param {*} value The value to check. * @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 * @example
* *
* _.isArray([1, 2, 3]); * _.isArray([1, 2, 3]);
@@ -325,6 +363,7 @@ var isArray = Array.isArray;
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
@@ -351,9 +390,11 @@ function isArrayLike(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @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 * @example
* *
* _.isFunction(_); * _.isFunction(_);
@@ -373,13 +414,16 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * 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 * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @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 * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -400,11 +444,13 @@ function isLength(value) {
} }
/** /**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. * Checks if `value` is the
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * [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 * @static
* @memberOf _ * @memberOf _
* @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
@@ -433,6 +479,7 @@ function isObject(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
@@ -459,9 +506,11 @@ function isObjectLike(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 3.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function, else `false`. * @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
* @example * @example
* *
* _.isNative(Array.prototype.push); * _.isNative(Array.prototype.push);
@@ -471,24 +520,23 @@ function isObjectLike(value) {
* // => false * // => false
*/ */
function isNative(value) { function isNative(value) {
if (value == null) { if (!isObject(value)) {
return false; return false;
} }
if (isFunction(value)) { var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
return reIsNative.test(funcToString.call(value)); return pattern.test(toSource(value));
}
return isObjectLike(value) &&
(isHostObject(value) ? reIsNative : reIsHostCtor).test(value);
} }
/** /**
* Checks if `value` is classified as a `String` primitive or object. * Checks if `value` is classified as a `String` primitive or object.
* *
* @static * @static
* @since 0.1.0
* @memberOf _ * @memberOf _
* @category Lang * @category Lang
* @param {*} value The value to check. * @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 * @example
* *
* _.isString('abc'); * _.isString('abc');
@@ -506,6 +554,7 @@ function isString(value) {
* Converts `value` to an array. * Converts `value` to an array.
* *
* @static * @static
* @since 0.1.0
* @memberOf _ * @memberOf _
* @category Lang * @category Lang
* @param {*} value The value to convert. * @param {*} value The value to convert.
@@ -541,11 +590,12 @@ function toArray(value) {
} }
/** /**
* Creates an array of the own enumerable property values of `object`. * Creates an array of the own enumerable string keyed property values of `object`.
* *
* **Note:** Non-object values are coerced to objects. * **Note:** Non-object values are coerced to objects.
* *
* @static * @static
* @since 0.1.0
* @memberOf _ * @memberOf _
* @category Object * @category Object
* @param {Object} object The object to query. * @param {Object} object The object to query.

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.toarray", "name": "lodash.toarray",
"version": "4.2.2", "version": "4.2.4",
"description": "The lodash method `_.toArray` exported as a module.", "description": "The lodash method `_.toArray` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",