mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Compare commits
1 Commits
4.2.3-npm-
...
4.2.4-npm-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
efac96034f |
@@ -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.
|
The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method.
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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.
|
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.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.
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
* lodash 4.2.3 (Custom Build) <https://lodash.com/>
|
* lodash 4.2.4 (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) {
|
||||||
@@ -137,7 +140,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;
|
||||||
@@ -176,8 +180,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.
|
||||||
@@ -192,7 +197,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 +206,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 +257,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 +285,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 +311,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 +335,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 +365,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 +400,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 +427,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 +440,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
|
||||||
*
|
*
|
||||||
@@ -479,7 +506,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' });
|
||||||
@@ -499,7 +526,8 @@ function isObjectLike(value) {
|
|||||||
* ');
|
* ');
|
||||||
*/
|
*/
|
||||||
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 +635,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
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash.template",
|
"name": "lodash.template",
|
||||||
"version": "4.2.3",
|
"version": "4.2.4",
|
||||||
"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",
|
||||||
|
|||||||
@@ -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.
|
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.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.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* lodash 4.2.3 (Custom Build) <https://lodash.com/>
|
* lodash (Custom Build) <https://lodash.com/>
|
||||||
* Build: `lodash modularize exports="npm" -o ./`
|
* Build: `lodash modularize exports="npm" -o ./`
|
||||||
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||||
* Released under MIT license <https://lodash.com/license>
|
* Released under MIT license <https://lodash.com/license>
|
||||||
@@ -24,7 +24,10 @@ var funcTag = '[object Function]',
|
|||||||
|
|
||||||
var dataViewTag = '[object DataView]';
|
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;
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
||||||
|
|
||||||
/** Used to detect host constructors (Safari). */
|
/** 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
|
* @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,
|
||||||
@@ -146,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,
|
||||||
@@ -183,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;
|
||||||
@@ -206,18 +210,18 @@ var DataView = getNative(root, 'DataView'),
|
|||||||
WeakMap = getNative(root, 'WeakMap');
|
WeakMap = getNative(root, 'WeakMap');
|
||||||
|
|
||||||
/** Used to detect maps, sets, and weakmaps. */
|
/** Used to detect maps, sets, and weakmaps. */
|
||||||
var dataViewCtorString = DataView ? (DataView + '') : '',
|
var dataViewCtorString = toSource(DataView),
|
||||||
mapCtorString = Map ? funcToString.call(Map) : '',
|
mapCtorString = toSource(Map),
|
||||||
promiseCtorString = Promise ? funcToString.call(Promise) : '',
|
promiseCtorString = toSource(Promise),
|
||||||
setCtorString = Set ? funcToString.call(Set) : '',
|
setCtorString = toSource(Set),
|
||||||
weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : '';
|
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) {
|
||||||
@@ -290,8 +294,8 @@ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
|||||||
(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) {
|
||||||
@@ -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.
|
* 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`.
|
* 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 _
|
||||||
@@ -496,14 +520,11 @@ 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash.toarray",
|
"name": "lodash.toarray",
|
||||||
"version": "4.2.3",
|
"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",
|
||||||
|
|||||||
Reference in New Issue
Block a user