mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Compare commits
2 Commits
3.3.2-npm-
...
3.3.4-npm-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a9ba47586 | ||
|
|
61a48333a2 |
@@ -1,4 +1,4 @@
|
|||||||
# lodash v3.3.2
|
# lodash v3.3.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,4 +1,4 @@
|
|||||||
# lodash.callback v3.3.2
|
# lodash.callback v3.3.3
|
||||||
|
|
||||||
The [lodash](https://lodash.com/) method `_.callback` exported as a [Node.js](https://nodejs.org/) module.
|
The [lodash](https://lodash.com/) method `_.callback` exported as a [Node.js](https://nodejs.org/) module.
|
||||||
|
|
||||||
@@ -21,4 +21,4 @@ In Node.js/io.js:
|
|||||||
var callback = require('lodash.callback');
|
var callback = require('lodash.callback');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [documentation](https://lodash.com/docs#callback) or [package source](https://github.com/lodash/lodash/blob/3.3.2-npm-packages/lodash.callback) for more details.
|
See the [documentation](https://lodash.com/docs#callback) or [package source](https://github.com/lodash/lodash/blob/3.3.3-npm-packages/lodash.callback) for more details.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* lodash 3.3.2 (Custom Build) <https://lodash.com/>
|
* lodash 3.3.3 (Custom Build) <https://lodash.com/>
|
||||||
* Build: `lodash modern modularize exports="npm" -o ./`
|
* Build: `lodash modern modularize exports="npm" -o ./`
|
||||||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash.callback",
|
"name": "lodash.callback",
|
||||||
"version": "3.3.2",
|
"version": "3.3.3",
|
||||||
"description": "The modern build of lodash’s `_.callback` as a module.",
|
"description": "The lodash method `_.callback` exported as a module.",
|
||||||
"homepage": "https://lodash.com/",
|
"homepage": "https://lodash.com/",
|
||||||
"icon": "https://lodash.com/icon.svg",
|
"icon": "https://lodash.com/icon.svg",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": "lodash, lodash-modularized, stdlib, util",
|
|
||||||
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
"Benjamin Tan <demoneaux@gmail.com> (https://d10.github.io/)",
|
"Blaine Bublitz <blaine.bublitz@gmail.com> (https://github.com/phated)",
|
||||||
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
|
|
||||||
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
|
||||||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
||||||
],
|
],
|
||||||
"repository": "lodash/lodash",
|
"repository": "lodash/lodash",
|
||||||
|
|||||||
@@ -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.fill v3.3.2
|
# lodash.fill v3.3.4
|
||||||
|
|
||||||
The [lodash](https://lodash.com/) method `_.fill` exported as a [Node.js](https://nodejs.org/) module.
|
The [lodash](https://lodash.com/) method `_.fill` exported as a [Node.js](https://nodejs.org/) module.
|
||||||
|
|
||||||
@@ -15,4 +15,4 @@ In Node.js:
|
|||||||
var fill = require('lodash.fill');
|
var fill = require('lodash.fill');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [documentation](https://lodash.com/docs#fill) or [package source](https://github.com/lodash/lodash/blob/3.3.2-npm-packages/lodash.fill) for more details.
|
See the [documentation](https://lodash.com/docs#fill) or [package source](https://github.com/lodash/lodash/blob/3.3.4-npm-packages/lodash.fill) for more details.
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
* lodash 3.3.2 (Custom Build) <https://lodash.com/>
|
* lodash 3.3.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>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** Used as references for various `Number` constants. */
|
/** Used as references for various `Number` constants. */
|
||||||
@@ -18,7 +18,8 @@ var MAX_ARRAY_LENGTH = 4294967295;
|
|||||||
|
|
||||||
/** `Object#toString` result references. */
|
/** `Object#toString` result references. */
|
||||||
var funcTag = '[object Function]',
|
var funcTag = '[object Function]',
|
||||||
genTag = '[object GeneratorFunction]';
|
genTag = '[object GeneratorFunction]',
|
||||||
|
symbolTag = '[object Symbol]';
|
||||||
|
|
||||||
/** Used to match leading and trailing whitespace. */
|
/** Used to match leading and trailing whitespace. */
|
||||||
var reTrim = /^\s+|\s+$/g;
|
var reTrim = /^\s+|\s+$/g;
|
||||||
@@ -56,7 +57,8 @@ function isIndex(value, length) {
|
|||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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;
|
||||||
@@ -126,8 +128,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.
|
||||||
@@ -142,7 +145,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)) {
|
||||||
@@ -150,8 +154,9 @@ 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;
|
||||||
@@ -165,6 +170,7 @@ function isIterateeCall(value, index, object) {
|
|||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
* @since 3.2.0
|
||||||
* @category Array
|
* @category Array
|
||||||
* @param {Array} array The array to fill.
|
* @param {Array} array The array to fill.
|
||||||
* @param {*} value The value to fill `array` with.
|
* @param {*} value The value to fill `array` with.
|
||||||
@@ -198,11 +204,13 @@ function fill(array, value, start, end) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
@@ -238,6 +246,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`.
|
||||||
@@ -256,8 +265,7 @@ function eq(value, other) {
|
|||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isArrayLike(value) {
|
function isArrayLike(value) {
|
||||||
return value != null &&
|
return value != null && isLength(getLength(value)) && !isFunction(value);
|
||||||
!(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -265,9 +273,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(_);
|
||||||
@@ -278,8 +288,8 @@ function isArrayLike(value) {
|
|||||||
*/
|
*/
|
||||||
function isFunction(value) {
|
function isFunction(value) {
|
||||||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||||||
// in Safari 8 which returns 'object' for typed array constructors, and
|
// in Safari 8 which returns 'object' for typed array and weak map constructors,
|
||||||
// PhantomJS 1.9 which returns 'function' for `NodeList` instances.
|
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
|
||||||
var tag = isObject(value) ? objectToString.call(value) : '';
|
var tag = isObject(value) ? objectToString.call(value) : '';
|
||||||
return tag == funcTag || tag == genTag;
|
return tag == funcTag || tag == genTag;
|
||||||
}
|
}
|
||||||
@@ -287,13 +297,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);
|
||||||
@@ -314,11 +327,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`.
|
||||||
@@ -342,12 +357,65 @@ function isObject(value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts `value` to an integer.
|
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
||||||
*
|
* and has a `typeof` result of "object".
|
||||||
* **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
|
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
* @since 4.0.0
|
||||||
|
* @category Lang
|
||||||
|
* @param {*} value The value to check.
|
||||||
|
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* _.isObjectLike({});
|
||||||
|
* // => true
|
||||||
|
*
|
||||||
|
* _.isObjectLike([1, 2, 3]);
|
||||||
|
* // => true
|
||||||
|
*
|
||||||
|
* _.isObjectLike(_.noop);
|
||||||
|
* // => false
|
||||||
|
*
|
||||||
|
* _.isObjectLike(null);
|
||||||
|
* // => false
|
||||||
|
*/
|
||||||
|
function isObjectLike(value) {
|
||||||
|
return !!value && typeof value == 'object';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if `value` is classified as a `Symbol` primitive or object.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @memberOf _
|
||||||
|
* @since 4.0.0
|
||||||
|
* @category Lang
|
||||||
|
* @param {*} value The value to check.
|
||||||
|
* @returns {boolean} Returns `true` if `value` is correctly classified,
|
||||||
|
* else `false`.
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* _.isSymbol(Symbol.iterator);
|
||||||
|
* // => true
|
||||||
|
*
|
||||||
|
* _.isSymbol('abc');
|
||||||
|
* // => false
|
||||||
|
*/
|
||||||
|
function isSymbol(value) {
|
||||||
|
return typeof value == 'symbol' ||
|
||||||
|
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts `value` to an integer.
|
||||||
|
*
|
||||||
|
* **Note:** This function is loosely based on
|
||||||
|
* [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @memberOf _
|
||||||
|
* @since 4.0.0
|
||||||
* @category Lang
|
* @category Lang
|
||||||
* @param {*} value The value to convert.
|
* @param {*} value The value to convert.
|
||||||
* @returns {number} Returns the converted integer.
|
* @returns {number} Returns the converted integer.
|
||||||
@@ -382,10 +450,12 @@ function toInteger(value) {
|
|||||||
* Converts `value` to an integer suitable for use as the length of an
|
* Converts `value` to an integer suitable for use as the length of an
|
||||||
* array-like object.
|
* array-like object.
|
||||||
*
|
*
|
||||||
* **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
|
* **Note:** This method is 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 convert.
|
* @param {*} value The value to convert.
|
||||||
* @returns {number} Returns the converted integer.
|
* @returns {number} Returns the converted integer.
|
||||||
@@ -412,6 +482,7 @@ function toLength(value) {
|
|||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
* @since 4.0.0
|
||||||
* @category Lang
|
* @category Lang
|
||||||
* @param {*} value The value to process.
|
* @param {*} value The value to process.
|
||||||
* @returns {number} Returns the number.
|
* @returns {number} Returns the number.
|
||||||
@@ -430,6 +501,12 @@ function toLength(value) {
|
|||||||
* // => 3
|
* // => 3
|
||||||
*/
|
*/
|
||||||
function toNumber(value) {
|
function toNumber(value) {
|
||||||
|
if (typeof value == 'number') {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
if (isSymbol(value)) {
|
||||||
|
return NAN;
|
||||||
|
}
|
||||||
if (isObject(value)) {
|
if (isObject(value)) {
|
||||||
var other = isFunction(value.valueOf) ? value.valueOf() : value;
|
var other = isFunction(value.valueOf) ? value.valueOf() : value;
|
||||||
value = isObject(other) ? (other + '') : other;
|
value = isObject(other) ? (other + '') : other;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash.fill",
|
"name": "lodash.fill",
|
||||||
"version": "3.3.2",
|
"version": "3.3.4",
|
||||||
"description": "The lodash method `_.fill` exported as a module.",
|
"description": "The lodash method `_.fill` exported as a module.",
|
||||||
"homepage": "https://lodash.com/",
|
"homepage": "https://lodash.com/",
|
||||||
"icon": "https://lodash.com/icon.svg",
|
"icon": "https://lodash.com/icon.svg",
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
"Blaine Bublitz <blaine@iceddev.com> (https://github.com/phated)",
|
"Blaine Bublitz <blaine.bublitz@gmail.com> (https://github.com/phated)",
|
||||||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
||||||
],
|
],
|
||||||
"repository": "lodash/lodash",
|
"repository": "lodash/lodash",
|
||||||
|
|||||||
@@ -1,7 +1,17 @@
|
|||||||
Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||||
Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
|
|
||||||
|
Based on Underscore.js, copyright Jeremy Ashkenas,
|
||||||
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
|
||||||
|
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 following license applies to all parts of this software except as
|
||||||
|
documented below:
|
||||||
|
|
||||||
|
====
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
"Software"), to deal in the Software without restriction, including
|
"Software"), to deal in the Software without restriction, including
|
||||||
@@ -20,3 +30,18 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|||||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
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.inrange v3.3.2
|
# lodash.inrange v3.3.4
|
||||||
|
|
||||||
The [lodash](https://lodash.com/) method `_.inRange` exported as a [Node.js](https://nodejs.org/) module.
|
The [lodash](https://lodash.com/) method `_.inRange` exported as a [Node.js](https://nodejs.org/) module.
|
||||||
|
|
||||||
@@ -15,4 +15,4 @@ In Node.js:
|
|||||||
var inRange = require('lodash.inrange');
|
var inRange = require('lodash.inrange');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [documentation](https://lodash.com/docs#inRange) or [package source](https://github.com/lodash/lodash/blob/3.3.2-npm-packages/lodash.inrange) for more details.
|
See the [documentation](https://lodash.com/docs#inRange) or [package source](https://github.com/lodash/lodash/blob/3.3.4-npm-packages/lodash.inrange) for more details.
|
||||||
|
|||||||
@@ -1,27 +1,226 @@
|
|||||||
/**
|
/**
|
||||||
* lodash 3.3.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>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Native method references for those with the same name as other `lodash` methods. */
|
/** Used as references for various `Number` constants. */
|
||||||
|
var NAN = 0 / 0;
|
||||||
|
|
||||||
|
/** `Object#toString` result references. */
|
||||||
|
var funcTag = '[object Function]',
|
||||||
|
genTag = '[object GeneratorFunction]',
|
||||||
|
symbolTag = '[object Symbol]';
|
||||||
|
|
||||||
|
/** Used to match leading and trailing whitespace. */
|
||||||
|
var reTrim = /^\s+|\s+$/g;
|
||||||
|
|
||||||
|
/** Used to detect bad signed hexadecimal string values. */
|
||||||
|
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
||||||
|
|
||||||
|
/** Used to detect binary string values. */
|
||||||
|
var reIsBinary = /^0b[01]+$/i;
|
||||||
|
|
||||||
|
/** Used to detect octal string values. */
|
||||||
|
var reIsOctal = /^0o[0-7]+$/i;
|
||||||
|
|
||||||
|
/** Built-in method references without a dependency on `root`. */
|
||||||
|
var freeParseInt = parseInt;
|
||||||
|
|
||||||
|
/** Used for built-in method references. */
|
||||||
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
|
* of values.
|
||||||
|
*/
|
||||||
|
var objectToString = objectProto.toString;
|
||||||
|
|
||||||
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||||
var nativeMax = Math.max,
|
var nativeMax = Math.max,
|
||||||
nativeMin = Math.min;
|
nativeMin = Math.min;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `n` is between `start` and up to but not including, `end`. If
|
* The base implementation of `_.inRange` which doesn't coerce arguments.
|
||||||
* `end` is not specified it is set to `start` with `start` then set to `0`.
|
*
|
||||||
|
* @private
|
||||||
|
* @param {number} number The number to check.
|
||||||
|
* @param {number} start The start of the range.
|
||||||
|
* @param {number} end The end of the range.
|
||||||
|
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
|
||||||
|
*/
|
||||||
|
function baseInRange(number, start, end) {
|
||||||
|
return number >= nativeMin(start, end) && number < nativeMax(start, end);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if `value` is classified as a `Function` object.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
* @since 0.1.0
|
||||||
|
* @category Lang
|
||||||
|
* @param {*} value The value to check.
|
||||||
|
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* _.isFunction(_);
|
||||||
|
* // => true
|
||||||
|
*
|
||||||
|
* _.isFunction(/abc/);
|
||||||
|
* // => false
|
||||||
|
*/
|
||||||
|
function isFunction(value) {
|
||||||
|
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||||||
|
// in Safari 8 which returns 'object' for typed array and weak map constructors,
|
||||||
|
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
|
||||||
|
var tag = isObject(value) ? objectToString.call(value) : '';
|
||||||
|
return tag == funcTag || tag == genTag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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`.
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* _.isObject({});
|
||||||
|
* // => true
|
||||||
|
*
|
||||||
|
* _.isObject([1, 2, 3]);
|
||||||
|
* // => true
|
||||||
|
*
|
||||||
|
* _.isObject(_.noop);
|
||||||
|
* // => true
|
||||||
|
*
|
||||||
|
* _.isObject(null);
|
||||||
|
* // => false
|
||||||
|
*/
|
||||||
|
function isObject(value) {
|
||||||
|
var type = typeof value;
|
||||||
|
return !!value && (type == 'object' || type == 'function');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
||||||
|
* and has a `typeof` result of "object".
|
||||||
|
*
|
||||||
|
* @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`.
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* _.isObjectLike({});
|
||||||
|
* // => true
|
||||||
|
*
|
||||||
|
* _.isObjectLike([1, 2, 3]);
|
||||||
|
* // => true
|
||||||
|
*
|
||||||
|
* _.isObjectLike(_.noop);
|
||||||
|
* // => false
|
||||||
|
*
|
||||||
|
* _.isObjectLike(null);
|
||||||
|
* // => false
|
||||||
|
*/
|
||||||
|
function isObjectLike(value) {
|
||||||
|
return !!value && typeof value == 'object';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if `value` is classified as a `Symbol` primitive or object.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @memberOf _
|
||||||
|
* @since 4.0.0
|
||||||
|
* @category Lang
|
||||||
|
* @param {*} value The value to check.
|
||||||
|
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* _.isSymbol(Symbol.iterator);
|
||||||
|
* // => true
|
||||||
|
*
|
||||||
|
* _.isSymbol('abc');
|
||||||
|
* // => false
|
||||||
|
*/
|
||||||
|
function isSymbol(value) {
|
||||||
|
return typeof value == 'symbol' ||
|
||||||
|
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts `value` to a number.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @memberOf _
|
||||||
|
* @since 4.0.0
|
||||||
|
* @category Lang
|
||||||
|
* @param {*} value The value to process.
|
||||||
|
* @returns {number} Returns the number.
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* _.toNumber(3.2);
|
||||||
|
* // => 3.2
|
||||||
|
*
|
||||||
|
* _.toNumber(Number.MIN_VALUE);
|
||||||
|
* // => 5e-324
|
||||||
|
*
|
||||||
|
* _.toNumber(Infinity);
|
||||||
|
* // => Infinity
|
||||||
|
*
|
||||||
|
* _.toNumber('3.2');
|
||||||
|
* // => 3.2
|
||||||
|
*/
|
||||||
|
function toNumber(value) {
|
||||||
|
if (typeof value == 'number') {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
if (isSymbol(value)) {
|
||||||
|
return NAN;
|
||||||
|
}
|
||||||
|
if (isObject(value)) {
|
||||||
|
var other = isFunction(value.valueOf) ? value.valueOf() : value;
|
||||||
|
value = isObject(other) ? (other + '') : other;
|
||||||
|
}
|
||||||
|
if (typeof value != 'string') {
|
||||||
|
return value === 0 ? value : +value;
|
||||||
|
}
|
||||||
|
value = value.replace(reTrim, '');
|
||||||
|
var isBinary = reIsBinary.test(value);
|
||||||
|
return (isBinary || reIsOctal.test(value))
|
||||||
|
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
||||||
|
: (reIsBadHex.test(value) ? NAN : +value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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`.
|
||||||
|
* If `start` is greater than `end` the params are swapped to support
|
||||||
|
* negative ranges.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @memberOf _
|
||||||
|
* @since 3.3.0
|
||||||
* @category Number
|
* @category Number
|
||||||
* @param {number} n The number to check.
|
* @param {number} number The number to check.
|
||||||
* @param {number} [start=0] The start of the range.
|
* @param {number} [start=0] The start of the range.
|
||||||
* @param {number} end The end of the range.
|
* @param {number} end The end of the range.
|
||||||
* @returns {boolean} Returns `true` if `n` is in the range, else `false`.
|
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
|
||||||
|
* @see _.range, _.rangeRight
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* _.inRange(3, 2, 4);
|
* _.inRange(3, 2, 4);
|
||||||
@@ -41,16 +240,20 @@ var nativeMax = Math.max,
|
|||||||
*
|
*
|
||||||
* _.inRange(5.2, 4);
|
* _.inRange(5.2, 4);
|
||||||
* // => false
|
* // => false
|
||||||
|
*
|
||||||
|
* _.inRange(-3, -2, -6);
|
||||||
|
* // => true
|
||||||
*/
|
*/
|
||||||
function inRange(value, start, end) {
|
function inRange(number, start, end) {
|
||||||
start = +start || 0;
|
start = toNumber(start) || 0;
|
||||||
if (end === undefined) {
|
if (end === undefined) {
|
||||||
end = start;
|
end = start;
|
||||||
start = 0;
|
start = 0;
|
||||||
} else {
|
} else {
|
||||||
end = +end || 0;
|
end = toNumber(end) || 0;
|
||||||
}
|
}
|
||||||
return value >= nativeMin(start, end) && value < nativeMax(start, end);
|
number = toNumber(number);
|
||||||
|
return baseInRange(number, start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = inRange;
|
module.exports = inRange;
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash.inrange",
|
"name": "lodash.inrange",
|
||||||
"version": "3.3.2",
|
"version": "3.3.4",
|
||||||
"description": "The lodash method `_.inRange` exported as a module.",
|
"description": "The lodash method `_.inRange` exported as a module.",
|
||||||
"homepage": "https://lodash.com/",
|
"homepage": "https://lodash.com/",
|
||||||
"icon": "https://lodash.com/icon.svg",
|
"icon": "https://lodash.com/icon.svg",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": "lodash, lodash-modularized, stdlib, util, inrange",
|
"keywords": "lodash-modularized, inrange",
|
||||||
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
"Blaine Bublitz <blaine@iceddev.com> (https://github.com/phated)",
|
"Blaine Bublitz <blaine.bublitz@gmail.com> (https://github.com/phated)",
|
||||||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
||||||
],
|
],
|
||||||
"repository": "lodash/lodash",
|
"repository": "lodash/lodash",
|
||||||
|
|||||||
Reference in New Issue
Block a user