mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Compare commits
6 Commits
4.7.0-npm
...
4.11.0-npm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63ba93dcb3 | ||
|
|
be0bf2681b | ||
|
|
7d39d58e43 | ||
|
|
7c17af79c7 | ||
|
|
3f407aa255 | ||
|
|
ee6ec2f672 |
@@ -1,6 +1,6 @@
|
|||||||
# lodash v4.7.0
|
# lodash v4.11.0
|
||||||
|
|
||||||
The [lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules.
|
The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -28,11 +28,11 @@ var chunk = require('lodash/chunk');
|
|||||||
var extend = require('lodash/fp/extend');
|
var extend = require('lodash/fp/extend');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [package source](https://github.com/lodash/lodash/tree/4.7.0-npm) for more details.
|
See the [package source](https://github.com/lodash/lodash/tree/4.11.0-npm) for more details.
|
||||||
|
|
||||||
**Note:**<br>
|
**Note:**<br>
|
||||||
Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.<br>
|
Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.<br>
|
||||||
Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes lodash by default.
|
Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes `lodash` by default.
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
|
|||||||
2
_Hash.js
2
_Hash.js
@@ -4,7 +4,7 @@ var nativeCreate = require('./_nativeCreate');
|
|||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an hash object.
|
* Creates a hash object.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @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) {
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
var arrayPush = require('./_arrayPush'),
|
var arrayPush = require('./_arrayPush'),
|
||||||
isArguments = require('./isArguments'),
|
isFlattenable = require('./_isFlattenable');
|
||||||
isArray = require('./isArray'),
|
|
||||||
isArrayLikeObject = require('./isArrayLikeObject');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.flatten` with support for restricting flattening.
|
* The base implementation of `_.flatten` with support for restricting flattening.
|
||||||
@@ -9,23 +7,24 @@ var arrayPush = require('./_arrayPush'),
|
|||||||
* @private
|
* @private
|
||||||
* @param {Array} array The array to flatten.
|
* @param {Array} array The array to flatten.
|
||||||
* @param {number} depth The maximum recursion depth.
|
* @param {number} depth The maximum recursion depth.
|
||||||
* @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
|
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
|
||||||
|
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
|
||||||
* @param {Array} [result=[]] The initial result value.
|
* @param {Array} [result=[]] The initial result value.
|
||||||
* @returns {Array} Returns the new flattened array.
|
* @returns {Array} Returns the new flattened array.
|
||||||
*/
|
*/
|
||||||
function baseFlatten(array, depth, isStrict, result) {
|
function baseFlatten(array, depth, predicate, isStrict, result) {
|
||||||
result || (result = []);
|
|
||||||
|
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = array.length;
|
length = array.length;
|
||||||
|
|
||||||
|
predicate || (predicate = isFlattenable);
|
||||||
|
result || (result = []);
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
var value = array[index];
|
var value = array[index];
|
||||||
if (depth > 0 && isArrayLikeObject(value) &&
|
if (depth > 0 && predicate(value)) {
|
||||||
(isStrict || isArray(value) || isArguments(value))) {
|
|
||||||
if (depth > 1) {
|
if (depth > 1) {
|
||||||
// Recursively flatten arrays (susceptible to call stack limits).
|
// Recursively flatten arrays (susceptible to call stack limits).
|
||||||
baseFlatten(value, depth - 1, isStrict, result);
|
baseFlatten(value, depth - 1, predicate, isStrict, result);
|
||||||
} else {
|
} else {
|
||||||
arrayPush(result, value);
|
arrayPush(result, value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ var createBaseFor = require('./_createBaseFor');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `baseForOwn` which iterates over `object`
|
* The base implementation of `baseForOwn` which iterates over `object`
|
||||||
* properties returned by `keysFunc` invoking `iteratee` for each property.
|
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
||||||
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var baseCastPath = require('./_baseCastPath'),
|
var castPath = require('./_castPath'),
|
||||||
isKey = require('./_isKey');
|
isKey = require('./_isKey');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10,7 +10,7 @@ var baseCastPath = require('./_baseCastPath'),
|
|||||||
* @returns {*} Returns the resolved value.
|
* @returns {*} Returns the resolved value.
|
||||||
*/
|
*/
|
||||||
function baseGet(object, path) {
|
function baseGet(object, path) {
|
||||||
path = isKey(path, object) ? [path] : baseCastPath(path);
|
path = isKey(path, object) ? [path] : castPath(path);
|
||||||
|
|
||||||
var index = 0,
|
var index = 0,
|
||||||
length = path.length;
|
length = path.length;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
var apply = require('./_apply'),
|
var apply = require('./_apply'),
|
||||||
baseCastPath = require('./_baseCastPath'),
|
castPath = require('./_castPath'),
|
||||||
isKey = require('./_isKey'),
|
isKey = require('./_isKey'),
|
||||||
last = require('./last'),
|
last = require('./last'),
|
||||||
parent = require('./_parent');
|
parent = require('./_parent');
|
||||||
@@ -16,7 +16,7 @@ var apply = require('./_apply'),
|
|||||||
*/
|
*/
|
||||||
function baseInvoke(object, path, args) {
|
function baseInvoke(object, path, args) {
|
||||||
if (!isKey(path, object)) {
|
if (!isKey(path, object)) {
|
||||||
path = baseCastPath(path);
|
path = castPath(path);
|
||||||
object = parent(object, path);
|
object = parent(object, path);
|
||||||
path = last(path);
|
path = last(path);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
var baseIsMatch = require('./_baseIsMatch'),
|
var baseIsMatch = require('./_baseIsMatch'),
|
||||||
getMatchData = require('./_getMatchData');
|
getMatchData = require('./_getMatchData'),
|
||||||
|
matchesStrictComparable = require('./_matchesStrictComparable');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.matches` which doesn't clone `source`.
|
* The base implementation of `_.matches` which doesn't clone `source`.
|
||||||
@@ -11,16 +12,7 @@ var baseIsMatch = require('./_baseIsMatch'),
|
|||||||
function baseMatches(source) {
|
function baseMatches(source) {
|
||||||
var matchData = getMatchData(source);
|
var matchData = getMatchData(source);
|
||||||
if (matchData.length == 1 && matchData[0][2]) {
|
if (matchData.length == 1 && matchData[0][2]) {
|
||||||
var key = matchData[0][0],
|
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
|
||||||
value = matchData[0][1];
|
|
||||||
|
|
||||||
return function(object) {
|
|
||||||
if (object == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return object[key] === value &&
|
|
||||||
(value !== undefined || (key in Object(object)));
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
return function(object) {
|
return function(object) {
|
||||||
return object === source || baseIsMatch(object, source, matchData);
|
return object === source || baseIsMatch(object, source, matchData);
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
var baseIsEqual = require('./_baseIsEqual'),
|
var baseIsEqual = require('./_baseIsEqual'),
|
||||||
get = require('./get'),
|
get = require('./get'),
|
||||||
hasIn = require('./hasIn');
|
hasIn = require('./hasIn'),
|
||||||
|
isKey = require('./_isKey'),
|
||||||
|
isStrictComparable = require('./_isStrictComparable'),
|
||||||
|
matchesStrictComparable = require('./_matchesStrictComparable');
|
||||||
|
|
||||||
/** Used to compose bitmasks for comparison styles. */
|
/** Used to compose bitmasks for comparison styles. */
|
||||||
var UNORDERED_COMPARE_FLAG = 1,
|
var UNORDERED_COMPARE_FLAG = 1,
|
||||||
@@ -15,6 +18,9 @@ var UNORDERED_COMPARE_FLAG = 1,
|
|||||||
* @returns {Function} Returns the new function.
|
* @returns {Function} Returns the new function.
|
||||||
*/
|
*/
|
||||||
function baseMatchesProperty(path, srcValue) {
|
function baseMatchesProperty(path, srcValue) {
|
||||||
|
if (isKey(path) && isStrictComparable(srcValue)) {
|
||||||
|
return matchesStrictComparable(path, srcValue);
|
||||||
|
}
|
||||||
return function(object) {
|
return function(object) {
|
||||||
var objValue = get(object, path);
|
var objValue = get(object, path);
|
||||||
return (objValue === undefined && objValue === srcValue)
|
return (objValue === undefined && objValue === srcValue)
|
||||||
|
|||||||
20
_baseNth.js
Normal file
20
_baseNth.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
var isIndex = require('./_isIndex');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base implementation of `_.nth` which doesn't coerce `n` to an integer.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Array} array The array to query.
|
||||||
|
* @param {number} n The index of the element to return.
|
||||||
|
* @returns {*} Returns the nth element of `array`.
|
||||||
|
*/
|
||||||
|
function baseNth(array, n) {
|
||||||
|
var length = array.length;
|
||||||
|
if (!length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
n += n < 0 ? length : 0;
|
||||||
|
return isIndex(n, length) ? array[n] : undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = baseNth;
|
||||||
@@ -2,6 +2,7 @@ var arrayMap = require('./_arrayMap'),
|
|||||||
baseIteratee = require('./_baseIteratee'),
|
baseIteratee = require('./_baseIteratee'),
|
||||||
baseMap = require('./_baseMap'),
|
baseMap = require('./_baseMap'),
|
||||||
baseSortBy = require('./_baseSortBy'),
|
baseSortBy = require('./_baseSortBy'),
|
||||||
|
baseUnary = require('./_baseUnary'),
|
||||||
compareMultiple = require('./_compareMultiple'),
|
compareMultiple = require('./_compareMultiple'),
|
||||||
identity = require('./identity');
|
identity = require('./identity');
|
||||||
|
|
||||||
@@ -16,7 +17,7 @@ var arrayMap = require('./_arrayMap'),
|
|||||||
*/
|
*/
|
||||||
function baseOrderBy(collection, iteratees, orders) {
|
function baseOrderBy(collection, iteratees, orders) {
|
||||||
var index = -1;
|
var index = -1;
|
||||||
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseIteratee);
|
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
|
||||||
|
|
||||||
var result = baseMap(collection, function(value, key, collection) {
|
var result = baseMap(collection, function(value, key, collection) {
|
||||||
var criteria = arrayMap(iteratees, function(iteratee) {
|
var criteria = arrayMap(iteratees, function(iteratee) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var baseCastPath = require('./_baseCastPath'),
|
var castPath = require('./_castPath'),
|
||||||
isIndex = require('./_isIndex'),
|
isIndex = require('./_isIndex'),
|
||||||
isKey = require('./_isKey'),
|
isKey = require('./_isKey'),
|
||||||
last = require('./last'),
|
last = require('./last'),
|
||||||
@@ -31,7 +31,7 @@ function basePullAt(array, indexes) {
|
|||||||
splice.call(array, index, 1);
|
splice.call(array, index, 1);
|
||||||
}
|
}
|
||||||
else if (!isKey(index, array)) {
|
else if (!isKey(index, array)) {
|
||||||
var path = baseCastPath(index),
|
var path = castPath(index),
|
||||||
object = parent(array, path);
|
object = parent(array, path);
|
||||||
|
|
||||||
if (object != null) {
|
if (object != null) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
var assignValue = require('./_assignValue'),
|
var assignValue = require('./_assignValue'),
|
||||||
baseCastPath = require('./_baseCastPath'),
|
castPath = require('./_castPath'),
|
||||||
isIndex = require('./_isIndex'),
|
isIndex = require('./_isIndex'),
|
||||||
isKey = require('./_isKey'),
|
isKey = require('./_isKey'),
|
||||||
isObject = require('./isObject');
|
isObject = require('./isObject');
|
||||||
@@ -15,7 +15,7 @@ var assignValue = require('./_assignValue'),
|
|||||||
* @returns {Object} Returns `object`.
|
* @returns {Object} Returns `object`.
|
||||||
*/
|
*/
|
||||||
function baseSet(object, path, value, customizer) {
|
function baseSet(object, path, value, customizer) {
|
||||||
path = isKey(path, object) ? [path] : baseCastPath(path);
|
path = isKey(path, object) ? [path] : castPath(path);
|
||||||
|
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = path.length,
|
length = path.length,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var baseCastPath = require('./_baseCastPath'),
|
var castPath = require('./_castPath'),
|
||||||
has = require('./has'),
|
has = require('./has'),
|
||||||
isKey = require('./_isKey'),
|
isKey = require('./_isKey'),
|
||||||
last = require('./last'),
|
last = require('./last'),
|
||||||
@@ -13,7 +13,7 @@ var baseCastPath = require('./_baseCastPath'),
|
|||||||
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
|
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
|
||||||
*/
|
*/
|
||||||
function baseUnset(object, path) {
|
function baseUnset(object, path) {
|
||||||
path = isKey(path, object) ? [path] : baseCastPath(path);
|
path = isKey(path, object) ? [path] : castPath(path);
|
||||||
object = parent(object, path);
|
object = parent(object, path);
|
||||||
var key = last(path);
|
var key = last(path);
|
||||||
return (object != null && has(object, key)) ? delete object[key] : true;
|
return (object != null && has(object, key)) ? delete object[key] : true;
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ var isArrayLikeObject = require('./isArrayLikeObject');
|
|||||||
* @param {*} value The value to inspect.
|
* @param {*} value The value to inspect.
|
||||||
* @returns {Array|Object} Returns the cast array-like object.
|
* @returns {Array|Object} Returns the cast array-like object.
|
||||||
*/
|
*/
|
||||||
function baseCastArrayLikeObject(value) {
|
function castArrayLikeObject(value) {
|
||||||
return isArrayLikeObject(value) ? value : [];
|
return isArrayLikeObject(value) ? value : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = baseCastArrayLikeObject;
|
module.exports = castArrayLikeObject;
|
||||||
@@ -7,8 +7,8 @@ var identity = require('./identity');
|
|||||||
* @param {*} value The value to inspect.
|
* @param {*} value The value to inspect.
|
||||||
* @returns {Function} Returns cast function.
|
* @returns {Function} Returns cast function.
|
||||||
*/
|
*/
|
||||||
function baseCastFunction(value) {
|
function castFunction(value) {
|
||||||
return typeof value == 'function' ? value : identity;
|
return typeof value == 'function' ? value : identity;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = baseCastFunction;
|
module.exports = castFunction;
|
||||||
@@ -8,8 +8,8 @@ var isArray = require('./isArray'),
|
|||||||
* @param {*} value The value to inspect.
|
* @param {*} value The value to inspect.
|
||||||
* @returns {Array} Returns the cast property path array.
|
* @returns {Array} Returns the cast property path array.
|
||||||
*/
|
*/
|
||||||
function baseCastPath(value) {
|
function castPath(value) {
|
||||||
return isArray(value) ? value : stringToPath(value);
|
return isArray(value) ? value : stringToPath(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = baseCastPath;
|
module.exports = castPath;
|
||||||
18
_castSlice.js
Normal file
18
_castSlice.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
var baseSlice = require('./_baseSlice');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Casts `array` to a slice if it's needed.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Array} array The array to inspect.
|
||||||
|
* @param {number} start The start position.
|
||||||
|
* @param {number} [end=array.length] The end position.
|
||||||
|
* @returns {Array} Returns the cast slice.
|
||||||
|
*/
|
||||||
|
function castSlice(array, start, end) {
|
||||||
|
var length = array.length;
|
||||||
|
end = end === undefined ? length : end;
|
||||||
|
return (!start && end >= length) ? array : baseSlice(array, start, end);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = castSlice;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
var copyObjectWith = require('./_copyObjectWith');
|
var assignValue = require('./_assignValue');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies properties of `source` to `object`.
|
* Copies properties of `source` to `object`.
|
||||||
@@ -7,10 +7,25 @@ var copyObjectWith = require('./_copyObjectWith');
|
|||||||
* @param {Object} source The object to copy properties from.
|
* @param {Object} source The object to copy properties from.
|
||||||
* @param {Array} props The property identifiers to copy.
|
* @param {Array} props The property identifiers to copy.
|
||||||
* @param {Object} [object={}] The object to copy properties to.
|
* @param {Object} [object={}] The object to copy properties to.
|
||||||
|
* @param {Function} [customizer] The function to customize copied values.
|
||||||
* @returns {Object} Returns `object`.
|
* @returns {Object} Returns `object`.
|
||||||
*/
|
*/
|
||||||
function copyObject(source, props, object) {
|
function copyObject(source, props, object, customizer) {
|
||||||
return copyObjectWith(source, props, object);
|
object || (object = {});
|
||||||
|
|
||||||
|
var index = -1,
|
||||||
|
length = props.length;
|
||||||
|
|
||||||
|
while (++index < length) {
|
||||||
|
var key = props[index];
|
||||||
|
|
||||||
|
var newValue = customizer
|
||||||
|
? customizer(object[key], source[key], key, object, source)
|
||||||
|
: source[key];
|
||||||
|
|
||||||
|
assignValue(object, key, newValue);
|
||||||
|
}
|
||||||
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = copyObject;
|
module.exports = copyObject;
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
var assignValue = require('./_assignValue');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function is like `copyObject` except that it accepts a function to
|
|
||||||
* customize copied values.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {Object} source The object to copy properties from.
|
|
||||||
* @param {Array} props The property identifiers to copy.
|
|
||||||
* @param {Object} [object={}] The object to copy properties to.
|
|
||||||
* @param {Function} [customizer] The function to customize copied values.
|
|
||||||
* @returns {Object} Returns `object`.
|
|
||||||
*/
|
|
||||||
function copyObjectWith(source, props, object, customizer) {
|
|
||||||
object || (object = {});
|
|
||||||
|
|
||||||
var index = -1,
|
|
||||||
length = props.length;
|
|
||||||
|
|
||||||
while (++index < length) {
|
|
||||||
var key = props[index];
|
|
||||||
|
|
||||||
var newValue = customizer
|
|
||||||
? customizer(object[key], source[key], key, object, source)
|
|
||||||
: source[key];
|
|
||||||
|
|
||||||
assignValue(object, key, newValue);
|
|
||||||
}
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = copyObjectWith;
|
|
||||||
@@ -1,18 +1,8 @@
|
|||||||
var stringToArray = require('./_stringToArray'),
|
var castSlice = require('./_castSlice'),
|
||||||
|
reHasComplexSymbol = require('./_reHasComplexSymbol'),
|
||||||
|
stringToArray = require('./_stringToArray'),
|
||||||
toString = require('./toString');
|
toString = require('./toString');
|
||||||
|
|
||||||
/** Used to compose unicode character classes. */
|
|
||||||
var rsAstralRange = '\\ud800-\\udfff',
|
|
||||||
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
|
||||||
rsComboSymbolsRange = '\\u20d0-\\u20f0',
|
|
||||||
rsVarRange = '\\ufe0e\\ufe0f';
|
|
||||||
|
|
||||||
/** Used to compose unicode capture groups. */
|
|
||||||
var rsZWJ = '\\u200d';
|
|
||||||
|
|
||||||
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
|
|
||||||
var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function like `_.lowerFirst`.
|
* Creates a function like `_.lowerFirst`.
|
||||||
*
|
*
|
||||||
@@ -28,8 +18,13 @@ function createCaseFirst(methodName) {
|
|||||||
? stringToArray(string)
|
? stringToArray(string)
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
var chr = strSymbols ? strSymbols[0] : string.charAt(0),
|
var chr = strSymbols
|
||||||
trailing = strSymbols ? strSymbols.slice(1).join('') : string.slice(1);
|
? strSymbols[0]
|
||||||
|
: string.charAt(0);
|
||||||
|
|
||||||
|
var trailing = strSymbols
|
||||||
|
? castSlice(strSymbols, 1).join('')
|
||||||
|
: string.slice(1);
|
||||||
|
|
||||||
return chr[methodName]() + trailing;
|
return chr[methodName]() + trailing;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,12 @@ var arrayReduce = require('./_arrayReduce'),
|
|||||||
deburr = require('./deburr'),
|
deburr = require('./deburr'),
|
||||||
words = require('./words');
|
words = require('./words');
|
||||||
|
|
||||||
|
/** Used to compose unicode capture groups. */
|
||||||
|
var rsApos = "['\u2019]";
|
||||||
|
|
||||||
|
/** Used to match apostrophes. */
|
||||||
|
var reApos = RegExp(rsApos, 'g');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function like `_.camelCase`.
|
* Creates a function like `_.camelCase`.
|
||||||
*
|
*
|
||||||
@@ -11,7 +17,7 @@ var arrayReduce = require('./_arrayReduce'),
|
|||||||
*/
|
*/
|
||||||
function createCompounder(callback) {
|
function createCompounder(callback) {
|
||||||
return function(string) {
|
return function(string) {
|
||||||
return arrayReduce(words(deburr(string)), callback, '');
|
return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ var baseCreate = require('./_baseCreate'),
|
|||||||
*/
|
*/
|
||||||
function createCtorWrapper(Ctor) {
|
function createCtorWrapper(Ctor) {
|
||||||
return function() {
|
return function() {
|
||||||
// Use a `switch` statement to work with class constructors.
|
// Use a `switch` statement to work with class constructors. See
|
||||||
// See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
|
// http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
|
||||||
// for more details.
|
// for more details.
|
||||||
var args = arguments;
|
var args = arguments;
|
||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ var apply = require('./_apply'),
|
|||||||
arrayMap = require('./_arrayMap'),
|
arrayMap = require('./_arrayMap'),
|
||||||
baseFlatten = require('./_baseFlatten'),
|
baseFlatten = require('./_baseFlatten'),
|
||||||
baseIteratee = require('./_baseIteratee'),
|
baseIteratee = require('./_baseIteratee'),
|
||||||
|
baseUnary = require('./_baseUnary'),
|
||||||
|
isArray = require('./isArray'),
|
||||||
|
isFlattenableIteratee = require('./_isFlattenableIteratee'),
|
||||||
rest = require('./rest');
|
rest = require('./rest');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,7 +16,10 @@ var apply = require('./_apply'),
|
|||||||
*/
|
*/
|
||||||
function createOver(arrayFunc) {
|
function createOver(arrayFunc) {
|
||||||
return rest(function(iteratees) {
|
return rest(function(iteratees) {
|
||||||
iteratees = arrayMap(baseFlatten(iteratees, 1), baseIteratee);
|
iteratees = (iteratees.length == 1 && isArray(iteratees[0]))
|
||||||
|
? arrayMap(iteratees[0], baseUnary(baseIteratee))
|
||||||
|
: arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), baseUnary(baseIteratee));
|
||||||
|
|
||||||
return rest(function(args) {
|
return rest(function(args) {
|
||||||
var thisArg = this;
|
var thisArg = this;
|
||||||
return arrayFunc(iteratees, function(iteratee) {
|
return arrayFunc(iteratees, function(iteratee) {
|
||||||
|
|||||||
@@ -1,19 +1,9 @@
|
|||||||
var baseRepeat = require('./_baseRepeat'),
|
var baseRepeat = require('./_baseRepeat'),
|
||||||
|
castSlice = require('./_castSlice'),
|
||||||
|
reHasComplexSymbol = require('./_reHasComplexSymbol'),
|
||||||
stringSize = require('./_stringSize'),
|
stringSize = require('./_stringSize'),
|
||||||
stringToArray = require('./_stringToArray');
|
stringToArray = require('./_stringToArray');
|
||||||
|
|
||||||
/** Used to compose unicode character classes. */
|
|
||||||
var rsAstralRange = '\\ud800-\\udfff',
|
|
||||||
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
|
||||||
rsComboSymbolsRange = '\\u20d0-\\u20f0',
|
|
||||||
rsVarRange = '\\ufe0e\\ufe0f';
|
|
||||||
|
|
||||||
/** Used to compose unicode capture groups. */
|
|
||||||
var rsZWJ = '\\u200d';
|
|
||||||
|
|
||||||
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
|
|
||||||
var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
|
|
||||||
|
|
||||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||||
var nativeCeil = Math.ceil;
|
var nativeCeil = Math.ceil;
|
||||||
|
|
||||||
@@ -35,7 +25,7 @@ function createPadding(length, chars) {
|
|||||||
}
|
}
|
||||||
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
||||||
return reHasComplexSymbol.test(chars)
|
return reHasComplexSymbol.test(chars)
|
||||||
? stringToArray(result).slice(0, length).join('')
|
? castSlice(stringToArray(result), 0, length).join('')
|
||||||
: result.slice(0, length);
|
: result.slice(0, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,8 @@ var apply = require('./_apply'),
|
|||||||
var BIND_FLAG = 1;
|
var BIND_FLAG = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that wraps `func` to invoke it with the optional `this`
|
* Creates a function that wraps `func` to invoke it with the `this` binding
|
||||||
* binding of `thisArg` and the `partials` prepended to those provided to
|
* of `thisArg` and `partials` prepended to the arguments it receives.
|
||||||
* the wrapper.
|
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Function} func The function to wrap.
|
* @param {Function} func The function to wrap.
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
var copyArray = require('./_copyArray'),
|
var isLaziable = require('./_isLaziable'),
|
||||||
isLaziable = require('./_isLaziable'),
|
|
||||||
setData = require('./_setData');
|
setData = require('./_setData');
|
||||||
|
|
||||||
/** Used to compose bitmasks for wrapper metadata. */
|
/** Used to compose bitmasks for wrapper metadata. */
|
||||||
@@ -30,7 +29,6 @@ var BIND_FLAG = 1,
|
|||||||
*/
|
*/
|
||||||
function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
|
function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
|
||||||
var isCurry = bitmask & CURRY_FLAG,
|
var isCurry = bitmask & CURRY_FLAG,
|
||||||
newArgPos = argPos ? copyArray(argPos) : undefined,
|
|
||||||
newHolders = isCurry ? holders : undefined,
|
newHolders = isCurry ? holders : undefined,
|
||||||
newHoldersRight = isCurry ? undefined : holders,
|
newHoldersRight = isCurry ? undefined : holders,
|
||||||
newPartials = isCurry ? partials : undefined,
|
newPartials = isCurry ? partials : undefined,
|
||||||
@@ -44,7 +42,7 @@ function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, par
|
|||||||
}
|
}
|
||||||
var newData = [
|
var newData = [
|
||||||
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
|
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
|
||||||
newHoldersRight, newArgPos, ary, arity
|
newHoldersRight, argPos, ary, arity
|
||||||
];
|
];
|
||||||
|
|
||||||
var result = wrapFunc.apply(undefined, newData);
|
var result = wrapFunc.apply(undefined, newData);
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
|
|||||||
case regexpTag:
|
case regexpTag:
|
||||||
case stringTag:
|
case stringTag:
|
||||||
// Coerce regexes to strings and treat strings, primitives and objects,
|
// Coerce regexes to strings and treat strings, primitives and objects,
|
||||||
// as equal. See https://es5.github.io/#x15.10.6.4 for more details.
|
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring
|
||||||
|
// for more details.
|
||||||
return object == (other + '');
|
return object == (other + '');
|
||||||
|
|
||||||
case mapTag:
|
case mapTag:
|
||||||
|
|||||||
23
_getTag.js
23
_getTag.js
@@ -2,7 +2,8 @@ var DataView = require('./_DataView'),
|
|||||||
Map = require('./_Map'),
|
Map = require('./_Map'),
|
||||||
Promise = require('./_Promise'),
|
Promise = require('./_Promise'),
|
||||||
Set = require('./_Set'),
|
Set = require('./_Set'),
|
||||||
WeakMap = require('./_WeakMap');
|
WeakMap = require('./_WeakMap'),
|
||||||
|
toSource = require('./_toSource');
|
||||||
|
|
||||||
/** `Object#toString` result references. */
|
/** `Object#toString` result references. */
|
||||||
var mapTag = '[object Map]',
|
var mapTag = '[object Map]',
|
||||||
@@ -16,21 +17,19 @@ var dataViewTag = '[object DataView]';
|
|||||||
/** Used for built-in method references. */
|
/** Used for built-in method references. */
|
||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/** Used to resolve the decompiled source of functions. */
|
|
||||||
var funcToString = Function.prototype.toString;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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;
|
||||||
|
|
||||||
/** 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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the `toStringTag` of `value`.
|
* Gets the `toStringTag` of `value`.
|
||||||
@@ -52,8 +51,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) {
|
||||||
|
|||||||
36
_hasPath.js
36
_hasPath.js
@@ -1,4 +1,4 @@
|
|||||||
var baseCastPath = require('./_baseCastPath'),
|
var castPath = require('./_castPath'),
|
||||||
isArguments = require('./isArguments'),
|
isArguments = require('./isArguments'),
|
||||||
isArray = require('./isArray'),
|
isArray = require('./isArray'),
|
||||||
isIndex = require('./_isIndex'),
|
isIndex = require('./_isIndex'),
|
||||||
@@ -16,29 +16,25 @@ var baseCastPath = require('./_baseCastPath'),
|
|||||||
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
||||||
*/
|
*/
|
||||||
function hasPath(object, path, hasFunc) {
|
function hasPath(object, path, hasFunc) {
|
||||||
if (object == null) {
|
path = isKey(path, object) ? [path] : castPath(path);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
var result = hasFunc(object, path);
|
|
||||||
if (!result && !isKey(path)) {
|
|
||||||
path = baseCastPath(path);
|
|
||||||
|
|
||||||
var index = -1,
|
var result,
|
||||||
length = path.length;
|
index = -1,
|
||||||
|
length = path.length;
|
||||||
|
|
||||||
while (object != null && ++index < length) {
|
while (++index < length) {
|
||||||
var key = path[index];
|
var key = path[index];
|
||||||
if (!(result = hasFunc(object, key))) {
|
if (!(result = object != null && hasFunc(object, key))) {
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
object = object[key];
|
|
||||||
}
|
}
|
||||||
|
object = object[key];
|
||||||
}
|
}
|
||||||
var length = object ? object.length : undefined;
|
if (result) {
|
||||||
return result || (
|
return result;
|
||||||
!!length && isLength(length) && isIndex(path, length) &&
|
}
|
||||||
(isArray(object) || isString(object) || isArguments(object))
|
var length = object ? object.length : 0;
|
||||||
);
|
return !!length && isLength(length) && isIndex(key, length) &&
|
||||||
|
(isArray(object) || isString(object) || isArguments(object));
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = hasPath;
|
module.exports = hasPath;
|
||||||
|
|||||||
16
_isFlattenable.js
Normal file
16
_isFlattenable.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
var isArguments = require('./isArguments'),
|
||||||
|
isArray = require('./isArray'),
|
||||||
|
isArrayLikeObject = require('./isArrayLikeObject');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if `value` is a flattenable `arguments` object or array.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {*} value The value to check.
|
||||||
|
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
|
||||||
|
*/
|
||||||
|
function isFlattenable(value) {
|
||||||
|
return isArrayLikeObject(value) && (isArray(value) || isArguments(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = isFlattenable;
|
||||||
16
_isFlattenableIteratee.js
Normal file
16
_isFlattenableIteratee.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
var isArray = require('./isArray'),
|
||||||
|
isFunction = require('./isFunction');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if `value` is a flattenable array and not a `_.matchesProperty`
|
||||||
|
* iteratee shorthand.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {*} value The value to check.
|
||||||
|
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
|
||||||
|
*/
|
||||||
|
function isFlattenableIteratee(value) {
|
||||||
|
return isArray(value) && !(value.length == 2 && !isFunction(value[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = isFlattenableIteratee;
|
||||||
20
_matchesStrictComparable.js
Normal file
20
_matchesStrictComparable.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* A specialized version of `matchesProperty` for source values suitable
|
||||||
|
* for strict equality comparisons, i.e. `===`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} key The key of the property to get.
|
||||||
|
* @param {*} srcValue The value to match.
|
||||||
|
* @returns {Function} Returns the new function.
|
||||||
|
*/
|
||||||
|
function matchesStrictComparable(key, srcValue) {
|
||||||
|
return function(object) {
|
||||||
|
if (object == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return object[key] === srcValue &&
|
||||||
|
(srcValue !== undefined || (key in Object(object)));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = matchesStrictComparable;
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
var composeArgs = require('./_composeArgs'),
|
var composeArgs = require('./_composeArgs'),
|
||||||
composeArgsRight = require('./_composeArgsRight'),
|
composeArgsRight = require('./_composeArgsRight'),
|
||||||
copyArray = require('./_copyArray'),
|
|
||||||
replaceHolders = require('./_replaceHolders');
|
replaceHolders = require('./_replaceHolders');
|
||||||
|
|
||||||
/** Used as the internal argument placeholder. */
|
/** Used as the internal argument placeholder. */
|
||||||
@@ -58,20 +57,20 @@ function mergeData(data, source) {
|
|||||||
var value = source[3];
|
var value = source[3];
|
||||||
if (value) {
|
if (value) {
|
||||||
var partials = data[3];
|
var partials = data[3];
|
||||||
data[3] = partials ? composeArgs(partials, value, source[4]) : copyArray(value);
|
data[3] = partials ? composeArgs(partials, value, source[4]) : value;
|
||||||
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : copyArray(source[4]);
|
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
|
||||||
}
|
}
|
||||||
// Compose partial right arguments.
|
// Compose partial right arguments.
|
||||||
value = source[5];
|
value = source[5];
|
||||||
if (value) {
|
if (value) {
|
||||||
partials = data[5];
|
partials = data[5];
|
||||||
data[5] = partials ? composeArgsRight(partials, value, source[6]) : copyArray(value);
|
data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
|
||||||
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : copyArray(source[6]);
|
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
|
||||||
}
|
}
|
||||||
// Use source `argPos` if available.
|
// Use source `argPos` if available.
|
||||||
value = source[7];
|
value = source[7];
|
||||||
if (value) {
|
if (value) {
|
||||||
data[7] = copyArray(value);
|
data[7] = value;
|
||||||
}
|
}
|
||||||
// Use source `ary` if it's smaller.
|
// Use source `ary` if it's smaller.
|
||||||
if (srcBitmask & ARY_FLAG) {
|
if (srcBitmask & ARY_FLAG) {
|
||||||
|
|||||||
13
_reHasComplexSymbol.js
Normal file
13
_reHasComplexSymbol.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/** Used to compose unicode character classes. */
|
||||||
|
var rsAstralRange = '\\ud800-\\udfff',
|
||||||
|
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
||||||
|
rsComboSymbolsRange = '\\u20d0-\\u20f0',
|
||||||
|
rsVarRange = '\\ufe0e\\ufe0f';
|
||||||
|
|
||||||
|
/** Used to compose unicode capture groups. */
|
||||||
|
var rsZWJ = '\\u200d';
|
||||||
|
|
||||||
|
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
|
||||||
|
var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
|
||||||
|
|
||||||
|
module.exports = reHasComplexSymbol;
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
var reHasComplexSymbol = require('./_reHasComplexSymbol');
|
||||||
|
|
||||||
/** Used to compose unicode character classes. */
|
/** Used to compose unicode character classes. */
|
||||||
var rsAstralRange = '\\ud800-\\udfff',
|
var rsAstralRange = '\\ud800-\\udfff',
|
||||||
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
||||||
@@ -24,9 +26,6 @@ var reOptMod = rsModifier + '?',
|
|||||||
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
|
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
|
||||||
var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
|
var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
|
||||||
|
|
||||||
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
|
|
||||||
var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the number of symbols in `string`.
|
* Gets the number of symbols in `string`.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
var isSymbol = require('./isSymbol');
|
var isSymbol = require('./isSymbol');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Casts `value` to a string if it's not a string or symbol.
|
* Converts `value` to a string key if it's not a string or symbol.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {*} value The value to inspect.
|
* @param {*} value The value to inspect.
|
||||||
* @returns {string|symbol} Returns the cast key.
|
* @returns {string|symbol} Returns the key.
|
||||||
*/
|
*/
|
||||||
function baseCastKey(key) {
|
function toKey(key) {
|
||||||
return (typeof key == 'string' || isSymbol(key)) ? key : (key + '');
|
return (typeof key == 'string' || isSymbol(key)) ? key : (key + '');
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = baseCastKey;
|
module.exports = toKey;
|
||||||
23
_toSource.js
Normal file
23
_toSource.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/** Used to resolve the decompiled source of functions. */
|
||||||
|
var funcToString = Function.prototype.toString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 '';
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = toSource;
|
||||||
1
array.js
1
array.js
@@ -25,6 +25,7 @@ module.exports = {
|
|||||||
'join': require('./join'),
|
'join': require('./join'),
|
||||||
'last': require('./last'),
|
'last': require('./last'),
|
||||||
'lastIndexOf': require('./lastIndexOf'),
|
'lastIndexOf': require('./lastIndexOf'),
|
||||||
|
'nth': require('./nth'),
|
||||||
'pull': require('./pull'),
|
'pull': require('./pull'),
|
||||||
'pullAll': require('./pullAll'),
|
'pullAll': require('./pullAll'),
|
||||||
'pullAllBy': require('./pullAllBy'),
|
'pullAllBy': require('./pullAllBy'),
|
||||||
|
|||||||
4
ary.js
4
ary.js
@@ -4,8 +4,8 @@ var createWrapper = require('./_createWrapper');
|
|||||||
var ARY_FLAG = 128;
|
var ARY_FLAG = 128;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that accepts up to `n` arguments, ignoring any
|
* Creates a function that invokes `func`, with up to `n` arguments,
|
||||||
* additional arguments.
|
* ignoring any additional arguments.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
var copyObjectWith = require('./_copyObjectWith'),
|
var copyObject = require('./_copyObject'),
|
||||||
createAssigner = require('./_createAssigner'),
|
createAssigner = require('./_createAssigner'),
|
||||||
keysIn = require('./keysIn');
|
keysIn = require('./keysIn');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is like `_.assignIn` except that it accepts `customizer`
|
* This method is like `_.assignIn` except that it accepts `customizer`
|
||||||
* which is invoked to produce the assigned values. If `customizer` returns
|
* which is invoked to produce the assigned values. If `customizer` returns
|
||||||
* `undefined` assignment is handled by the method instead. The `customizer`
|
* `undefined`, assignment is handled by the method instead. The `customizer`
|
||||||
* is invoked with five arguments: (objValue, srcValue, key, object, source).
|
* is invoked with five arguments: (objValue, srcValue, key, object, source).
|
||||||
*
|
*
|
||||||
* **Note:** This method mutates `object`.
|
* **Note:** This method mutates `object`.
|
||||||
@@ -31,7 +31,7 @@ var copyObjectWith = require('./_copyObjectWith'),
|
|||||||
* // => { 'a': 1, 'b': 2 }
|
* // => { 'a': 1, 'b': 2 }
|
||||||
*/
|
*/
|
||||||
var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
|
var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
|
||||||
copyObjectWith(source, keysIn(source), object, customizer);
|
copyObject(source, keysIn(source), object, customizer);
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = assignInWith;
|
module.exports = assignInWith;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
var copyObjectWith = require('./_copyObjectWith'),
|
var copyObject = require('./_copyObject'),
|
||||||
createAssigner = require('./_createAssigner'),
|
createAssigner = require('./_createAssigner'),
|
||||||
keys = require('./keys');
|
keys = require('./keys');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is like `_.assign` except that it accepts `customizer`
|
* This method is like `_.assign` except that it accepts `customizer`
|
||||||
* which is invoked to produce the assigned values. If `customizer` returns
|
* which is invoked to produce the assigned values. If `customizer` returns
|
||||||
* `undefined` assignment is handled by the method instead. The `customizer`
|
* `undefined`, assignment is handled by the method instead. The `customizer`
|
||||||
* is invoked with five arguments: (objValue, srcValue, key, object, source).
|
* is invoked with five arguments: (objValue, srcValue, key, object, source).
|
||||||
*
|
*
|
||||||
* **Note:** This method mutates `object`.
|
* **Note:** This method mutates `object`.
|
||||||
@@ -30,7 +30,7 @@ var copyObjectWith = require('./_copyObjectWith'),
|
|||||||
* // => { 'a': 1, 'b': 2 }
|
* // => { 'a': 1, 'b': 2 }
|
||||||
*/
|
*/
|
||||||
var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
|
var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
|
||||||
copyObjectWith(source, keys(source), object, customizer);
|
copyObject(source, keys(source), object, customizer);
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = assignWith;
|
module.exports = assignWith;
|
||||||
|
|||||||
3
at.js
3
at.js
@@ -10,8 +10,7 @@ var baseAt = require('./_baseAt'),
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @category Object
|
* @category Object
|
||||||
* @param {Object} object The object to iterate over.
|
* @param {Object} object The object to iterate over.
|
||||||
* @param {...(string|string[])} [paths] The property paths of elements to pick,
|
* @param {...(string|string[])} [paths] The property paths of elements to pick.
|
||||||
* specified individually or in arrays.
|
|
||||||
* @returns {Array} Returns the new array of picked elements.
|
* @returns {Array} Returns the new array of picked elements.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
|
|||||||
3
bind.js
3
bind.js
@@ -9,8 +9,7 @@ var BIND_FLAG = 1,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that invokes `func` with the `this` binding of `thisArg`
|
* Creates a function that invokes `func` with the `this` binding of `thisArg`
|
||||||
* and prepends any additional `_.bind` arguments to those provided to the
|
* and `partials` prepended to the arguments it receives.
|
||||||
* bound function.
|
|
||||||
*
|
*
|
||||||
* The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
|
* The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
|
||||||
* may be used as a placeholder for partially applied arguments.
|
* may be used as a placeholder for partially applied arguments.
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ var arrayEach = require('./_arrayEach'),
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @category Util
|
* @category Util
|
||||||
* @param {Object} object The object to bind and assign the bound methods to.
|
* @param {Object} object The object to bind and assign the bound methods to.
|
||||||
* @param {...(string|string[])} methodNames The object method names to bind,
|
* @param {...(string|string[])} methodNames The object method names to bind.
|
||||||
* specified individually or in arrays.
|
|
||||||
* @returns {Object} Returns `object`.
|
* @returns {Object} Returns `object`.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ var BIND_FLAG = 1,
|
|||||||
PARTIAL_FLAG = 32;
|
PARTIAL_FLAG = 32;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that invokes the method at `object[key]` and prepends
|
* Creates a function that invokes the method at `object[key]` with `partials`
|
||||||
* any additional `_.bindKey` arguments to those provided to the bound function.
|
* prepended to the arguments it receives.
|
||||||
*
|
*
|
||||||
* This method differs from `_.bind` by allowing bound functions to reference
|
* This method differs from `_.bind` by allowing bound functions to reference
|
||||||
* methods that may be redefined or don't yet exist. See
|
* methods that may be redefined or don't yet exist. See
|
||||||
|
|||||||
13
chunk.js
13
chunk.js
@@ -1,4 +1,5 @@
|
|||||||
var baseSlice = require('./_baseSlice'),
|
var baseSlice = require('./_baseSlice'),
|
||||||
|
isIterateeCall = require('./_isIterateeCall'),
|
||||||
toInteger = require('./toInteger');
|
toInteger = require('./toInteger');
|
||||||
|
|
||||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||||
@@ -15,7 +16,8 @@ var nativeCeil = Math.ceil,
|
|||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
* @category Array
|
* @category Array
|
||||||
* @param {Array} array The array to process.
|
* @param {Array} array The array to process.
|
||||||
* @param {number} [size=0] The length of each chunk.
|
* @param {number} [size=1] The length of each chunk
|
||||||
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
||||||
* @returns {Array} Returns the new array containing chunks.
|
* @returns {Array} Returns the new array containing chunks.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
@@ -25,9 +27,12 @@ var nativeCeil = Math.ceil,
|
|||||||
* _.chunk(['a', 'b', 'c', 'd'], 3);
|
* _.chunk(['a', 'b', 'c', 'd'], 3);
|
||||||
* // => [['a', 'b', 'c'], ['d']]
|
* // => [['a', 'b', 'c'], ['d']]
|
||||||
*/
|
*/
|
||||||
function chunk(array, size) {
|
function chunk(array, size, guard) {
|
||||||
size = nativeMax(toInteger(size), 0);
|
if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
|
||||||
|
size = 1;
|
||||||
|
} else {
|
||||||
|
size = nativeMax(toInteger(size), 0);
|
||||||
|
}
|
||||||
var length = array ? array.length : 0;
|
var length = array ? array.length : 0;
|
||||||
if (!length || size < 1) {
|
if (!length || size < 1) {
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ var baseClone = require('./_baseClone');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is like `_.clone` except that it accepts `customizer` which
|
* This method is like `_.clone` except that it accepts `customizer` which
|
||||||
* is invoked to produce the cloned value. If `customizer` returns `undefined`
|
* is invoked to produce the cloned value. If `customizer` returns `undefined`,
|
||||||
* cloning is handled by the method instead. The `customizer` is invoked with
|
* cloning is handled by the method instead. The `customizer` is invoked with
|
||||||
* up to four arguments; (value [, index|key, object, stack]).
|
* up to four arguments; (value [, index|key, object, stack]).
|
||||||
*
|
*
|
||||||
|
|||||||
2
cond.js
2
cond.js
@@ -7,7 +7,7 @@ var apply = require('./_apply'),
|
|||||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that iterates over `pairs` invoking the corresponding
|
* Creates a function that iterates over `pairs` and invokes the corresponding
|
||||||
* function of the first predicate to return truthy. The predicate-function
|
* function of the first predicate to return truthy. The predicate-function
|
||||||
* pairs are invoked with the `this` binding and arguments of the created
|
* pairs are invoked with the `this` binding and arguments of the created
|
||||||
* function.
|
* function.
|
||||||
|
|||||||
144
core.js
144
core.js
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @license
|
* @license
|
||||||
* lodash 4.7.0 (Custom Build) <https://lodash.com/>
|
* lodash 4.11.0 (Custom Build) <https://lodash.com/>
|
||||||
* Build: `lodash core -o ./dist/lodash.core.js`
|
* Build: `lodash core -o ./dist/lodash.core.js`
|
||||||
* 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>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
var undefined;
|
var undefined;
|
||||||
|
|
||||||
/** Used as the semantic version number. */
|
/** Used as the semantic version number. */
|
||||||
var VERSION = '4.7.0';
|
var VERSION = '4.11.0';
|
||||||
|
|
||||||
/** Used as the `TypeError` message for "Functions" methods. */
|
/** Used as the `TypeError` message for "Functions" methods. */
|
||||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||||
@@ -357,7 +357,8 @@
|
|||||||
var idCounter = 0;
|
var idCounter = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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;
|
||||||
@@ -401,9 +402,9 @@
|
|||||||
* Shortcut fusion is an optimization to merge iteratee calls; this avoids
|
* Shortcut fusion is an optimization to merge iteratee calls; this avoids
|
||||||
* the creation of intermediate arrays and can greatly reduce the number of
|
* the creation of intermediate arrays and can greatly reduce the number of
|
||||||
* iteratee executions. Sections of a chain sequence qualify for shortcut
|
* iteratee executions. Sections of a chain sequence qualify for shortcut
|
||||||
* fusion if the section is applied to an array of at least two hundred
|
* fusion if the section is applied to an array of at least `200` elements
|
||||||
* elements and any iteratees accept only one argument. The heuristic for
|
* and any iteratees accept only one argument. The heuristic for whether a
|
||||||
* whether a section qualifies for shortcut fusion is subject to change.
|
* section qualifies for shortcut fusion is subject to change.
|
||||||
*
|
*
|
||||||
* Chaining is supported in custom builds as long as the `_#value` method is
|
* Chaining is supported in custom builds as long as the `_#value` method is
|
||||||
* directly or indirectly included in the build.
|
* directly or indirectly included in the build.
|
||||||
@@ -463,7 +464,7 @@
|
|||||||
* `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`,
|
* `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`,
|
||||||
* `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`,
|
* `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`,
|
||||||
* `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`,
|
* `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`,
|
||||||
* `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`,
|
* `noConflict`, `noop`, `now`, `nth`, `pad`, `padEnd`, `padStart`, `parseInt`,
|
||||||
* `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`,
|
* `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`,
|
||||||
* `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
|
* `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
|
||||||
* `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`,
|
* `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`,
|
||||||
@@ -639,23 +640,24 @@
|
|||||||
* @private
|
* @private
|
||||||
* @param {Array} array The array to flatten.
|
* @param {Array} array The array to flatten.
|
||||||
* @param {number} depth The maximum recursion depth.
|
* @param {number} depth The maximum recursion depth.
|
||||||
* @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
|
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
|
||||||
|
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
|
||||||
* @param {Array} [result=[]] The initial result value.
|
* @param {Array} [result=[]] The initial result value.
|
||||||
* @returns {Array} Returns the new flattened array.
|
* @returns {Array} Returns the new flattened array.
|
||||||
*/
|
*/
|
||||||
function baseFlatten(array, depth, isStrict, result) {
|
function baseFlatten(array, depth, predicate, isStrict, result) {
|
||||||
result || (result = []);
|
|
||||||
|
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = array.length;
|
length = array.length;
|
||||||
|
|
||||||
|
predicate || (predicate = isFlattenable);
|
||||||
|
result || (result = []);
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
var value = array[index];
|
var value = array[index];
|
||||||
if (depth > 0 && isArrayLikeObject(value) &&
|
if (depth > 0 && predicate(value)) {
|
||||||
(isStrict || isArray(value) || isArguments(value))) {
|
|
||||||
if (depth > 1) {
|
if (depth > 1) {
|
||||||
// Recursively flatten arrays (susceptible to call stack limits).
|
// Recursively flatten arrays (susceptible to call stack limits).
|
||||||
baseFlatten(value, depth - 1, isStrict, result);
|
baseFlatten(value, depth - 1, predicate, isStrict, result);
|
||||||
} else {
|
} else {
|
||||||
arrayPush(result, value);
|
arrayPush(result, value);
|
||||||
}
|
}
|
||||||
@@ -668,7 +670,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `baseForOwn` which iterates over `object`
|
* The base implementation of `baseForOwn` which iterates over `object`
|
||||||
* properties returned by `keysFunc` invoking `iteratee` for each property.
|
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
||||||
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
@@ -1016,22 +1018,10 @@
|
|||||||
* @param {Object} source The object to copy properties from.
|
* @param {Object} source The object to copy properties from.
|
||||||
* @param {Array} props The property identifiers to copy.
|
* @param {Array} props The property identifiers to copy.
|
||||||
* @param {Object} [object={}] The object to copy properties to.
|
* @param {Object} [object={}] The object to copy properties to.
|
||||||
* @returns {Object} Returns `object`.
|
|
||||||
*/
|
|
||||||
var copyObject = copyObjectWith;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function is like `copyObject` except that it accepts a function to
|
|
||||||
* customize copied values.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {Object} source The object to copy properties from.
|
|
||||||
* @param {Array} props The property identifiers to copy.
|
|
||||||
* @param {Object} [object={}] The object to copy properties to.
|
|
||||||
* @param {Function} [customizer] The function to customize copied values.
|
* @param {Function} [customizer] The function to customize copied values.
|
||||||
* @returns {Object} Returns `object`.
|
* @returns {Object} Returns `object`.
|
||||||
*/
|
*/
|
||||||
function copyObjectWith(source, props, object, customizer) {
|
function copyObject(source, props, object, customizer) {
|
||||||
object || (object = {});
|
object || (object = {});
|
||||||
|
|
||||||
var index = -1,
|
var index = -1,
|
||||||
@@ -1140,8 +1130,8 @@
|
|||||||
*/
|
*/
|
||||||
function createCtorWrapper(Ctor) {
|
function createCtorWrapper(Ctor) {
|
||||||
return function() {
|
return function() {
|
||||||
// Use a `switch` statement to work with class constructors.
|
// Use a `switch` statement to work with class constructors. See
|
||||||
// See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
|
// http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
|
||||||
// for more details.
|
// for more details.
|
||||||
var args = arguments;
|
var args = arguments;
|
||||||
var thisBinding = baseCreate(Ctor.prototype),
|
var thisBinding = baseCreate(Ctor.prototype),
|
||||||
@@ -1154,9 +1144,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that wraps `func` to invoke it with the optional `this`
|
* Creates a function that wraps `func` to invoke it with the `this` binding
|
||||||
* binding of `thisArg` and the `partials` prepended to those provided to
|
* of `thisArg` and `partials` prepended to the arguments it receives.
|
||||||
* the wrapper.
|
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Function} func The function to wrap.
|
* @param {Function} func The function to wrap.
|
||||||
@@ -1290,7 +1279,8 @@
|
|||||||
case regexpTag:
|
case regexpTag:
|
||||||
case stringTag:
|
case stringTag:
|
||||||
// Coerce regexes to strings and treat strings, primitives and objects,
|
// Coerce regexes to strings and treat strings, primitives and objects,
|
||||||
// as equal. See https://es5.github.io/#x15.10.6.4 for more details.
|
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring
|
||||||
|
// for more details.
|
||||||
return object == (other + '');
|
return object == (other + '');
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1392,6 +1382,17 @@
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if `value` is a flattenable `arguments` object or array.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {*} value The value to check.
|
||||||
|
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
|
||||||
|
*/
|
||||||
|
function isFlattenable(value) {
|
||||||
|
return isArrayLikeObject(value) && (isArray(value) || isArguments(value));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `value` is likely a prototype object.
|
* Checks if `value` is likely a prototype object.
|
||||||
*
|
*
|
||||||
@@ -1520,14 +1521,14 @@
|
|||||||
* // => undefined
|
* // => undefined
|
||||||
*/
|
*/
|
||||||
function head(array) {
|
function head(array) {
|
||||||
return array ? array[0] : undefined;
|
return (array && array.length) ? array[0] : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the index at which the first occurrence of `value` is found in `array`
|
* Gets the index at which the first occurrence of `value` is found in `array`
|
||||||
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||||
* for equality comparisons. If `fromIndex` is negative, it's used as the offset
|
* for equality comparisons. If `fromIndex` is negative, it's used as the
|
||||||
* from the end of `array`.
|
* offset from the end of `array`.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
@@ -1872,7 +1873,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterates over elements of `collection` invoking `iteratee` for each element.
|
* Iterates over elements of `collection` and invokes `iteratee` for each element.
|
||||||
* The iteratee is invoked with three arguments: (value, index|key, collection).
|
* The iteratee is invoked with three arguments: (value, index|key, collection).
|
||||||
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
||||||
*
|
*
|
||||||
@@ -1905,7 +1906,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array of values by running each element in `collection` through
|
* Creates an array of values by running each element in `collection` thru
|
||||||
* `iteratee`. The iteratee is invoked with three arguments:
|
* `iteratee`. The iteratee is invoked with three arguments:
|
||||||
* (value, index|key, collection).
|
* (value, index|key, collection).
|
||||||
*
|
*
|
||||||
@@ -1913,10 +1914,10 @@
|
|||||||
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
|
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
|
||||||
*
|
*
|
||||||
* The guarded methods are:
|
* The guarded methods are:
|
||||||
* `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`,
|
* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
|
||||||
* `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`,
|
* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
|
||||||
* `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`,
|
* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
|
||||||
* and `words`
|
* `template`, `trim`, `trimEnd`, `trimStart`, and `words`
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
@@ -1953,9 +1954,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Reduces `collection` to a value which is the accumulated result of running
|
* Reduces `collection` to a value which is the accumulated result of running
|
||||||
* each element in `collection` through `iteratee`, where each successive
|
* each element in `collection` thru `iteratee`, where each successive
|
||||||
* invocation is supplied the return value of the previous. If `accumulator`
|
* invocation is supplied the return value of the previous. If `accumulator`
|
||||||
* is not given the first element of `collection` is used as the initial
|
* is not given, the first element of `collection` is used as the initial
|
||||||
* value. The iteratee is invoked with four arguments:
|
* value. The iteratee is invoked with four arguments:
|
||||||
* (accumulator, value, index|key, collection).
|
* (accumulator, value, index|key, collection).
|
||||||
*
|
*
|
||||||
@@ -2064,7 +2065,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array of elements, sorted in ascending order by the results of
|
* Creates an array of elements, sorted in ascending order by the results of
|
||||||
* running each element in a collection through each iteratee. This method
|
* running each element in a collection thru each iteratee. This method
|
||||||
* performs a stable sort, that is, it preserves the original sort order of
|
* performs a stable sort, that is, it preserves the original sort order of
|
||||||
* equal elements. The iteratees are invoked with one argument: (value).
|
* equal elements. The iteratees are invoked with one argument: (value).
|
||||||
*
|
*
|
||||||
@@ -2074,8 +2075,7 @@
|
|||||||
* @category Collection
|
* @category Collection
|
||||||
* @param {Array|Object} collection The collection to iterate over.
|
* @param {Array|Object} collection The collection to iterate over.
|
||||||
* @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
|
* @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
|
||||||
* [iteratees=[_.identity]] The iteratees to sort by, specified individually
|
* [iteratees=[_.identity]] The iteratees to sort by.
|
||||||
* or in arrays.
|
|
||||||
* @returns {Array} Returns the new sorted array.
|
* @returns {Array} Returns the new sorted array.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
@@ -2146,8 +2146,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that invokes `func` with the `this` binding of `thisArg`
|
* Creates a function that invokes `func` with the `this` binding of `thisArg`
|
||||||
* and prepends any additional `_.bind` arguments to those provided to the
|
* and `partials` prepended to the arguments it receives.
|
||||||
* bound function.
|
|
||||||
*
|
*
|
||||||
* The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
|
* The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
|
||||||
* may be used as a placeholder for partially applied arguments.
|
* may be used as a placeholder for partially applied arguments.
|
||||||
@@ -2790,8 +2789,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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 _
|
||||||
@@ -2849,9 +2849,10 @@
|
|||||||
/**
|
/**
|
||||||
* Checks if `value` is `NaN`.
|
* Checks if `value` is `NaN`.
|
||||||
*
|
*
|
||||||
* **Note:** This method is not the same as
|
* **Note:** This method is based on
|
||||||
* [`isNaN`](https://es5.github.io/#x15.1.2.4) which returns `true` for
|
* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
|
||||||
* `undefined` and other non-numeric values.
|
* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
|
||||||
|
* `undefined` and other non-number values.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
@@ -3109,8 +3110,8 @@
|
|||||||
var toNumber = Number;
|
var toNumber = Number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts `value` to a string if it's not one. An empty string is returned
|
* Converts `value` to a string. An empty string is returned for `null`
|
||||||
* for `null` and `undefined` values. The sign of `-0` is preserved.
|
* and `undefined` values. The sign of `-0` is preserved.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
@@ -3210,7 +3211,7 @@
|
|||||||
/**
|
/**
|
||||||
* This method is like `_.assignIn` except that it accepts `customizer`
|
* This method is like `_.assignIn` except that it accepts `customizer`
|
||||||
* which is invoked to produce the assigned values. If `customizer` returns
|
* which is invoked to produce the assigned values. If `customizer` returns
|
||||||
* `undefined` assignment is handled by the method instead. The `customizer`
|
* `undefined`, assignment is handled by the method instead. The `customizer`
|
||||||
* is invoked with five arguments: (objValue, srcValue, key, object, source).
|
* is invoked with five arguments: (objValue, srcValue, key, object, source).
|
||||||
*
|
*
|
||||||
* **Note:** This method mutates `object`.
|
* **Note:** This method mutates `object`.
|
||||||
@@ -3236,12 +3237,12 @@
|
|||||||
* // => { 'a': 1, 'b': 2 }
|
* // => { 'a': 1, 'b': 2 }
|
||||||
*/
|
*/
|
||||||
var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
|
var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
|
||||||
copyObjectWith(source, keysIn(source), object, customizer);
|
copyObject(source, keysIn(source), object, customizer);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an object that inherits from the `prototype` object. If a
|
* Creates an object that inherits from the `prototype` object. If a
|
||||||
* `properties` object is given its own enumerable string keyed properties
|
* `properties` object is given, its own enumerable string keyed properties
|
||||||
* are assigned to the created object.
|
* are assigned to the created object.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
@@ -3315,16 +3316,16 @@
|
|||||||
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* var object = { 'a': { 'b': { 'c': 3 } } };
|
* var object = { 'a': { 'b': 2 } };
|
||||||
* var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
|
* var other = _.create({ 'a': _.create({ 'b': 2 }) });
|
||||||
*
|
*
|
||||||
* _.has(object, 'a');
|
* _.has(object, 'a');
|
||||||
* // => true
|
* // => true
|
||||||
*
|
*
|
||||||
* _.has(object, 'a.b.c');
|
* _.has(object, 'a.b');
|
||||||
* // => true
|
* // => true
|
||||||
*
|
*
|
||||||
* _.has(object, ['a', 'b', 'c']);
|
* _.has(object, ['a', 'b']);
|
||||||
* // => true
|
* // => true
|
||||||
*
|
*
|
||||||
* _.has(other, 'a');
|
* _.has(other, 'a');
|
||||||
@@ -3433,8 +3434,7 @@
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @category Object
|
* @category Object
|
||||||
* @param {Object} object The source object.
|
* @param {Object} object The source object.
|
||||||
* @param {...(string|string[])} [props] The property identifiers to pick,
|
* @param {...(string|string[])} [props] The property identifiers to pick.
|
||||||
* specified individually or in arrays.
|
|
||||||
* @returns {Object} Returns the new object.
|
* @returns {Object} Returns the new object.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
@@ -3581,8 +3581,8 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that invokes `func` with the arguments of the created
|
* Creates a function that invokes `func` with the arguments of the created
|
||||||
* function. If `func` is a property name the created function returns the
|
* function. If `func` is a property name, the created function returns the
|
||||||
* property value for a given element. If `func` is an array or object the
|
* property value for a given element. If `func` is an array or object, the
|
||||||
* created function returns `true` for elements that contain the equivalent
|
* created function returns `true` for elements that contain the equivalent
|
||||||
* source properties, otherwise it returns `false`.
|
* source properties, otherwise it returns `false`.
|
||||||
*
|
*
|
||||||
@@ -3653,7 +3653,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds all own enumerable string keyed function properties of a source
|
* Adds all own enumerable string keyed function properties of a source
|
||||||
* object to the destination object. If `object` is a function then methods
|
* object to the destination object. If `object` is a function, then methods
|
||||||
* are added to its prototype as well.
|
* are added to its prototype as well.
|
||||||
*
|
*
|
||||||
* **Note:** Use `_.runInContext` to create a pristine `lodash` function to
|
* **Note:** Use `_.runInContext` to create a pristine `lodash` function to
|
||||||
@@ -3763,7 +3763,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a unique ID. If `prefix` is given the ID is appended to it.
|
* Generates a unique ID. If `prefix` is given, the ID is appended to it.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
@@ -3787,7 +3787,7 @@
|
|||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Computes the maximum value of `array`. If `array` is empty or falsey
|
* Computes the maximum value of `array`. If `array` is empty or falsey,
|
||||||
* `undefined` is returned.
|
* `undefined` is returned.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
@@ -3811,7 +3811,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Computes the minimum value of `array`. If `array` is empty or falsey
|
* Computes the minimum value of `array`. If `array` is empty or falsey,
|
||||||
* `undefined` is returned.
|
* `undefined` is returned.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
52
core.min.js
vendored
52
core.min.js
vendored
@@ -1,30 +1,30 @@
|
|||||||
/**
|
/**
|
||||||
* @license
|
* @license
|
||||||
* lodash 4.7.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
* lodash 4.11.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
||||||
* Build: `lodash core -o ./dist/lodash.core.js`
|
* Build: `lodash core -o ./dist/lodash.core.js`
|
||||||
*/
|
*/
|
||||||
;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===ln?i===i:r(i,c)))var c=i,f=o}return f}function r(n,t,r){var e;return r(n,function(n,r,u){return t(n,r,u)?(e=n,false):void 0}),e}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return w(t,function(t){return n[t]})}function o(n){return n&&n.Object===Object?n:null}function i(n){return yn[n]}function c(n){var t=false;if(null!=n&&typeof n.toString!="function")try{
|
;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===pn?i===i:r(i,c)))var c=i,f=o}return f}function r(n,t,r){var e;return r(n,function(n,r,u){return t(n,r,u)?(e=n,false):void 0}),e}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return w(t,function(t){return n[t]})}function o(n){return n&&n.Object===Object?n:null}function i(n){return gn[n]}function c(n){var t=false;if(null!=n&&typeof n.toString!="function")try{
|
||||||
t=!!(n+"")}catch(r){}return t}function f(n,t){return n=typeof n=="number"||vn.test(n)?+n:-1,n>-1&&0==n%1&&(null==t?9007199254740991:t)>n}function a(n){return n instanceof l?n:new l(n)}function l(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function p(n,t,r,e){var u;return(u=n===ln)||(u=An[r],u=(n===u||n!==n&&u!==u)&&!En.call(e,r)),u?t:n}function s(n){return Y(n)?Rn(n):{}}function h(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){
|
t=!!(n+"")}catch(r){}return t}function f(n,t){return n=typeof n=="number"||yn.test(n)?+n:-1,n>-1&&0==n%1&&(null==t?9007199254740991:t)>n}function a(n){return n instanceof l?n:new l(n)}function l(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function p(n,t,r,e){var u;return(u=n===pn)||(u=En[r],u=(n===u||n!==n&&u!==u)&&!kn.call(e,r)),u?t:n}function s(n){return Z(n)?Bn(n):{}}function h(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){
|
||||||
n.apply(ln,r)},t)}function v(n,t){var r=true;return zn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function y(n,t){var r=[];return zn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function g(t,r,e,u){u||(u=[]);for(var o=-1,i=t.length;++o<i;){var c=t[o];r>0&&Z(c)&&Q(c)&&(e||Un(c)||L(c))?r>1?g(c,r-1,e,u):n(u,c):e||(u[u.length]=c)}return u}function b(n,t){return n&&Cn(n,t,un)}function _(n,t){return y(t,function(t){return W(n[t])})}function j(n,t,r,e,u){return n===t?true:null==n||null==t||!Y(n)&&!Z(t)?n!==n&&t!==t:d(n,t,j,r,e,u);
|
n.apply(pn,r)},t)}function v(n,t){var r=true;return Cn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function y(n,t){var r=[];return Cn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function g(t,r,e,u,o){var i=-1,c=t.length;for(e||(e=C),o||(o=[]);++i<c;){var f=t[i];r>0&&e(f)?r>1?g(f,r-1,e,u,o):n(o,f):u||(o[o.length]=f)}return o}function b(n,t){return n&&Gn(n,t,on)}function _(n,t){return y(t,function(t){return X(n[t])})}function j(n,t,r,e,u){return n===t?true:null==n||null==t||!Z(n)&&!nn(t)?n!==n&&t!==t:d(n,t,j,r,e,u);
|
||||||
}function d(n,t,r,e,u,o){var i=Un(n),f=Un(t),a="[object Array]",l="[object Array]";i||(a=Nn.call(n),a="[object Arguments]"==a?"[object Object]":a),f||(l=Nn.call(t),l="[object Arguments]"==l?"[object Object]":l);var p="[object Object]"==a&&!c(n),f="[object Object]"==l&&!c(t),l=a==l;o||(o=[]);var s=J(o,function(t){return t[0]===n});return s&&s[1]?s[1]==t:(o.push([n,t]),l&&!p?(r=i||isTypedArray(n)?I(n,t,r,e,u,o):$(n,t,a),o.pop(),r):2&u||(i=p&&En.call(n,"__wrapped__"),a=f&&En.call(t,"__wrapped__"),!i&&!a)?l?(r=q(n,t,r,e,u,o),
|
}function d(n,t,r,e,u,o){var i=Vn(n),f=Vn(t),a="[object Array]",l="[object Array]";i||(a=Sn.call(n),a="[object Arguments]"==a?"[object Object]":a),f||(l=Sn.call(t),l="[object Arguments]"==l?"[object Object]":l);var p="[object Object]"==a&&!c(n),f="[object Object]"==l&&!c(t),l=a==l;o||(o=[]);var s=M(o,function(t){return t[0]===n});return s&&s[1]?s[1]==t:(o.push([n,t]),l&&!p?(r=i||isTypedArray(n)?I(n,t,r,e,u,o):$(n,t,a),o.pop(),r):2&u||(i=p&&kn.call(n,"__wrapped__"),a=f&&kn.call(t,"__wrapped__"),!i&&!a)?l?(r=q(n,t,r,e,u,o),
|
||||||
o.pop(),r):false:(i=i?n.value():n,t=a?t.value():t,r=r(i,t,e,u,o),o.pop(),r))}function m(n){return typeof n=="function"?n:null==n?fn:(typeof n=="object"?x:E)(n)}function O(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function w(n,t){var r=-1,e=Q(n)?Array(n.length):[];return zn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function x(n){var t=un(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&j(n[u],r[u],ln,3)))return false}return true}}function A(n,t){
|
o.pop(),r):false:(i=i?n.value():n,t=a?t.value():t,r=r(i,t,e,u,o),o.pop(),r))}function m(n){return typeof n=="function"?n:null==n?an:(typeof n=="object"?x:E)(n)}function O(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function w(n,t){var r=-1,e=W(n)?Array(n.length):[];return Cn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function x(n){var t=on(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&j(n[u],r[u],pn,3)))return false}return true}}function A(n,t){
|
||||||
return n=Object(n),P(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function E(n){return function(t){return null==t?ln:t[n]}}function k(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e<u;)r[e]=n[e+t];return r}function N(n){return k(n,0,n.length)}function S(n,t){var r;return zn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function T(t,r){return P(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args))},t)}function F(n,t,r,e){r||(r={});
|
return n=Object(n),U(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function E(n){return function(t){return null==t?pn:t[n]}}function k(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e<u;)r[e]=n[e+t];return r}function N(n){return k(n,0,n.length)}function S(n,t){var r;return Cn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function T(t,r){return U(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args))},t)}function F(n,t,r,e){r||(r={});
|
||||||
for(var u=-1,o=t.length;++u<o;){var i=t[u],c=e?e(r[i],n[i],i,r,n):n[i],f=r,a=f[i];En.call(f,i)&&(a===c||a!==a&&c!==c)&&(c!==ln||i in f)||(f[i]=c)}return r}function R(n){return V(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:ln,o=typeof o=="function"?(u--,o):ln;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function B(n){return function(){var t=arguments,r=s(n.prototype),t=n.apply(r,t);return Y(t)?t:r}}function D(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==wn&&this instanceof e?u:n;++c<f;)a[c]=r[c];
|
for(var u=-1,o=t.length;++u<o;){var i=t[u],c=e?e(r[i],n[i],i,r,n):n[i],f=r,a=f[i];kn.call(f,i)&&(a===c||a!==a&&c!==c)&&(c!==pn||i in f)||(f[i]=c)}return r}function R(n){return H(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:pn,o=typeof o=="function"?(u--,o):pn;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function B(n){return function(){var t=arguments,r=s(n.prototype),t=n.apply(r,t);return Z(t)?t:r}}function D(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==xn&&this instanceof e?u:n;++c<f;)a[c]=r[c];
|
||||||
for(;i--;)a[c++]=arguments[++o];return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");var u=B(n);return e}function I(n,t,r,e,u,o){var i=-1,c=1&u,f=n.length,a=t.length;if(f!=a&&!(2&u&&a>f))return false;for(a=true;++i<f;){var l=n[i],p=t[i];if(void 0!==ln){a=false;break}if(c){if(!S(t,function(n){return l===n||r(l,n,e,u,o)})){a=false;break}}else if(l!==p&&!r(l,p,e,u,o)){a=false;break}}return a}function $(n,t,r){switch(r){case"[object Boolean]":case"[object Date]":return+n==+t;case"[object Error]":
|
for(;i--;)a[c++]=arguments[++o];return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");var u=B(n);return e}function I(n,t,r,e,u,o){var i=-1,c=1&u,f=n.length,a=t.length;if(f!=a&&!(2&u&&a>f))return false;for(a=true;++i<f;){var l=n[i],p=t[i];if(void 0!==pn){a=false;break}if(c){if(!S(t,function(n){return l===n||r(l,n,e,u,o)})){a=false;break}}else if(l!==p&&!r(l,p,e,u,o)){a=false;break}}return a}function $(n,t,r){switch(r){case"[object Boolean]":case"[object Date]":return+n==+t;case"[object Error]":
|
||||||
return n.name==t.name&&n.message==t.message;case"[object Number]":return n!=+n?t!=+t:n==+t;case"[object RegExp]":case"[object String]":return n==t+""}return false}function q(n,t,r,e,u,o){var i=2&u,c=un(n),f=c.length,a=un(t).length;if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:En.call(t,p)))return false}for(a=true;++l<f;){var p=c[l],s=n[p],h=t[p];if(void 0!==ln||s!==h&&!r(s,h,e,u,o)){a=false;break}i||(i="constructor"==p)}return a&&!i&&(r=n.constructor,e=t.constructor,r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(a=false)),
|
return n.name==t.name&&n.message==t.message;case"[object Number]":return n!=+n?t!=+t:n==+t;case"[object RegExp]":case"[object String]":return n==t+""}return false}function q(n,t,r,e,u,o){var i=2&u,c=on(n),f=c.length,a=on(t).length;if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:kn.call(t,p)))return false}for(a=true;++l<f;){var p=c[l],s=n[p],h=t[p];if(void 0!==pn||s!==h&&!r(s,h,e,u,o)){a=false;break}i||(i="constructor"==p)}return a&&!i&&(r=n.constructor,e=t.constructor,r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(a=false)),
|
||||||
a}function z(n){var t=n?n.length:ln;if(X(t)&&(Un(n)||tn(n)||L(n))){n=String;for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);t=e}else t=null;return t}function C(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||An)}function G(n){return n?n[0]:ln}function J(n,t){return r(n,m(t),zn)}function M(n,t){return zn(n,m(t))}function P(n,t,r){return e(n,m(t),r,3>arguments.length,zn)}function U(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Vn(n),function(){
|
a}function z(n){var t=n?n.length:pn;if(Y(t)&&(Vn(n)||rn(n)||Q(n))){n=String;for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);t=e}else t=null;return t}function C(n){return nn(n)&&W(n)&&(Vn(n)||Q(n))}function G(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||En)}function J(n){return n&&n.length?n[0]:pn}function M(n,t){return r(n,m(t),Cn)}function P(n,t){return Cn(n,m(t))}function U(n,t,r){return e(n,m(t),r,3>arguments.length,Cn)}function V(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");
|
||||||
return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=ln),r}}function V(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=$n(t===ln?n.length-1:Vn(t),0),function(){for(var r=arguments,e=-1,u=$n(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];for(u=Array(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function H(){if(!arguments.length)return[];var n=arguments[0];return Un(n)?n:[n]}function K(n,t){return n>t}function L(n){return Z(n)&&Q(n)&&En.call(n,"callee")&&(!Bn.call(n,"callee")||"[object Arguments]"==Nn.call(n));
|
return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=pn),r}}function H(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=qn(t===pn?n.length-1:Hn(t),0),function(){for(var r=arguments,e=-1,u=qn(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];for(u=Array(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function K(){if(!arguments.length)return[];var n=arguments[0];return Vn(n)?n:[n]}function L(n,t){return n>t}function Q(n){return nn(n)&&W(n)&&kn.call(n,"callee")&&(!Dn.call(n,"callee")||"[object Arguments]"==Sn.call(n));
|
||||||
}function Q(n){return null!=n&&X(Gn(n))&&!W(n)}function W(n){return n=Y(n)?Nn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function X(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function Y(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function Z(n){return!!n&&typeof n=="object"}function nn(n){return typeof n=="number"||Z(n)&&"[object Number]"==Nn.call(n)}function tn(n){return typeof n=="string"||!Un(n)&&Z(n)&&"[object String]"==Nn.call(n)}function rn(n,t){
|
}function W(n){return null!=n&&Y(Jn(n))&&!X(n)}function X(n){return n=Z(n)?Sn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function Y(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function Z(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function nn(n){return!!n&&typeof n=="object"}function tn(n){return typeof n=="number"||nn(n)&&"[object Number]"==Sn.call(n)}function rn(n){return typeof n=="string"||!Vn(n)&&nn(n)&&"[object String]"==Sn.call(n)}function en(n,t){
|
||||||
return t>n}function en(n){return typeof n=="string"?n:null==n?"":n+""}function un(n){var t=C(n);if(!t&&!Q(n))return In(Object(n));var r,e=z(n),u=!!e,e=e||[],o=e.length;for(r in n)!En.call(n,r)||u&&("length"==r||f(r,o))||t&&"constructor"==r||e.push(r);return e}function on(n){for(var t=-1,r=C(n),e=O(n),u=e.length,o=z(n),i=!!o,o=o||[],c=o.length;++t<u;){var a=e[t];i&&("length"==a||f(a,c))||"constructor"==a&&(r||!En.call(n,a))||o.push(a)}return o}function cn(n){return n?u(n,un(n)):[]}function fn(n){return n;
|
return t>n}function un(n){return typeof n=="string"?n:null==n?"":n+""}function on(n){var t=G(n);if(!t&&!W(n))return $n(Object(n));var r,e=z(n),u=!!e,e=e||[],o=e.length;for(r in n)!kn.call(n,r)||u&&("length"==r||f(r,o))||t&&"constructor"==r||e.push(r);return e}function cn(n){for(var t=-1,r=G(n),e=O(n),u=e.length,o=z(n),i=!!o,o=o||[],c=o.length;++t<u;){var a=e[t];i&&("length"==a||f(a,c))||"constructor"==a&&(r||!kn.call(n,a))||o.push(a)}return o}function fn(n){return n?u(n,on(n)):[]}function an(n){return n;
|
||||||
}function an(t,r,e){var u=un(r),o=_(r,u);null!=e||Y(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=_(r,un(r)));var i=Y(e)&&"chain"in e?e.chain:true,c=W(t);return zn(o,function(e){var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=N(this.__actions__)).push({func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var ln,pn=1/0,sn=/[&<>"'`]/g,hn=RegExp(sn.source),vn=/^(?:0|[1-9]\d*)$/,yn={
|
}function ln(t,r,e){var u=on(r),o=_(r,u);null!=e||Z(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=_(r,on(r)));var i=Z(e)&&"chain"in e?e.chain:true,c=X(t);return Cn(o,function(e){var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=N(this.__actions__)).push({func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var pn,sn=1/0,hn=/[&<>"'`]/g,vn=RegExp(hn.source),yn=/^(?:0|[1-9]\d*)$/,gn={
|
||||||
"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},gn={"function":true,object:true},bn=gn[typeof exports]&&exports&&!exports.nodeType?exports:ln,_n=gn[typeof module]&&module&&!module.nodeType?module:ln,jn=_n&&_n.exports===bn?bn:ln,dn=o(gn[typeof self]&&self),mn=o(gn[typeof window]&&window),On=o(gn[typeof this]&&this),wn=o(bn&&_n&&typeof global=="object"&&global)||mn!==(On&&On.window)&&mn||dn||On||Function("return this")(),xn=Array.prototype,An=Object.prototype,En=An.hasOwnProperty,kn=0,Nn=An.toString,Sn=wn._,Tn=wn.Reflect,Fn=Tn?Tn.f:ln,Rn=Object.create,Bn=An.propertyIsEnumerable,Dn=wn.isFinite,In=Object.keys,$n=Math.max,qn=!Bn.call({
|
"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},bn={"function":true,object:true},_n=bn[typeof exports]&&exports&&!exports.nodeType?exports:pn,jn=bn[typeof module]&&module&&!module.nodeType?module:pn,dn=jn&&jn.exports===_n?_n:pn,mn=o(bn[typeof self]&&self),On=o(bn[typeof window]&&window),wn=o(bn[typeof this]&&this),xn=o(_n&&jn&&typeof global=="object"&&global)||On!==(wn&&wn.window)&&On||mn||wn||Function("return this")(),An=Array.prototype,En=Object.prototype,kn=En.hasOwnProperty,Nn=0,Sn=En.toString,Tn=xn._,Fn=xn.Reflect,Rn=Fn?Fn.f:pn,Bn=Object.create,Dn=En.propertyIsEnumerable,In=xn.isFinite,$n=Object.keys,qn=Math.max,zn=!Dn.call({
|
||||||
valueOf:1},"valueOf");l.prototype=s(a.prototype),l.prototype.constructor=l;var zn=function(n,t){return function(r,e){if(null==r)return r;if(!Q(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}(b),Cn=function(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}();Fn&&!Bn.call({valueOf:1},"valueOf")&&(O=function(n){n=Fn(n);for(var t,r=[];!(t=n.next()).done;)r.push(t.value);
|
valueOf:1},"valueOf");l.prototype=s(a.prototype),l.prototype.constructor=l;var Cn=function(n,t){return function(r,e){if(null==r)return r;if(!W(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}(b),Gn=function(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}();Rn&&!Dn.call({valueOf:1},"valueOf")&&(O=function(n){n=Rn(n);for(var t,r=[];!(t=n.next()).done;)r.push(t.value);
|
||||||
return r});var Gn=E("length"),Jn=V(function(n,t,r){return D(n,t,r)}),Mn=V(function(n,t){return h(n,1,t)}),Pn=V(function(n,t,r){return h(n,Hn(t)||0,r)}),Un=Array.isArray,Vn=Number,Hn=Number,Kn=R(function(n,t){F(t,un(t),n)}),Ln=R(function(n,t){F(t,on(t),n)}),Qn=R(function(n,t,r,e){F(t,on(t),n,e)}),Wn=V(function(n){return n.push(ln,p),Qn.apply(ln,n)}),Xn=V(function(n,t){return null==n?{}:A(n,g(t,1))}),Yn=m;a.assignIn=Ln,a.before=U,a.bind=Jn,a.chain=function(n){return n=a(n),n.__chain__=true,n},a.compact=function(n){
|
return r});var Jn=E("length"),Mn=H(function(n,t,r){return D(n,t,r)}),Pn=H(function(n,t){return h(n,1,t)}),Un=H(function(n,t,r){return h(n,Kn(t)||0,r)}),Vn=Array.isArray,Hn=Number,Kn=Number,Ln=R(function(n,t){F(t,on(t),n)}),Qn=R(function(n,t){F(t,cn(t),n)}),Wn=R(function(n,t,r,e){F(t,cn(t),n,e)}),Xn=H(function(n){return n.push(pn,p),Wn.apply(pn,n)}),Yn=H(function(n,t){return null==n?{}:A(n,g(t,1))}),Zn=m;a.assignIn=Qn,a.before=V,a.bind=Mn,a.chain=function(n){return n=a(n),n.__chain__=true,n},a.compact=function(n){
|
||||||
return y(n,Boolean)},a.concat=function(){var t=arguments.length,r=H(arguments[0]);if(2>t)return t?N(r):[];for(var e=Array(t-1);t--;)e[t-1]=arguments[t];return g(e,1),n(N(r),cn)},a.create=function(n,t){var r=s(n);return t?Kn(r,t):r},a.defaults=Wn,a.defer=Mn,a.delay=Pn,a.filter=function(n,t){return y(n,m(t))},a.flatten=function(n){return n&&n.length?g(n,1):[]},a.flattenDeep=function(n){return n&&n.length?g(n,pn):[]},a.iteratee=Yn,a.keys=un,a.map=function(n,t){return w(n,m(t))},a.matches=function(n){
|
return y(n,Boolean)},a.concat=function(){var t=arguments.length,r=K(arguments[0]);if(2>t)return t?N(r):[];for(var e=Array(t-1);t--;)e[t-1]=arguments[t];return g(e,1),n(N(r),fn)},a.create=function(n,t){var r=s(n);return t?Ln(r,t):r},a.defaults=Xn,a.defer=Pn,a.delay=Un,a.filter=function(n,t){return y(n,m(t))},a.flatten=function(n){return n&&n.length?g(n,1):[]},a.flattenDeep=function(n){return n&&n.length?g(n,sn):[]},a.iteratee=Zn,a.keys=on,a.map=function(n,t){return w(n,m(t))},a.matches=function(n){
|
||||||
return x(Kn({},n))},a.mixin=an,a.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},a.once=function(n){return U(2,n)},a.pick=Xn,a.slice=function(n,t,r){var e=n?n.length:0;return r=r===ln?e:+r,e?k(n,null==t?0:+t,r):[]},a.sortBy=function(n,t){var r=0;return t=m(t),w(w(n,function(n,e,u){return{c:n,b:r++,a:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.a;var e=t.a;if(r!==e){var u=null===r,o=r===ln,i=r===r,c=null===e,f=e===ln,a=e===e;
|
return x(Ln({},n))},a.mixin=ln,a.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},a.once=function(n){return V(2,n)},a.pick=Yn,a.slice=function(n,t,r){var e=n?n.length:0;return r=r===pn?e:+r,e?k(n,null==t?0:+t,r):[]},a.sortBy=function(n,t){var r=0;return t=m(t),w(w(n,function(n,e,u){return{c:n,b:r++,a:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.a;var e=t.a;if(r!==e){var u=null===r,o=r===pn,i=r===r,c=null===e,f=e===pn,a=e===e;
|
||||||
if(r>e&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return Q(n)?n.length?N(n):[]:cn(n)},a.values=cn,a.extend=Ln,an(a,a),a.clone=function(n){return Y(n)?Un(n)?N(n):F(n,un(n)):n},a.escape=function(n){return(n=en(n))&&hn.test(n)?n.replace(sn,i):n},a.every=function(n,t,r){return t=r?ln:t,v(n,m(t))},a.find=J,a.forEach=M,a.has=function(n,t){return null!=n&&En.call(n,t);
|
if(r>e&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return W(n)?n.length?N(n):[]:fn(n)},a.values=fn,a.extend=Qn,ln(a,a),a.clone=function(n){return Z(n)?Vn(n)?N(n):F(n,on(n)):n},a.escape=function(n){return(n=un(n))&&vn.test(n)?n.replace(hn,i):n},a.every=function(n,t,r){return t=r?pn:t,v(n,m(t))},a.find=M,a.forEach=P,a.has=function(n,t){return null!=n&&kn.call(n,t);
|
||||||
},a.head=G,a.identity=fn,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?$n(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1},a.isArguments=L,a.isArray=Un,a.isBoolean=function(n){return true===n||false===n||Z(n)&&"[object Boolean]"==Nn.call(n)},a.isDate=function(n){return Z(n)&&"[object Date]"==Nn.call(n)},a.isEmpty=function(n){if(Q(n)&&(Un(n)||tn(n)||W(n.splice)||L(n)))return!n.length;for(var t in n)if(En.call(n,t))return false;return!(qn&&un(n).length);
|
},a.head=J,a.identity=an,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?qn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1},a.isArguments=Q,a.isArray=Vn,a.isBoolean=function(n){return true===n||false===n||nn(n)&&"[object Boolean]"==Sn.call(n)},a.isDate=function(n){return nn(n)&&"[object Date]"==Sn.call(n)},a.isEmpty=function(n){if(W(n)&&(Vn(n)||rn(n)||X(n.splice)||Q(n)))return!n.length;for(var t in n)if(kn.call(n,t))return false;return!(zn&&on(n).length);
|
||||||
},a.isEqual=function(n,t){return j(n,t)},a.isFinite=function(n){return typeof n=="number"&&Dn(n)},a.isFunction=W,a.isNaN=function(n){return nn(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=nn,a.isObject=Y,a.isRegExp=function(n){return Y(n)&&"[object RegExp]"==Nn.call(n)},a.isString=tn,a.isUndefined=function(n){return n===ln},a.last=function(n){var t=n?n.length:0;return t?n[t-1]:ln},a.max=function(n){return n&&n.length?t(n,fn,K):ln},a.min=function(n){return n&&n.length?t(n,fn,rn):ln},
|
},a.isEqual=function(n,t){return j(n,t)},a.isFinite=function(n){return typeof n=="number"&&In(n)},a.isFunction=X,a.isNaN=function(n){return tn(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=tn,a.isObject=Z,a.isRegExp=function(n){return Z(n)&&"[object RegExp]"==Sn.call(n)},a.isString=rn,a.isUndefined=function(n){return n===pn},a.last=function(n){var t=n?n.length:0;return t?n[t-1]:pn},a.max=function(n){return n&&n.length?t(n,an,L):pn},a.min=function(n){return n&&n.length?t(n,an,en):pn},
|
||||||
a.noConflict=function(){return wn._===this&&(wn._=Sn),this},a.noop=function(){},a.reduce=P,a.result=function(n,t,r){return t=null==n?ln:n[t],t===ln&&(t=r),W(t)?t.call(n):t},a.size=function(n){return null==n?0:(n=Q(n)?n:un(n),n.length)},a.some=function(n,t,r){return t=r?ln:t,S(n,m(t))},a.uniqueId=function(n){var t=++kn;return en(n)+t},a.each=M,a.first=G,an(a,function(){var n={};return b(a,function(t,r){En.call(a.prototype,r)||(n[r]=t)}),n}(),{chain:false}),a.VERSION="4.7.0",zn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){
|
a.noConflict=function(){return xn._===this&&(xn._=Tn),this},a.noop=function(){},a.reduce=U,a.result=function(n,t,r){return t=null==n?pn:n[t],t===pn&&(t=r),X(t)?t.call(n):t},a.size=function(n){return null==n?0:(n=W(n)?n:on(n),n.length)},a.some=function(n,t,r){return t=r?pn:t,S(n,m(t))},a.uniqueId=function(n){var t=++Nn;return un(n)+t},a.each=P,a.first=J,ln(a,function(){var n={};return b(a,function(t,r){kn.call(a.prototype,r)||(n[r]=t)}),n}(),{chain:false}),a.VERSION="4.11.0",Cn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){
|
||||||
var t=(/^(?:replace|split)$/.test(n)?String.prototype:xn)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);a.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Un(u)?u:[],n)}return this[r](function(r){return t.apply(Un(r)?r:[],n)})}}),a.prototype.toJSON=a.prototype.valueOf=a.prototype.value=function(){return T(this.__wrapped__,this.__actions__)},(mn||dn||{})._=a,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){
|
var t=(/^(?:replace|split)$/.test(n)?String.prototype:An)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);a.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Vn(u)?u:[],n)}return this[r](function(r){return t.apply(Vn(r)?r:[],n)})}}),a.prototype.toJSON=a.prototype.valueOf=a.prototype.value=function(){return T(this.__wrapped__,this.__actions__)},(On||mn||{})._=a,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){
|
||||||
return a}):bn&&_n?(jn&&((_n.exports=a)._=a),bn._=a):wn._=a}).call(this);
|
return a}):_n&&jn?(dn&&((jn.exports=a)._=a),_n._=a):xn._=a}).call(this);
|
||||||
@@ -8,9 +8,9 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an object composed of keys generated from the results of running
|
* Creates an object composed of keys generated from the results of running
|
||||||
* each element of `collection` through `iteratee`. The corresponding value
|
* each element of `collection` thru `iteratee`. The corresponding value of
|
||||||
* of each key is the number of times the key was returned by `iteratee`.
|
* each key is the number of times the key was returned by `iteratee`. The
|
||||||
* The iteratee is invoked with one argument: (value).
|
* iteratee is invoked with one argument: (value).
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ var baseAssign = require('./_baseAssign'),
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an object that inherits from the `prototype` object. If a
|
* Creates an object that inherits from the `prototype` object. If a
|
||||||
* `properties` object is given its own enumerable string keyed properties
|
* `properties` object is given, its own enumerable string keyed properties
|
||||||
* are assigned to the created object.
|
* are assigned to the created object.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ var nativeMax = Math.max,
|
|||||||
* on the trailing edge of the timeout only if the debounced function is
|
* on the trailing edge of the timeout only if the debounced function is
|
||||||
* invoked more than once during the `wait` timeout.
|
* invoked more than once during the `wait` timeout.
|
||||||
*
|
*
|
||||||
* See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
|
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
||||||
* for details over the differences between `_.debounce` and `_.throttle`.
|
* for details over the differences between `_.debounce` and `_.throttle`.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
@@ -169,6 +169,9 @@ function debounce(func, wait, options) {
|
|||||||
timerId = setTimeout(timerExpired, wait);
|
timerId = setTimeout(timerExpired, wait);
|
||||||
return invokeFunc(lastCallTime);
|
return invokeFunc(lastCallTime);
|
||||||
}
|
}
|
||||||
|
if (timerId === undefined) {
|
||||||
|
timerId = setTimeout(timerExpired, wait);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
debounced.cancel = cancel;
|
debounced.cancel = cancel;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ var baseDifference = require('./_baseDifference'),
|
|||||||
*/
|
*/
|
||||||
var difference = rest(function(array, values) {
|
var difference = rest(function(array, values) {
|
||||||
return isArrayLikeObject(array)
|
return isArrayLikeObject(array)
|
||||||
? baseDifference(array, baseFlatten(values, 1, true))
|
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
|
||||||
: [];
|
: [];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ var differenceBy = rest(function(array, values) {
|
|||||||
iteratee = undefined;
|
iteratee = undefined;
|
||||||
}
|
}
|
||||||
return isArrayLikeObject(array)
|
return isArrayLikeObject(array)
|
||||||
? baseDifference(array, baseFlatten(values, 1, true), baseIteratee(iteratee))
|
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee))
|
||||||
: [];
|
: [];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ var differenceWith = rest(function(array, values) {
|
|||||||
comparator = undefined;
|
comparator = undefined;
|
||||||
}
|
}
|
||||||
return isArrayLikeObject(array)
|
return isArrayLikeObject(array)
|
||||||
? baseDifference(array, baseFlatten(values, 1, true), undefined, comparator)
|
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
|
||||||
: [];
|
: [];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
var toString = require('./toString');
|
var toString = require('./toString');
|
||||||
|
|
||||||
/** 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,
|
||||||
reHasRegExpChar = RegExp(reRegExpChar.source);
|
reHasRegExpChar = RegExp(reRegExpChar.source);
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ var baseFlatten = require('./_baseFlatten'),
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a flattened array of values by running each element in `collection`
|
* Creates a flattened array of values by running each element in `collection`
|
||||||
* through `iteratee` and flattening the mapped results. The iteratee is
|
* thru `iteratee` and flattening the mapped results. The iteratee is invoked
|
||||||
* invoked with three arguments: (value, index|key, collection).
|
* with three arguments: (value, index|key, collection).
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ var arrayEach = require('./_arrayEach'),
|
|||||||
isArray = require('./isArray');
|
isArray = require('./isArray');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterates over elements of `collection` invoking `iteratee` for each element.
|
* Iterates over elements of `collection` and invokes `iteratee` for each element.
|
||||||
* The iteratee is invoked with three arguments: (value, index|key, collection).
|
* The iteratee is invoked with three arguments: (value, index|key, collection).
|
||||||
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
||||||
*
|
*
|
||||||
|
|||||||
6
forIn.js
6
forIn.js
@@ -4,9 +4,9 @@ var baseFor = require('./_baseFor'),
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterates over own and inherited enumerable string keyed properties of an
|
* Iterates over own and inherited enumerable string keyed properties of an
|
||||||
* object invoking `iteratee` for each property. The iteratee is invoked with
|
* object and invokes `iteratee` for each property. The iteratee is invoked
|
||||||
* three arguments: (value, key, object). Iteratee functions may exit iteration
|
* with three arguments: (value, key, object). Iteratee functions may exit
|
||||||
* early by explicitly returning `false`.
|
* iteration early by explicitly returning `false`.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ var baseForOwn = require('./_baseForOwn'),
|
|||||||
baseIteratee = require('./_baseIteratee');
|
baseIteratee = require('./_baseIteratee');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterates over own enumerable string keyed properties of an object invoking
|
* Iterates over own enumerable string keyed properties of an object and
|
||||||
* `iteratee` for each property. The iteratee is invoked with three arguments:
|
* invokes `iteratee` for each property. The iteratee is invoked with three
|
||||||
* (value, key, object). Iteratee functions may exit iteration early by
|
* arguments: (value, key, object). Iteratee functions may exit iteration
|
||||||
* explicitly returning `false`.
|
* early by explicitly returning `false`.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -1,14 +1,99 @@
|
|||||||
var mapping = require('./_mapping'),
|
var mapping = require('./_mapping'),
|
||||||
mutateMap = mapping.mutate,
|
mutateMap = mapping.mutate,
|
||||||
fallbackHolder = {};
|
fallbackHolder = require('./placeholder');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a function, with an arity of `n`, that invokes `func` with the
|
||||||
|
* arguments it receives.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Function} func The function to wrap.
|
||||||
|
* @param {number} n The arity of the new function.
|
||||||
|
* @returns {Function} Returns the new function.
|
||||||
|
*/
|
||||||
|
function baseArity(func, n) {
|
||||||
|
return n == 2
|
||||||
|
? function(a, b) { return func.apply(undefined, arguments); }
|
||||||
|
: function(a) { return func.apply(undefined, arguments); };
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a function that invokes `func`, with up to `n` arguments, ignoring
|
||||||
|
* any additional arguments.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Function} func The function to cap arguments for.
|
||||||
|
* @param {number} n The arity cap.
|
||||||
|
* @returns {Function} Returns the new function.
|
||||||
|
*/
|
||||||
|
function baseAry(func, n) {
|
||||||
|
return n == 2
|
||||||
|
? function(a, b) { return func(a, b); }
|
||||||
|
: function(a) { return func(a); };
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a clone of `array`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Array} array The array to clone.
|
||||||
|
* @returns {Array} Returns the cloned array.
|
||||||
|
*/
|
||||||
|
function cloneArray(array) {
|
||||||
|
var length = array ? array.length : 0,
|
||||||
|
result = Array(length);
|
||||||
|
|
||||||
|
while (length--) {
|
||||||
|
result[length] = array[length];
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a function that clones a given object using the assignment `func`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Function} func The assignment function.
|
||||||
|
* @returns {Function} Returns the new cloner function.
|
||||||
|
*/
|
||||||
|
function createCloner(func) {
|
||||||
|
return function(object) {
|
||||||
|
return func({}, object);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a function that wraps `func` and uses `cloner` to clone the first
|
||||||
|
* argument it receives.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Function} func The function to wrap.
|
||||||
|
* @param {Function} cloner The function to clone arguments.
|
||||||
|
* @returns {Function} Returns the new immutable function.
|
||||||
|
*/
|
||||||
|
function immutWrap(func, cloner) {
|
||||||
|
return function() {
|
||||||
|
var length = arguments.length;
|
||||||
|
if (!length) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
var args = Array(length);
|
||||||
|
while (length--) {
|
||||||
|
args[length] = arguments[length];
|
||||||
|
}
|
||||||
|
var result = args[0] = cloner.apply(undefined, args);
|
||||||
|
func.apply(undefined, args);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `convert` which accepts a `util` object of methods
|
* The base implementation of `convert` which accepts a `util` object of methods
|
||||||
* required to perform conversions.
|
* required to perform conversions.
|
||||||
*
|
*
|
||||||
* @param {Object} util The util object.
|
* @param {Object} util The util object.
|
||||||
* @param {string} name The name of the function to wrap.
|
* @param {string} name The name of the function to convert.
|
||||||
* @param {Function} func The function to wrap.
|
* @param {Function} func The function to convert.
|
||||||
* @param {Object} [options] The options object.
|
* @param {Object} [options] The options object.
|
||||||
* @param {boolean} [options.cap=true] Specify capping iteratee arguments.
|
* @param {boolean} [options.cap=true] Specify capping iteratee arguments.
|
||||||
* @param {boolean} [options.curry=true] Specify currying.
|
* @param {boolean} [options.curry=true] Specify currying.
|
||||||
@@ -40,7 +125,9 @@ function baseConvert(util, name, func, options) {
|
|||||||
'rearg': 'rearg' in options ? options.rearg : true
|
'rearg': 'rearg' in options ? options.rearg : true
|
||||||
};
|
};
|
||||||
|
|
||||||
var forceRearg = ('rearg' in options) && options.rearg,
|
var forceCurry = ('curry' in options) && options.curry,
|
||||||
|
forceFixed = ('fixed' in options) && options.fixed,
|
||||||
|
forceRearg = ('rearg' in options) && options.rearg,
|
||||||
placeholder = isLib ? func : fallbackHolder,
|
placeholder = isLib ? func : fallbackHolder,
|
||||||
pristine = isLib ? func.runInContext() : undefined;
|
pristine = isLib ? func.runInContext() : undefined;
|
||||||
|
|
||||||
@@ -73,103 +160,6 @@ function baseConvert(util, name, func, options) {
|
|||||||
|
|
||||||
var aryMethodKeys = keys(mapping.aryMethod);
|
var aryMethodKeys = keys(mapping.aryMethod);
|
||||||
|
|
||||||
var baseArity = function(func, n) {
|
|
||||||
return n == 2
|
|
||||||
? function(a, b) { return func.apply(undefined, arguments); }
|
|
||||||
: function(a) { return func.apply(undefined, arguments); };
|
|
||||||
};
|
|
||||||
|
|
||||||
var baseAry = function(func, n) {
|
|
||||||
return n == 2
|
|
||||||
? function(a, b) { return func(a, b); }
|
|
||||||
: function(a) { return func(a); };
|
|
||||||
};
|
|
||||||
|
|
||||||
var cloneArray = function(array) {
|
|
||||||
var length = array ? array.length : 0,
|
|
||||||
result = Array(length);
|
|
||||||
|
|
||||||
while (length--) {
|
|
||||||
result[length] = array[length];
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
var cloneByPath = function(object, path) {
|
|
||||||
path = toPath(path);
|
|
||||||
|
|
||||||
var index = -1,
|
|
||||||
length = path.length,
|
|
||||||
result = clone(Object(object)),
|
|
||||||
nested = result;
|
|
||||||
|
|
||||||
while (nested != null && ++index < length) {
|
|
||||||
var key = path[index],
|
|
||||||
value = nested[key];
|
|
||||||
|
|
||||||
if (value != null) {
|
|
||||||
nested[key] = clone(Object(value));
|
|
||||||
}
|
|
||||||
nested = nested[key];
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
var convertLib = function(options) {
|
|
||||||
return _.runInContext.convert(options)();
|
|
||||||
};
|
|
||||||
|
|
||||||
var createCloner = function(func) {
|
|
||||||
return function(object) {
|
|
||||||
return func({}, object);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
var immutWrap = function(func, cloner) {
|
|
||||||
return function() {
|
|
||||||
var length = arguments.length;
|
|
||||||
if (!length) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
var args = Array(length);
|
|
||||||
while (length--) {
|
|
||||||
args[length] = arguments[length];
|
|
||||||
}
|
|
||||||
var result = args[0] = cloner.apply(undefined, args);
|
|
||||||
func.apply(undefined, args);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
var iterateeAry = function(func, n) {
|
|
||||||
return overArg(func, function(func) {
|
|
||||||
return typeof func == 'function' ? baseAry(func, n) : func;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var iterateeRearg = function(func, indexes) {
|
|
||||||
return overArg(func, function(func) {
|
|
||||||
var n = indexes.length;
|
|
||||||
return baseArity(rearg(baseAry(func, n), indexes), n);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var overArg = function(func, iteratee, retArg) {
|
|
||||||
return function() {
|
|
||||||
var length = arguments.length;
|
|
||||||
if (!length) {
|
|
||||||
return func();
|
|
||||||
}
|
|
||||||
var args = Array(length);
|
|
||||||
while (length--) {
|
|
||||||
args[length] = arguments[length];
|
|
||||||
}
|
|
||||||
var index = config.rearg ? 0 : (length - 1);
|
|
||||||
args[index] = iteratee(args[index]);
|
|
||||||
return func.apply(undefined, args);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
var wrappers = {
|
var wrappers = {
|
||||||
'castArray': function(castArray) {
|
'castArray': function(castArray) {
|
||||||
return function() {
|
return function() {
|
||||||
@@ -230,25 +220,143 @@ function baseConvert(util, name, func, options) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var wrap = function(name, func) {
|
/*--------------------------------------------------------------------------*/
|
||||||
name = mapping.aliasToReal[name] || name;
|
|
||||||
var wrapper = wrappers[name];
|
|
||||||
|
|
||||||
var convertMethod = function(options) {
|
/**
|
||||||
|
* Creates a clone of `object` by `path`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object} object The object to clone.
|
||||||
|
* @param {Array|string} path The path to clone by.
|
||||||
|
* @returns {Object} Returns the cloned object.
|
||||||
|
*/
|
||||||
|
function cloneByPath(object, path) {
|
||||||
|
path = toPath(path);
|
||||||
|
|
||||||
|
var index = -1,
|
||||||
|
length = path.length,
|
||||||
|
result = clone(Object(object)),
|
||||||
|
nested = result;
|
||||||
|
|
||||||
|
while (nested != null && ++index < length) {
|
||||||
|
var key = path[index],
|
||||||
|
value = nested[key];
|
||||||
|
|
||||||
|
if (value != null) {
|
||||||
|
nested[key] = clone(Object(value));
|
||||||
|
}
|
||||||
|
nested = nested[key];
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
|
||||||
|
* version with conversion `options` applied.
|
||||||
|
*
|
||||||
|
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
||||||
|
* @returns {Function} Returns the converted `lodash`.
|
||||||
|
*/
|
||||||
|
function convertLib(options) {
|
||||||
|
return _.runInContext.convert(options)(undefined);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a converter function for `func` of `name`.
|
||||||
|
*
|
||||||
|
* @param {string} name The name of the function to convert.
|
||||||
|
* @param {Function} func The function to convert.
|
||||||
|
* @returns {Function} Returns the new converter function.
|
||||||
|
*/
|
||||||
|
function createConverter(name, func) {
|
||||||
|
var oldOptions = options;
|
||||||
|
return function(options) {
|
||||||
var newUtil = isLib ? pristine : helpers,
|
var newUtil = isLib ? pristine : helpers,
|
||||||
newFunc = isLib ? pristine[name] : func,
|
newFunc = isLib ? pristine[name] : func,
|
||||||
newOptions = assign(assign({}, config), options);
|
newOptions = assign(assign({}, oldOptions), options);
|
||||||
|
|
||||||
return baseConvert(newUtil, name, newFunc, newOptions);
|
return baseConvert(newUtil, name, newFunc, newOptions);
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a function that wraps `func` to invoke its iteratee, with up to `n`
|
||||||
|
* arguments, ignoring any additional arguments.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Function} func The function to cap iteratee arguments for.
|
||||||
|
* @param {number} n The arity cap.
|
||||||
|
* @returns {Function} Returns the new function.
|
||||||
|
*/
|
||||||
|
function iterateeAry(func, n) {
|
||||||
|
return overArg(func, function(func) {
|
||||||
|
return typeof func == 'function' ? baseAry(func, n) : func;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a function that wraps `func` to invoke its iteratee with arguments
|
||||||
|
* arranged according to the specified `indexes` where the argument value at
|
||||||
|
* the first index is provided as the first argument, the argument value at
|
||||||
|
* the second index is provided as the second argument, and so on.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Function} func The function to rearrange iteratee arguments for.
|
||||||
|
* @param {number[]} indexes The arranged argument indexes.
|
||||||
|
* @returns {Function} Returns the new function.
|
||||||
|
*/
|
||||||
|
function iterateeRearg(func, indexes) {
|
||||||
|
return overArg(func, function(func) {
|
||||||
|
var n = indexes.length;
|
||||||
|
return baseArity(rearg(baseAry(func, n), indexes), n);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a function that invokes `func` with its first argument passed
|
||||||
|
* thru `transform`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Function} func The function to wrap.
|
||||||
|
* @param {...Function} transform The functions to transform the first argument.
|
||||||
|
* @returns {Function} Returns the new function.
|
||||||
|
*/
|
||||||
|
function overArg(func, transform) {
|
||||||
|
return function() {
|
||||||
|
var length = arguments.length;
|
||||||
|
if (!length) {
|
||||||
|
return func();
|
||||||
|
}
|
||||||
|
var args = Array(length);
|
||||||
|
while (length--) {
|
||||||
|
args[length] = arguments[length];
|
||||||
|
}
|
||||||
|
var index = config.rearg ? 0 : (length - 1);
|
||||||
|
args[index] = transform(args[index]);
|
||||||
|
return func.apply(undefined, args);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a function that wraps `func` and applys the conversions
|
||||||
|
* rules by `name`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} name The name of the function to wrap.
|
||||||
|
* @param {Function} func The function to wrap.
|
||||||
|
* @returns {Function} Returns the converted function.
|
||||||
|
*/
|
||||||
|
function wrap(name, func) {
|
||||||
|
name = mapping.aliasToReal[name] || name;
|
||||||
|
|
||||||
|
var result,
|
||||||
|
wrapped = func,
|
||||||
|
wrapper = wrappers[name];
|
||||||
|
|
||||||
if (wrapper) {
|
if (wrapper) {
|
||||||
var result = wrapper(func);
|
wrapped = wrapper(func);
|
||||||
result.convert = convertMethod;
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
var wrapped = func;
|
else if (config.immutable) {
|
||||||
if (config.immutable) {
|
|
||||||
if (mutateMap.array[name]) {
|
if (mutateMap.array[name]) {
|
||||||
wrapped = immutWrap(func, cloneArray);
|
wrapped = immutWrap(func, cloneArray);
|
||||||
}
|
}
|
||||||
@@ -267,7 +375,7 @@ function baseConvert(util, name, func, options) {
|
|||||||
spreadStart = mapping.methodSpread[name];
|
spreadStart = mapping.methodSpread[name];
|
||||||
|
|
||||||
result = wrapped;
|
result = wrapped;
|
||||||
if (config.fixed) {
|
if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
|
||||||
result = spreadStart === undefined
|
result = spreadStart === undefined
|
||||||
? ary(result, aryKey)
|
? ary(result, aryKey)
|
||||||
: spread(result, spreadStart);
|
: spread(result, spreadStart);
|
||||||
@@ -282,7 +390,8 @@ function baseConvert(util, name, func, options) {
|
|||||||
result = iterateeAry(result, aryN);
|
result = iterateeAry(result, aryN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (config.curry && aryKey > 1) {
|
if (forceCurry || (config.curry && aryKey > 1)) {
|
||||||
|
forceCurry && console.log(forceCurry, name);
|
||||||
result = curry(result, aryKey);
|
result = curry(result, aryKey);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -293,24 +402,26 @@ function baseConvert(util, name, func, options) {
|
|||||||
|
|
||||||
result || (result = wrapped);
|
result || (result = wrapped);
|
||||||
if (result == func) {
|
if (result == func) {
|
||||||
result = function() {
|
result = forceCurry ? curry(result, 1) : function() {
|
||||||
return func.apply(this, arguments);
|
return func.apply(this, arguments);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
result.convert = convertMethod;
|
result.convert = createConverter(name, func);
|
||||||
if (mapping.placeholder[name]) {
|
if (mapping.placeholder[name]) {
|
||||||
setPlaceholder = true;
|
setPlaceholder = true;
|
||||||
result.placeholder = func.placeholder = placeholder;
|
result.placeholder = func.placeholder = placeholder;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
if (!isObj) {
|
if (!isObj) {
|
||||||
return wrap(name, func);
|
return wrap(name, func);
|
||||||
}
|
}
|
||||||
var _ = func;
|
var _ = func;
|
||||||
|
|
||||||
// Iterate over methods for the current ary cap.
|
// Convert methods by ary cap.
|
||||||
var pairs = [];
|
var pairs = [];
|
||||||
each(aryMethodKeys, function(aryKey) {
|
each(aryMethodKeys, function(aryKey) {
|
||||||
each(mapping.aryMethod[aryKey], function(key) {
|
each(mapping.aryMethod[aryKey], function(key) {
|
||||||
@@ -321,6 +432,21 @@ function baseConvert(util, name, func, options) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Convert remaining methods.
|
||||||
|
each(keys(_), function(key) {
|
||||||
|
var func = _[key];
|
||||||
|
if (typeof func == 'function') {
|
||||||
|
var length = pairs.length;
|
||||||
|
while (length--) {
|
||||||
|
if (pairs[length][0] == key) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func.convert = createConverter(key, func);
|
||||||
|
pairs.push([key, func]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Assign to `_` leaving `_.prototype` unchanged to allow chaining.
|
// Assign to `_` leaving `_.prototype` unchanged to allow chaining.
|
||||||
each(pairs, function(pair) {
|
each(pairs, function(pair) {
|
||||||
_[pair[0]] = pair[1];
|
_[pair[0]] = pair[1];
|
||||||
@@ -330,7 +456,7 @@ function baseConvert(util, name, func, options) {
|
|||||||
if (setPlaceholder) {
|
if (setPlaceholder) {
|
||||||
_.placeholder = placeholder;
|
_.placeholder = placeholder;
|
||||||
}
|
}
|
||||||
// Reassign aliases.
|
// Assign aliases.
|
||||||
each(keys(_), function(key) {
|
each(keys(_), function(key) {
|
||||||
each(mapping.realToAlias[key] || [], function(alias) {
|
each(mapping.realToAlias[key] || [], function(alias) {
|
||||||
_[alias] = _[key];
|
_[alias] = _[key];
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
var baseConvert = require('./_baseConvert');
|
var baseConvert = require('./_baseConvert');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts `lodash` to an immutable auto-curried iteratee-first data-last version.
|
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
|
||||||
|
* version with conversion `options` applied.
|
||||||
*
|
*
|
||||||
* @param {Function} lodash The lodash function.
|
* @param {Function} lodash The lodash function to convert.
|
||||||
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
* @param {Object} [options] The options object. See `baseConvert` for more details.
|
||||||
* @returns {Function} Returns the converted `lodash`.
|
* @returns {Function} Returns the converted `lodash`.
|
||||||
*/
|
*/
|
||||||
|
|||||||
7
fp/_falseOptions.js
Normal file
7
fp/_falseOptions.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
module.exports = {
|
||||||
|
'cap': false,
|
||||||
|
'curry': false,
|
||||||
|
'fixed': false,
|
||||||
|
'immutable': false,
|
||||||
|
'rearg': false
|
||||||
|
};
|
||||||
@@ -30,17 +30,18 @@ exports.aliasToReal = {
|
|||||||
'init': 'initial',
|
'init': 'initial',
|
||||||
'invertObj': 'invert',
|
'invertObj': 'invert',
|
||||||
'juxt': 'over',
|
'juxt': 'over',
|
||||||
'mapObj': 'mapValues',
|
|
||||||
'omitAll': 'omit',
|
'omitAll': 'omit',
|
||||||
'nAry': 'ary',
|
'nAry': 'ary',
|
||||||
'path': 'get',
|
'path': 'get',
|
||||||
'pathEq': 'matchesProperty',
|
'pathEq': 'matchesProperty',
|
||||||
'pathOr': 'getOr',
|
'pathOr': 'getOr',
|
||||||
|
'paths': 'at',
|
||||||
'pickAll': 'pick',
|
'pickAll': 'pick',
|
||||||
'pipe': 'flow',
|
'pipe': 'flow',
|
||||||
'prop': 'get',
|
'prop': 'get',
|
||||||
'propOf': 'propertyOf',
|
'propEq': 'matchesProperty',
|
||||||
'propOr': 'getOr',
|
'propOr': 'getOr',
|
||||||
|
'props': 'at',
|
||||||
'unapply': 'rest',
|
'unapply': 'rest',
|
||||||
'unnest': 'flatten',
|
'unnest': 'flatten',
|
||||||
'useWith': 'overArgs',
|
'useWith': 'overArgs',
|
||||||
@@ -52,9 +53,10 @@ exports.aliasToReal = {
|
|||||||
exports.aryMethod = {
|
exports.aryMethod = {
|
||||||
'1': [
|
'1': [
|
||||||
'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
|
'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
|
||||||
'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin',
|
'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
|
||||||
'over', 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext',
|
'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse',
|
||||||
'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words'
|
'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
|
||||||
|
'uniqueId', 'words'
|
||||||
],
|
],
|
||||||
'2': [
|
'2': [
|
||||||
'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll',
|
'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll',
|
||||||
@@ -67,16 +69,17 @@ exports.aryMethod = {
|
|||||||
'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
|
'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
|
||||||
'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
|
'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
|
||||||
'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
|
'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
|
||||||
'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'omit', 'omitBy',
|
'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth',
|
||||||
'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', 'partialRight',
|
'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
|
||||||
'partition', 'pick', 'pickBy', 'pull', 'pullAll', 'pullAt', 'random', 'range',
|
'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
|
||||||
'rangeRight', 'rearg', 'reject', 'remove', 'repeat', 'restFrom', 'result',
|
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
|
||||||
'sampleSize', 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', 'sortedLastIndex',
|
'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
|
||||||
'sortedLastIndexOf', 'sortedUniqBy', 'split', 'spreadFrom', 'startsWith',
|
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
|
||||||
'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', 'tap',
|
'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
|
||||||
'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd', 'trimCharsStart',
|
'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
|
||||||
'truncate', 'union', 'uniqBy', 'uniqWith', 'unset', 'unzipWith', 'without',
|
'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
|
||||||
'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'
|
'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
|
||||||
|
'zipObjectDeep'
|
||||||
],
|
],
|
||||||
'3': [
|
'3': [
|
||||||
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
|
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
|
||||||
@@ -244,7 +247,17 @@ exports.remap = {
|
|||||||
'trimCharsStart': 'trimStart'
|
'trimCharsStart': 'trimStart'
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Used to track methods that skip `_.rearg`. */
|
/** Used to track methods that skip fixing their arity. */
|
||||||
|
exports.skipFixed = {
|
||||||
|
'castArray': true,
|
||||||
|
'flow': true,
|
||||||
|
'flowRight': true,
|
||||||
|
'iteratee': true,
|
||||||
|
'mixin': true,
|
||||||
|
'runInContext': true
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Used to track methods that skip rearranging arguments. */
|
||||||
exports.skipRearg = {
|
exports.skipRearg = {
|
||||||
'add': true,
|
'add': true,
|
||||||
'assign': true,
|
'assign': true,
|
||||||
@@ -263,6 +276,7 @@ exports.skipRearg = {
|
|||||||
'matchesProperty': true,
|
'matchesProperty': true,
|
||||||
'merge': true,
|
'merge': true,
|
||||||
'multiply': true,
|
'multiply': true,
|
||||||
|
'overArgs': true,
|
||||||
'partial': true,
|
'partial': true,
|
||||||
'partialRight': true,
|
'partialRight': true,
|
||||||
'random': true,
|
'random': true,
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('add', require('../add'));
|
func = convert('add', require('../add'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('after', require('../after'));
|
func = convert('after', require('../after'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('ary', require('../ary'));
|
func = convert('ary', require('../ary'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('assign', require('../assign'));
|
func = convert('assign', require('../assign'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('assignIn', require('../assignIn'));
|
func = convert('assignIn', require('../assignIn'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('assignInWith', require('../assignInWith'));
|
func = convert('assignInWith', require('../assignInWith'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('assignWith', require('../assignWith'));
|
func = convert('assignWith', require('../assignWith'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
7
fp/at.js
7
fp/at.js
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('at', require('../at'));
|
func = convert('at', require('../at'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('attempt', require('../attempt'));
|
func = convert('attempt', require('../attempt'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('before', require('../before'));
|
func = convert('before', require('../before'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('bind', require('../bind'));
|
func = convert('bind', require('../bind'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('bindAll', require('../bindAll'));
|
func = convert('bindAll', require('../bindAll'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('bindKey', require('../bindKey'));
|
func = convert('bindKey', require('../bindKey'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
module.exports = require('../camelCase');
|
var convert = require('./convert'),
|
||||||
|
func = convert('camelCase', require('../camelCase'), require('./_falseOptions'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
module.exports = require('../capitalize');
|
var convert = require('./convert'),
|
||||||
|
func = convert('capitalize', require('../capitalize'), require('./_falseOptions'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('castArray', require('../castArray'));
|
func = convert('castArray', require('../castArray'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('ceil', require('../ceil'));
|
func = convert('ceil', require('../ceil'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
module.exports = require('../chain');
|
var convert = require('./convert'),
|
||||||
|
func = convert('chain', require('../chain'), require('./_falseOptions'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('chunk', require('../chunk'));
|
func = convert('chunk', require('../chunk'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('clamp', require('../clamp'));
|
func = convert('clamp', require('../clamp'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
module.exports = require('../clone');
|
var convert = require('./convert'),
|
||||||
|
func = convert('clone', require('../clone'), require('./_falseOptions'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
module.exports = require('../cloneDeep');
|
var convert = require('./convert'),
|
||||||
|
func = convert('cloneDeep', require('../cloneDeep'), require('./_falseOptions'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('cloneDeepWith', require('../cloneDeepWith'));
|
func = convert('cloneDeepWith', require('../cloneDeepWith'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('cloneWith', require('../cloneWith'));
|
func = convert('cloneWith', require('../cloneWith'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
module.exports = require('../commit');
|
var convert = require('./convert'),
|
||||||
|
func = convert('commit', require('../commit'), require('./_falseOptions'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
module.exports = require('../compact');
|
var convert = require('./convert'),
|
||||||
|
func = convert('compact', require('../compact'), require('./_falseOptions'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('concat', require('../concat'));
|
func = convert('concat', require('../concat'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
module.exports = require('../cond');
|
var convert = require('./convert'),
|
||||||
|
func = convert('cond', require('../cond'), require('./_falseOptions'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
module.exports = require('../conforms');
|
var convert = require('./convert'),
|
||||||
|
func = convert('conforms', require('../conforms'), require('./_falseOptions'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
module.exports = require('../constant');
|
var convert = require('./convert'),
|
||||||
|
func = convert('constant', require('../constant'), require('./_falseOptions'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ var baseConvert = require('./_baseConvert'),
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts `func` of `name` to an immutable auto-curried iteratee-first data-last
|
* Converts `func` of `name` to an immutable auto-curried iteratee-first data-last
|
||||||
* version. If `name` is an object its methods will be converted.
|
* version with conversion `options` applied. If `name` is an object its methods
|
||||||
|
* will be converted.
|
||||||
*
|
*
|
||||||
* @param {string} name The name of the function to wrap.
|
* @param {string} name The name of the function to wrap.
|
||||||
* @param {Function} [func] The function to wrap.
|
* @param {Function} [func] The function to wrap.
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('countBy', require('../countBy'));
|
func = convert('countBy', require('../countBy'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
var convert = require('./convert');
|
var convert = require('./convert'),
|
||||||
module.exports = convert('create', require('../create'));
|
func = convert('create', require('../create'));
|
||||||
|
|
||||||
|
func.placeholder = require('./placeholder');
|
||||||
|
module.exports = func;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user