mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
Compare commits
6 Commits
4.8.1-npm
...
4.11.2-npm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ddde027fd9 | ||
|
|
e93cb815c3 | ||
|
|
63ba93dcb3 | ||
|
|
be0bf2681b | ||
|
|
7d39d58e43 | ||
|
|
7c17af79c7 |
@@ -1,4 +1,4 @@
|
||||
# lodash v4.8.1
|
||||
# lodash v4.11.2
|
||||
|
||||
The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules.
|
||||
|
||||
@@ -28,7 +28,7 @@ var chunk = require('lodash/chunk');
|
||||
var extend = require('lodash/fp/extend');
|
||||
```
|
||||
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.8.1-npm) for more details.
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.11.2-npm) for more details.
|
||||
|
||||
**Note:**<br>
|
||||
Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.<br>
|
||||
|
||||
2
_Hash.js
2
_Hash.js
@@ -4,7 +4,7 @@ var nativeCreate = require('./_nativeCreate');
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/**
|
||||
* Creates an hash object.
|
||||
* Creates a hash object.
|
||||
*
|
||||
* @private
|
||||
* @constructor
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
var isSymbol = require('./isSymbol');
|
||||
|
||||
/**
|
||||
* Casts `value` to a string if it's not a string or symbol.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to inspect.
|
||||
* @returns {string|symbol} Returns the cast key.
|
||||
*/
|
||||
function baseCastKey(key) {
|
||||
return (typeof key == 'string' || isSymbol(key)) ? key : (key + '');
|
||||
}
|
||||
|
||||
module.exports = baseCastKey;
|
||||
@@ -47,6 +47,7 @@ function baseDifference(array, values, iteratee, comparator) {
|
||||
var value = array[index],
|
||||
computed = iteratee ? iteratee(value) : value;
|
||||
|
||||
value = (comparator || value !== 0) ? value : 0;
|
||||
if (isCommon && computed === computed) {
|
||||
var valuesIndex = valuesLength;
|
||||
while (valuesIndex--) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
var isSymbol = require('./isSymbol');
|
||||
|
||||
/**
|
||||
* The base implementation of methods like `_.max` and `_.min` which accepts a
|
||||
* `comparator` to determine the extremum value.
|
||||
@@ -17,7 +19,7 @@ function baseExtremum(array, iteratee, comparator) {
|
||||
current = iteratee(value);
|
||||
|
||||
if (current != null && (computed === undefined
|
||||
? current === current
|
||||
? (current === current && !isSymbol(current))
|
||||
: comparator(current, computed)
|
||||
)) {
|
||||
var computed = current,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
var arrayPush = require('./_arrayPush'),
|
||||
isArguments = require('./isArguments'),
|
||||
isArray = require('./isArray'),
|
||||
isArrayLikeObject = require('./isArrayLikeObject');
|
||||
isFlattenable = require('./_isFlattenable');
|
||||
|
||||
/**
|
||||
* The base implementation of `_.flatten` with support for restricting flattening.
|
||||
@@ -9,23 +7,24 @@ var arrayPush = require('./_arrayPush'),
|
||||
* @private
|
||||
* @param {Array} array The array to flatten.
|
||||
* @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.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
*/
|
||||
function baseFlatten(array, depth, isStrict, result) {
|
||||
result || (result = []);
|
||||
|
||||
function baseFlatten(array, depth, predicate, isStrict, result) {
|
||||
var index = -1,
|
||||
length = array.length;
|
||||
|
||||
predicate || (predicate = isFlattenable);
|
||||
result || (result = []);
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
if (depth > 0 && isArrayLikeObject(value) &&
|
||||
(isStrict || isArray(value) || isArguments(value))) {
|
||||
if (depth > 0 && predicate(value)) {
|
||||
if (depth > 1) {
|
||||
// Recursively flatten arrays (susceptible to call stack limits).
|
||||
baseFlatten(value, depth - 1, isStrict, result);
|
||||
baseFlatten(value, depth - 1, predicate, isStrict, result);
|
||||
} else {
|
||||
arrayPush(result, value);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ var createBaseFor = require('./_createBaseFor');
|
||||
|
||||
/**
|
||||
* 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`.
|
||||
*
|
||||
* @private
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
var baseCastPath = require('./_baseCastPath'),
|
||||
isKey = require('./_isKey');
|
||||
var castPath = require('./_castPath'),
|
||||
isKey = require('./_isKey'),
|
||||
toKey = require('./_toKey');
|
||||
|
||||
/**
|
||||
* The base implementation of `_.get` without support for default values.
|
||||
@@ -10,13 +11,13 @@ var baseCastPath = require('./_baseCastPath'),
|
||||
* @returns {*} Returns the resolved value.
|
||||
*/
|
||||
function baseGet(object, path) {
|
||||
path = isKey(path, object) ? [path] : baseCastPath(path);
|
||||
path = isKey(path, object) ? [path] : castPath(path);
|
||||
|
||||
var index = 0,
|
||||
length = path.length;
|
||||
|
||||
while (object != null && index < length) {
|
||||
object = object[path[index++]];
|
||||
object = object[toKey(path[index++])];
|
||||
}
|
||||
return (index && index == length) ? object : undefined;
|
||||
}
|
||||
|
||||
14
_baseGt.js
Normal file
14
_baseGt.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* The base implementation of `_.gt` which doesn't coerce arguments to numbers.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to compare.
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {boolean} Returns `true` if `value` is greater than `other`,
|
||||
* else `false`.
|
||||
*/
|
||||
function baseGt(value, other) {
|
||||
return value > other;
|
||||
}
|
||||
|
||||
module.exports = baseGt;
|
||||
@@ -47,6 +47,7 @@ function baseIntersection(arrays, iteratee, comparator) {
|
||||
var value = array[index],
|
||||
computed = iteratee ? iteratee(value) : value;
|
||||
|
||||
value = (comparator || value !== 0) ? value : 0;
|
||||
if (!(seen
|
||||
? cacheHas(seen, computed)
|
||||
: includes(result, computed, comparator)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
var apply = require('./_apply'),
|
||||
baseCastPath = require('./_baseCastPath'),
|
||||
castPath = require('./_castPath'),
|
||||
isKey = require('./_isKey'),
|
||||
last = require('./last'),
|
||||
parent = require('./_parent');
|
||||
parent = require('./_parent'),
|
||||
toKey = require('./_toKey');
|
||||
|
||||
/**
|
||||
* The base implementation of `_.invoke` without support for individual
|
||||
@@ -16,11 +17,11 @@ var apply = require('./_apply'),
|
||||
*/
|
||||
function baseInvoke(object, path, args) {
|
||||
if (!isKey(path, object)) {
|
||||
path = baseCastPath(path);
|
||||
path = castPath(path);
|
||||
object = parent(object, path);
|
||||
path = last(path);
|
||||
}
|
||||
var func = object == null ? object : object[path];
|
||||
var func = object == null ? object : object[toKey(path)];
|
||||
return func == null ? undefined : apply(func, object, args);
|
||||
}
|
||||
|
||||
|
||||
14
_baseLt.js
Normal file
14
_baseLt.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* The base implementation of `_.lt` which doesn't coerce arguments to numbers.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to compare.
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {boolean} Returns `true` if `value` is less than `other`,
|
||||
* else `false`.
|
||||
*/
|
||||
function baseLt(value, other) {
|
||||
return value < other;
|
||||
}
|
||||
|
||||
module.exports = baseLt;
|
||||
@@ -3,7 +3,8 @@ var baseIsEqual = require('./_baseIsEqual'),
|
||||
hasIn = require('./hasIn'),
|
||||
isKey = require('./_isKey'),
|
||||
isStrictComparable = require('./_isStrictComparable'),
|
||||
matchesStrictComparable = require('./_matchesStrictComparable');
|
||||
matchesStrictComparable = require('./_matchesStrictComparable'),
|
||||
toKey = require('./_toKey');
|
||||
|
||||
/** Used to compose bitmasks for comparison styles. */
|
||||
var UNORDERED_COMPARE_FLAG = 1,
|
||||
@@ -19,7 +20,7 @@ var UNORDERED_COMPARE_FLAG = 1,
|
||||
*/
|
||||
function baseMatchesProperty(path, srcValue) {
|
||||
if (isKey(path) && isStrictComparable(srcValue)) {
|
||||
return matchesStrictComparable(path, srcValue);
|
||||
return matchesStrictComparable(toKey(path), srcValue);
|
||||
}
|
||||
return function(object) {
|
||||
var objValue = get(object, path);
|
||||
|
||||
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'),
|
||||
baseMap = require('./_baseMap'),
|
||||
baseSortBy = require('./_baseSortBy'),
|
||||
baseUnary = require('./_baseUnary'),
|
||||
compareMultiple = require('./_compareMultiple'),
|
||||
identity = require('./identity');
|
||||
|
||||
@@ -16,7 +17,7 @@ var arrayMap = require('./_arrayMap'),
|
||||
*/
|
||||
function baseOrderBy(collection, iteratees, orders) {
|
||||
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 criteria = arrayMap(iteratees, function(iteratee) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
var baseCastPath = require('./_baseCastPath'),
|
||||
var castPath = require('./_castPath'),
|
||||
isIndex = require('./_isIndex'),
|
||||
isKey = require('./_isKey'),
|
||||
last = require('./last'),
|
||||
parent = require('./_parent');
|
||||
parent = require('./_parent'),
|
||||
toKey = require('./_toKey');
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var arrayProto = Array.prototype;
|
||||
@@ -25,21 +26,21 @@ function basePullAt(array, indexes) {
|
||||
|
||||
while (length--) {
|
||||
var index = indexes[length];
|
||||
if (lastIndex == length || index != previous) {
|
||||
if (length == lastIndex || index !== previous) {
|
||||
var previous = index;
|
||||
if (isIndex(index)) {
|
||||
splice.call(array, index, 1);
|
||||
}
|
||||
else if (!isKey(index, array)) {
|
||||
var path = baseCastPath(index),
|
||||
var path = castPath(index),
|
||||
object = parent(array, path);
|
||||
|
||||
if (object != null) {
|
||||
delete object[last(path)];
|
||||
delete object[toKey(last(path))];
|
||||
}
|
||||
}
|
||||
else {
|
||||
delete array[index];
|
||||
delete array[toKey(index)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
var assignValue = require('./_assignValue'),
|
||||
baseCastPath = require('./_baseCastPath'),
|
||||
castPath = require('./_castPath'),
|
||||
isIndex = require('./_isIndex'),
|
||||
isKey = require('./_isKey'),
|
||||
isObject = require('./isObject');
|
||||
isObject = require('./isObject'),
|
||||
toKey = require('./_toKey');
|
||||
|
||||
/**
|
||||
* The base implementation of `_.set`.
|
||||
@@ -15,7 +16,7 @@ var assignValue = require('./_assignValue'),
|
||||
* @returns {Object} Returns `object`.
|
||||
*/
|
||||
function baseSet(object, path, value, customizer) {
|
||||
path = isKey(path, object) ? [path] : baseCastPath(path);
|
||||
path = isKey(path, object) ? [path] : castPath(path);
|
||||
|
||||
var index = -1,
|
||||
length = path.length,
|
||||
@@ -23,7 +24,7 @@ function baseSet(object, path, value, customizer) {
|
||||
nested = object;
|
||||
|
||||
while (nested != null && ++index < length) {
|
||||
var key = path[index];
|
||||
var key = toKey(path[index]);
|
||||
if (isObject(nested)) {
|
||||
var newValue = value;
|
||||
if (index != lastIndex) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
var baseSortedIndexBy = require('./_baseSortedIndexBy'),
|
||||
identity = require('./identity');
|
||||
identity = require('./identity'),
|
||||
isSymbol = require('./isSymbol');
|
||||
|
||||
/** Used as references for the maximum length and index of an array. */
|
||||
var MAX_ARRAY_LENGTH = 4294967295,
|
||||
@@ -26,7 +27,8 @@ function baseSortedIndex(array, value, retHighest) {
|
||||
var mid = (low + high) >>> 1,
|
||||
computed = array[mid];
|
||||
|
||||
if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
|
||||
if (computed !== null && !isSymbol(computed) &&
|
||||
(retHighest ? (computed <= value) : (computed < value))) {
|
||||
low = mid + 1;
|
||||
} else {
|
||||
high = mid;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
var isSymbol = require('./isSymbol');
|
||||
|
||||
/** Used as references for the maximum length and index of an array. */
|
||||
var MAX_ARRAY_LENGTH = 4294967295,
|
||||
MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
|
||||
@@ -26,21 +28,26 @@ function baseSortedIndexBy(array, value, iteratee, retHighest) {
|
||||
high = array ? array.length : 0,
|
||||
valIsNaN = value !== value,
|
||||
valIsNull = value === null,
|
||||
valIsUndef = value === undefined;
|
||||
valIsSymbol = isSymbol(value),
|
||||
valIsUndefined = value === undefined;
|
||||
|
||||
while (low < high) {
|
||||
var mid = nativeFloor((low + high) / 2),
|
||||
computed = iteratee(array[mid]),
|
||||
isDef = computed !== undefined,
|
||||
isReflexive = computed === computed;
|
||||
othIsDefined = computed !== undefined,
|
||||
othIsNull = computed === null,
|
||||
othIsReflexive = computed === computed,
|
||||
othIsSymbol = isSymbol(computed);
|
||||
|
||||
if (valIsNaN) {
|
||||
var setLow = isReflexive || retHighest;
|
||||
var setLow = retHighest || othIsReflexive;
|
||||
} else if (valIsUndefined) {
|
||||
setLow = othIsReflexive && (retHighest || othIsDefined);
|
||||
} else if (valIsNull) {
|
||||
setLow = isReflexive && isDef && (retHighest || computed != null);
|
||||
} else if (valIsUndef) {
|
||||
setLow = isReflexive && (retHighest || isDef);
|
||||
} else if (computed == null) {
|
||||
setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
|
||||
} else if (valIsSymbol) {
|
||||
setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
|
||||
} else if (othIsNull || othIsSymbol) {
|
||||
setLow = false;
|
||||
} else {
|
||||
setLow = retHighest ? (computed <= value) : (computed < value);
|
||||
|
||||
@@ -1,14 +1,30 @@
|
||||
var baseSortedUniqBy = require('./_baseSortedUniqBy');
|
||||
var eq = require('./eq');
|
||||
|
||||
/**
|
||||
* The base implementation of `_.sortedUniq`.
|
||||
* The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
|
||||
* support for iteratee shorthands.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {Function} [iteratee] The iteratee invoked per element.
|
||||
* @returns {Array} Returns the new duplicate free array.
|
||||
*/
|
||||
function baseSortedUniq(array) {
|
||||
return baseSortedUniqBy(array);
|
||||
function baseSortedUniq(array, iteratee) {
|
||||
var index = -1,
|
||||
length = array.length,
|
||||
resIndex = 0,
|
||||
result = [];
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index],
|
||||
computed = iteratee ? iteratee(value) : value;
|
||||
|
||||
if (!index || !eq(computed, seen)) {
|
||||
var seen = computed;
|
||||
result[resIndex++] = value === 0 ? 0 : value;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = baseSortedUniq;
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
var eq = require('./eq');
|
||||
|
||||
/**
|
||||
* The base implementation of `_.sortedUniqBy` without support for iteratee
|
||||
* shorthands.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {Function} [iteratee] The iteratee invoked per element.
|
||||
* @returns {Array} Returns the new duplicate free array.
|
||||
*/
|
||||
function baseSortedUniqBy(array, iteratee) {
|
||||
var index = 0,
|
||||
length = array.length,
|
||||
value = array[0],
|
||||
computed = iteratee ? iteratee(value) : value,
|
||||
seen = computed,
|
||||
resIndex = 1,
|
||||
result = [value];
|
||||
|
||||
while (++index < length) {
|
||||
value = array[index],
|
||||
computed = iteratee ? iteratee(value) : value;
|
||||
|
||||
if (!eq(computed, seen)) {
|
||||
seen = computed;
|
||||
result[resIndex++] = value;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = baseSortedUniqBy;
|
||||
24
_baseToNumber.js
Normal file
24
_baseToNumber.js
Normal file
@@ -0,0 +1,24 @@
|
||||
var isSymbol = require('./isSymbol');
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
var NAN = 0 / 0;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.toNumber` which doesn't ensure correct
|
||||
* conversions of binary, hexadecimal, or octal string values.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to process.
|
||||
* @returns {number} Returns the number.
|
||||
*/
|
||||
function baseToNumber(value) {
|
||||
if (typeof value == 'number') {
|
||||
return value;
|
||||
}
|
||||
if (isSymbol(value)) {
|
||||
return NAN;
|
||||
}
|
||||
return +value;
|
||||
}
|
||||
|
||||
module.exports = baseToNumber;
|
||||
31
_baseToString.js
Normal file
31
_baseToString.js
Normal file
@@ -0,0 +1,31 @@
|
||||
var Symbol = require('./_Symbol'),
|
||||
isSymbol = require('./isSymbol');
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
var INFINITY = 1 / 0;
|
||||
|
||||
/** Used to convert symbols to primitives and strings. */
|
||||
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
||||
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.toString` which doesn't convert nullish
|
||||
* values to empty strings.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to process.
|
||||
* @returns {string} Returns the string.
|
||||
*/
|
||||
function baseToString(value) {
|
||||
// Exit early for strings to avoid a performance hit in some environments.
|
||||
if (typeof value == 'string') {
|
||||
return value;
|
||||
}
|
||||
if (isSymbol(value)) {
|
||||
return symbolToString ? symbolToString.call(value) : '';
|
||||
}
|
||||
var result = (value + '');
|
||||
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
||||
}
|
||||
|
||||
module.exports = baseToString;
|
||||
@@ -46,6 +46,7 @@ function baseUniq(array, iteratee, comparator) {
|
||||
var value = array[index],
|
||||
computed = iteratee ? iteratee(value) : value;
|
||||
|
||||
value = (comparator || value !== 0) ? value : 0;
|
||||
if (isCommon && computed === computed) {
|
||||
var seenIndex = seen.length;
|
||||
while (seenIndex--) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
var baseCastPath = require('./_baseCastPath'),
|
||||
has = require('./has'),
|
||||
var baseHas = require('./_baseHas'),
|
||||
castPath = require('./_castPath'),
|
||||
isKey = require('./_isKey'),
|
||||
last = require('./last'),
|
||||
parent = require('./_parent');
|
||||
parent = require('./_parent'),
|
||||
toKey = require('./_toKey');
|
||||
|
||||
/**
|
||||
* The base implementation of `_.unset`.
|
||||
@@ -13,10 +14,11 @@ var baseCastPath = require('./_baseCastPath'),
|
||||
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
|
||||
*/
|
||||
function baseUnset(object, path) {
|
||||
path = isKey(path, object) ? [path] : baseCastPath(path);
|
||||
path = isKey(path, object) ? [path] : castPath(path);
|
||||
object = parent(object, path);
|
||||
var key = last(path);
|
||||
return (object != null && has(object, key)) ? delete object[key] : true;
|
||||
|
||||
var key = toKey(last(path));
|
||||
return !(object != null && baseHas(object, key)) || delete object[key];
|
||||
}
|
||||
|
||||
module.exports = baseUnset;
|
||||
|
||||
@@ -7,8 +7,8 @@ var isArrayLikeObject = require('./isArrayLikeObject');
|
||||
* @param {*} value The value to inspect.
|
||||
* @returns {Array|Object} Returns the cast array-like object.
|
||||
*/
|
||||
function baseCastArrayLikeObject(value) {
|
||||
function castArrayLikeObject(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.
|
||||
* @returns {Function} Returns cast function.
|
||||
*/
|
||||
function baseCastFunction(value) {
|
||||
function castFunction(value) {
|
||||
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.
|
||||
* @returns {Array} Returns the cast property path array.
|
||||
*/
|
||||
function baseCastPath(value) {
|
||||
function castPath(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,3 +1,5 @@
|
||||
var isSymbol = require('./isSymbol');
|
||||
|
||||
/**
|
||||
* Compares values to sort them in ascending order.
|
||||
*
|
||||
@@ -8,22 +10,28 @@
|
||||
*/
|
||||
function compareAscending(value, other) {
|
||||
if (value !== other) {
|
||||
var valIsNull = value === null,
|
||||
valIsUndef = value === undefined,
|
||||
valIsReflexive = value === value;
|
||||
var valIsDefined = value !== undefined,
|
||||
valIsNull = value === null,
|
||||
valIsReflexive = value === value,
|
||||
valIsSymbol = isSymbol(value);
|
||||
|
||||
var othIsNull = other === null,
|
||||
othIsUndef = other === undefined,
|
||||
othIsReflexive = other === other;
|
||||
var othIsDefined = other !== undefined,
|
||||
othIsNull = other === null,
|
||||
othIsReflexive = other === other,
|
||||
othIsSymbol = isSymbol(other);
|
||||
|
||||
if ((value > other && !othIsNull) || !valIsReflexive ||
|
||||
(valIsNull && !othIsUndef && othIsReflexive) ||
|
||||
(valIsUndef && othIsReflexive)) {
|
||||
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
|
||||
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
|
||||
(valIsNull && othIsDefined && othIsReflexive) ||
|
||||
(!valIsDefined && othIsReflexive) ||
|
||||
!valIsReflexive) {
|
||||
return 1;
|
||||
}
|
||||
if ((value < other && !valIsNull) || !othIsReflexive ||
|
||||
(othIsNull && !valIsUndef && valIsReflexive) ||
|
||||
(othIsUndef && valIsReflexive)) {
|
||||
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
|
||||
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
|
||||
(othIsNull && valIsDefined && valIsReflexive) ||
|
||||
(!othIsDefined && valIsReflexive) ||
|
||||
!othIsReflexive) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var copyObjectWith = require('./_copyObjectWith');
|
||||
var assignValue = require('./_assignValue');
|
||||
|
||||
/**
|
||||
* Copies properties of `source` to `object`.
|
||||
@@ -7,10 +7,25 @@ var copyObjectWith = require('./_copyObjectWith');
|
||||
* @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 copyObject(source, props, object) {
|
||||
return copyObjectWith(source, props, object);
|
||||
function copyObject(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 = 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');
|
||||
|
||||
/** 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`.
|
||||
*
|
||||
@@ -28,8 +18,13 @@ function createCaseFirst(methodName) {
|
||||
? stringToArray(string)
|
||||
: undefined;
|
||||
|
||||
var chr = strSymbols ? strSymbols[0] : string.charAt(0),
|
||||
trailing = strSymbols ? strSymbols.slice(1).join('') : string.slice(1);
|
||||
var chr = strSymbols
|
||||
? strSymbols[0]
|
||||
: string.charAt(0);
|
||||
|
||||
var trailing = strSymbols
|
||||
? castSlice(strSymbols, 1).join('')
|
||||
: string.slice(1);
|
||||
|
||||
return chr[methodName]() + trailing;
|
||||
};
|
||||
|
||||
@@ -2,6 +2,12 @@ var arrayReduce = require('./_arrayReduce'),
|
||||
deburr = require('./deburr'),
|
||||
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`.
|
||||
*
|
||||
@@ -11,7 +17,7 @@ var arrayReduce = require('./_arrayReduce'),
|
||||
*/
|
||||
function createCompounder(callback) {
|
||||
return function(string) {
|
||||
return arrayReduce(words(deburr(string)), callback, '');
|
||||
return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
var baseToNumber = require('./_baseToNumber'),
|
||||
baseToString = require('./_baseToString');
|
||||
|
||||
/**
|
||||
* Creates a function that performs a mathematical operation on two values.
|
||||
*
|
||||
@@ -15,7 +18,17 @@ function createMathOperation(operator) {
|
||||
result = value;
|
||||
}
|
||||
if (other !== undefined) {
|
||||
result = result === undefined ? other : operator(result, other);
|
||||
if (result === undefined) {
|
||||
return other;
|
||||
}
|
||||
if (typeof value == 'string' || typeof other == 'string') {
|
||||
value = baseToString(value);
|
||||
other = baseToString(other);
|
||||
} else {
|
||||
value = baseToNumber(value);
|
||||
other = baseToNumber(other);
|
||||
}
|
||||
result = operator(value, other);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
var apply = require('./_apply'),
|
||||
arrayMap = require('./_arrayMap'),
|
||||
baseFlatten = require('./_baseFlatten'),
|
||||
baseIteratee = require('./_baseIteratee'),
|
||||
baseUnary = require('./_baseUnary'),
|
||||
isArray = require('./isArray'),
|
||||
isFlattenableIteratee = require('./_isFlattenableIteratee'),
|
||||
rest = require('./rest');
|
||||
|
||||
/**
|
||||
@@ -12,7 +16,10 @@ var apply = require('./_apply'),
|
||||
*/
|
||||
function createOver(arrayFunc) {
|
||||
return rest(function(iteratees) {
|
||||
iteratees = arrayMap(iteratees, baseIteratee);
|
||||
iteratees = (iteratees.length == 1 && isArray(iteratees[0]))
|
||||
? arrayMap(iteratees[0], baseUnary(baseIteratee))
|
||||
: arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), baseUnary(baseIteratee));
|
||||
|
||||
return rest(function(args) {
|
||||
var thisArg = this;
|
||||
return arrayFunc(iteratees, function(iteratee) {
|
||||
|
||||
@@ -1,19 +1,10 @@
|
||||
var baseRepeat = require('./_baseRepeat'),
|
||||
baseToString = require('./_baseToString'),
|
||||
castSlice = require('./_castSlice'),
|
||||
reHasComplexSymbol = require('./_reHasComplexSymbol'),
|
||||
stringSize = require('./_stringSize'),
|
||||
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. */
|
||||
var nativeCeil = Math.ceil;
|
||||
|
||||
@@ -27,7 +18,7 @@ var nativeCeil = Math.ceil;
|
||||
* @returns {string} Returns the padding for `string`.
|
||||
*/
|
||||
function createPadding(length, chars) {
|
||||
chars = chars === undefined ? ' ' : (chars + '');
|
||||
chars = chars === undefined ? ' ' : baseToString(chars);
|
||||
|
||||
var charsLength = chars.length;
|
||||
if (charsLength < 2) {
|
||||
@@ -35,7 +26,7 @@ function createPadding(length, chars) {
|
||||
}
|
||||
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
||||
return reHasComplexSymbol.test(chars)
|
||||
? stringToArray(result).slice(0, length).join('')
|
||||
? castSlice(stringToArray(result), 0, length).join('')
|
||||
: result.slice(0, length);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
var copyArray = require('./_copyArray'),
|
||||
isLaziable = require('./_isLaziable'),
|
||||
var isLaziable = require('./_isLaziable'),
|
||||
setData = require('./_setData');
|
||||
|
||||
/** 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) {
|
||||
var isCurry = bitmask & CURRY_FLAG,
|
||||
newArgPos = argPos ? copyArray(argPos) : undefined,
|
||||
newHolders = isCurry ? holders : undefined,
|
||||
newHoldersRight = isCurry ? undefined : holders,
|
||||
newPartials = isCurry ? partials : undefined,
|
||||
@@ -44,7 +42,7 @@ function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, par
|
||||
}
|
||||
var newData = [
|
||||
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
|
||||
newHoldersRight, newArgPos, ary, arity
|
||||
newHoldersRight, argPos, ary, arity
|
||||
];
|
||||
|
||||
var result = wrapFunc.apply(undefined, newData);
|
||||
|
||||
20
_createRelationalOperation.js
Normal file
20
_createRelationalOperation.js
Normal file
@@ -0,0 +1,20 @@
|
||||
var toNumber = require('./toNumber');
|
||||
|
||||
/**
|
||||
* Creates a function that performs a relational operation on two values.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} operator The function to perform the operation.
|
||||
* @returns {Function} Returns the new relational operation function.
|
||||
*/
|
||||
function createRelationalOperation(operator) {
|
||||
return function(value, other) {
|
||||
if (!(typeof value == 'string' && typeof other == 'string')) {
|
||||
value = toNumber(value);
|
||||
other = toNumber(other);
|
||||
}
|
||||
return operator(value, other);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = createRelationalOperation;
|
||||
@@ -1,5 +1,9 @@
|
||||
var Set = require('./_Set'),
|
||||
noop = require('./noop');
|
||||
noop = require('./noop'),
|
||||
setToArray = require('./_setToArray');
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
var INFINITY = 1 / 0;
|
||||
|
||||
/**
|
||||
* Creates a set of `values`.
|
||||
@@ -8,7 +12,7 @@ var Set = require('./_Set'),
|
||||
* @param {Array} values The values to add to the set.
|
||||
* @returns {Object} Returns the new set.
|
||||
*/
|
||||
var createSet = !(Set && new Set([1, 2]).size === 2) ? noop : function(values) {
|
||||
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
|
||||
return new Set(values);
|
||||
};
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
||||
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
|
||||
getTag = function(value) {
|
||||
var result = objectToString.call(value),
|
||||
Ctor = result == objectTag ? value.constructor : null,
|
||||
ctorString = toSource(Ctor);
|
||||
Ctor = result == objectTag ? value.constructor : undefined,
|
||||
ctorString = Ctor ? toSource(Ctor) : undefined;
|
||||
|
||||
if (ctorString) {
|
||||
switch (ctorString) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
var baseCastPath = require('./_baseCastPath'),
|
||||
var castPath = require('./_castPath'),
|
||||
isArguments = require('./isArguments'),
|
||||
isArray = require('./isArray'),
|
||||
isIndex = require('./_isIndex'),
|
||||
isKey = require('./_isKey'),
|
||||
isLength = require('./isLength'),
|
||||
isString = require('./isString');
|
||||
isString = require('./isString'),
|
||||
toKey = require('./_toKey');
|
||||
|
||||
/**
|
||||
* Checks if `path` exists on `object`.
|
||||
@@ -16,14 +17,14 @@ var baseCastPath = require('./_baseCastPath'),
|
||||
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
||||
*/
|
||||
function hasPath(object, path, hasFunc) {
|
||||
path = isKey(path, object) ? [path] : baseCastPath(path);
|
||||
path = isKey(path, object) ? [path] : castPath(path);
|
||||
|
||||
var result,
|
||||
index = -1,
|
||||
length = path.length;
|
||||
|
||||
while (++index < length) {
|
||||
var key = path[index];
|
||||
var key = toKey(path[index]);
|
||||
if (!(result = object != null && hasFunc(object, key))) {
|
||||
break;
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -13,9 +13,10 @@ var reIsUint = /^(?:0|[1-9]\d*)$/;
|
||||
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
||||
*/
|
||||
function isIndex(value, length) {
|
||||
value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
|
||||
length = length == null ? MAX_SAFE_INTEGER : length;
|
||||
return value > -1 && value % 1 == 0 && value < length;
|
||||
return !!length &&
|
||||
(typeof value == 'number' || reIsUint.test(value)) &&
|
||||
(value > -1 && value % 1 == 0 && value < length);
|
||||
}
|
||||
|
||||
module.exports = isIndex;
|
||||
|
||||
11
_isKey.js
11
_isKey.js
@@ -14,13 +14,16 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
||||
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
||||
*/
|
||||
function isKey(value, object) {
|
||||
if (isArray(value)) {
|
||||
return false;
|
||||
}
|
||||
var type = typeof value;
|
||||
if (type == 'number' || type == 'symbol') {
|
||||
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
||||
value == null || isSymbol(value)) {
|
||||
return true;
|
||||
}
|
||||
return !isArray(value) &&
|
||||
(isSymbol(value) || reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
||||
(object != null && value in Object(object)));
|
||||
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
||||
(object != null && value in Object(object));
|
||||
}
|
||||
|
||||
module.exports = isKey;
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
*/
|
||||
function isKeyable(value) {
|
||||
var type = typeof value;
|
||||
return type == 'number' || type == 'boolean' ||
|
||||
(type == 'string' && value != '__proto__') || value == null;
|
||||
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
||||
? (value !== '__proto__')
|
||||
: (value === null);
|
||||
}
|
||||
|
||||
module.exports = isKeyable;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
var composeArgs = require('./_composeArgs'),
|
||||
composeArgsRight = require('./_composeArgsRight'),
|
||||
copyArray = require('./_copyArray'),
|
||||
replaceHolders = require('./_replaceHolders');
|
||||
|
||||
/** Used as the internal argument placeholder. */
|
||||
@@ -58,20 +57,20 @@ function mergeData(data, source) {
|
||||
var value = source[3];
|
||||
if (value) {
|
||||
var partials = data[3];
|
||||
data[3] = partials ? composeArgs(partials, value, source[4]) : copyArray(value);
|
||||
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : copyArray(source[4]);
|
||||
data[3] = partials ? composeArgs(partials, value, source[4]) : value;
|
||||
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
|
||||
}
|
||||
// Compose partial right arguments.
|
||||
value = source[5];
|
||||
if (value) {
|
||||
partials = data[5];
|
||||
data[5] = partials ? composeArgsRight(partials, value, source[6]) : copyArray(value);
|
||||
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : copyArray(source[6]);
|
||||
data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
|
||||
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
|
||||
}
|
||||
// Use source `argPos` if available.
|
||||
value = source[7];
|
||||
if (value) {
|
||||
data[7] = copyArray(value);
|
||||
data[7] = value;
|
||||
}
|
||||
// Use source `ary` if it's smaller.
|
||||
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. */
|
||||
var rsAstralRange = '\\ud800-\\udfff',
|
||||
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
||||
@@ -24,9 +26,6 @@ var reOptMod = rsModifier + '?',
|
||||
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
|
||||
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`.
|
||||
*
|
||||
|
||||
21
_toKey.js
Normal file
21
_toKey.js
Normal file
@@ -0,0 +1,21 @@
|
||||
var isSymbol = require('./isSymbol');
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
var INFINITY = 1 / 0;
|
||||
|
||||
/**
|
||||
* Converts `value` to a string key if it's not a string or symbol.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to inspect.
|
||||
* @returns {string|symbol} Returns the key.
|
||||
*/
|
||||
function toKey(value) {
|
||||
if (typeof value == 'string' || isSymbol(value)) {
|
||||
return value;
|
||||
}
|
||||
var result = (value + '');
|
||||
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
||||
}
|
||||
|
||||
module.exports = toKey;
|
||||
10
_toSource.js
10
_toSource.js
@@ -1,6 +1,3 @@
|
||||
var isFunction = require('./isFunction'),
|
||||
toString = require('./toString');
|
||||
|
||||
/** Used to resolve the decompiled source of functions. */
|
||||
var funcToString = Function.prototype.toString;
|
||||
|
||||
@@ -12,12 +9,15 @@ var funcToString = Function.prototype.toString;
|
||||
* @returns {string} Returns the source code.
|
||||
*/
|
||||
function toSource(func) {
|
||||
if (isFunction(func)) {
|
||||
if (func != null) {
|
||||
try {
|
||||
return funcToString.call(func);
|
||||
} catch (e) {}
|
||||
try {
|
||||
return (func + '');
|
||||
} catch (e) {}
|
||||
}
|
||||
return toString(func);
|
||||
return '';
|
||||
}
|
||||
|
||||
module.exports = toSource;
|
||||
|
||||
1
array.js
1
array.js
@@ -25,6 +25,7 @@ module.exports = {
|
||||
'join': require('./join'),
|
||||
'last': require('./last'),
|
||||
'lastIndexOf': require('./lastIndexOf'),
|
||||
'nth': require('./nth'),
|
||||
'pull': require('./pull'),
|
||||
'pullAll': require('./pullAll'),
|
||||
'pullAllBy': require('./pullAllBy'),
|
||||
|
||||
@@ -32,6 +32,7 @@ var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
|
||||
* @param {Object} object The destination object.
|
||||
* @param {...Object} [sources] The source objects.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.assignIn
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
|
||||
@@ -28,6 +28,7 @@ var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
|
||||
* @param {Object} object The destination object.
|
||||
* @param {...Object} [sources] The source objects.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.assign
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
var copyObjectWith = require('./_copyObjectWith'),
|
||||
var copyObject = require('./_copyObject'),
|
||||
createAssigner = require('./_createAssigner'),
|
||||
keysIn = require('./keysIn');
|
||||
|
||||
/**
|
||||
* This method is like `_.assignIn` except that it accepts `customizer`
|
||||
* 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).
|
||||
*
|
||||
* **Note:** This method mutates `object`.
|
||||
@@ -19,6 +19,7 @@ var copyObjectWith = require('./_copyObjectWith'),
|
||||
* @param {...Object} sources The source objects.
|
||||
* @param {Function} [customizer] The function to customize assigned values.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.assignWith
|
||||
* @example
|
||||
*
|
||||
* function customizer(objValue, srcValue) {
|
||||
@@ -31,7 +32,7 @@ var copyObjectWith = require('./_copyObjectWith'),
|
||||
* // => { 'a': 1, 'b': 2 }
|
||||
*/
|
||||
var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
|
||||
copyObjectWith(source, keysIn(source), object, customizer);
|
||||
copyObject(source, keysIn(source), object, customizer);
|
||||
});
|
||||
|
||||
module.exports = assignInWith;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
var copyObjectWith = require('./_copyObjectWith'),
|
||||
var copyObject = require('./_copyObject'),
|
||||
createAssigner = require('./_createAssigner'),
|
||||
keys = require('./keys');
|
||||
|
||||
/**
|
||||
* This method is like `_.assign` except that it accepts `customizer`
|
||||
* 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).
|
||||
*
|
||||
* **Note:** This method mutates `object`.
|
||||
@@ -18,6 +18,7 @@ var copyObjectWith = require('./_copyObjectWith'),
|
||||
* @param {...Object} sources The source objects.
|
||||
* @param {Function} [customizer] The function to customize assigned values.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.assignInWith
|
||||
* @example
|
||||
*
|
||||
* function customizer(objValue, srcValue) {
|
||||
@@ -30,7 +31,7 @@ var copyObjectWith = require('./_copyObjectWith'),
|
||||
* // => { 'a': 1, 'b': 2 }
|
||||
*/
|
||||
var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
|
||||
copyObjectWith(source, keys(source), object, customizer);
|
||||
copyObject(source, keys(source), object, customizer);
|
||||
});
|
||||
|
||||
module.exports = assignWith;
|
||||
|
||||
3
at.js
3
at.js
@@ -10,8 +10,7 @@ var baseAt = require('./_baseAt'),
|
||||
* @since 1.0.0
|
||||
* @category Object
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {...(string|string[])} [paths] The property paths of elements to pick,
|
||||
* specified individually or in arrays.
|
||||
* @param {...(string|string[])} [paths] The property paths of elements to pick.
|
||||
* @returns {Array} Returns the new array of picked elements.
|
||||
* @example
|
||||
*
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
var arrayEach = require('./_arrayEach'),
|
||||
baseFlatten = require('./_baseFlatten'),
|
||||
bind = require('./bind'),
|
||||
rest = require('./rest');
|
||||
rest = require('./rest'),
|
||||
toKey = require('./_toKey');
|
||||
|
||||
/**
|
||||
* Binds methods of an object to the object itself, overwriting the existing
|
||||
@@ -14,8 +15,7 @@ var arrayEach = require('./_arrayEach'),
|
||||
* @memberOf _
|
||||
* @category Util
|
||||
* @param {Object} object The object to bind and assign the bound methods to.
|
||||
* @param {...(string|string[])} methodNames The object method names to bind,
|
||||
* specified individually or in arrays.
|
||||
* @param {...(string|string[])} methodNames The object method names to bind.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @example
|
||||
*
|
||||
@@ -32,6 +32,7 @@ var arrayEach = require('./_arrayEach'),
|
||||
*/
|
||||
var bindAll = rest(function(object, methodNames) {
|
||||
arrayEach(baseFlatten(methodNames, 1), function(key) {
|
||||
key = toKey(key);
|
||||
object[key] = bind(object[key], object);
|
||||
});
|
||||
return object;
|
||||
|
||||
1
clone.js
1
clone.js
@@ -17,6 +17,7 @@ var baseClone = require('./_baseClone');
|
||||
* @category Lang
|
||||
* @param {*} value The value to clone.
|
||||
* @returns {*} Returns the cloned value.
|
||||
* @see _.cloneDeep
|
||||
* @example
|
||||
*
|
||||
* var objects = [{ 'a': 1 }, { 'b': 2 }];
|
||||
|
||||
@@ -9,6 +9,7 @@ var baseClone = require('./_baseClone');
|
||||
* @category Lang
|
||||
* @param {*} value The value to recursively clone.
|
||||
* @returns {*} Returns the deep cloned value.
|
||||
* @see _.clone
|
||||
* @example
|
||||
*
|
||||
* var objects = [{ 'a': 1 }, { 'b': 2 }];
|
||||
|
||||
@@ -10,6 +10,7 @@ var baseClone = require('./_baseClone');
|
||||
* @param {*} value The value to recursively clone.
|
||||
* @param {Function} [customizer] The function to customize cloning.
|
||||
* @returns {*} Returns the deep cloned value.
|
||||
* @see _.cloneWith
|
||||
* @example
|
||||
*
|
||||
* function customizer(value) {
|
||||
|
||||
@@ -2,7 +2,7 @@ var baseClone = require('./_baseClone');
|
||||
|
||||
/**
|
||||
* 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
|
||||
* up to four arguments; (value [, index|key, object, stack]).
|
||||
*
|
||||
@@ -13,6 +13,7 @@ var baseClone = require('./_baseClone');
|
||||
* @param {*} value The value to clone.
|
||||
* @param {Function} [customizer] The function to customize cloning.
|
||||
* @returns {*} Returns the cloned value.
|
||||
* @see _.cloneDeepWith
|
||||
* @example
|
||||
*
|
||||
* function customizer(value) {
|
||||
|
||||
2
cond.js
2
cond.js
@@ -7,7 +7,7 @@ var apply = require('./_apply'),
|
||||
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
|
||||
* pairs are invoked with the `this` binding and arguments of the created
|
||||
* function.
|
||||
|
||||
374
core.js
374
core.js
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* lodash 4.8.1 (Custom Build) <https://lodash.com/>
|
||||
* lodash 4.11.2 (Custom Build) <https://lodash.com/>
|
||||
* Build: `lodash core -o ./dist/lodash.core.js`
|
||||
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||
* Released under MIT license <https://lodash.com/license>
|
||||
@@ -13,7 +13,7 @@
|
||||
var undefined;
|
||||
|
||||
/** Used as the semantic version number. */
|
||||
var VERSION = '4.8.1';
|
||||
var VERSION = '4.11.2';
|
||||
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
@@ -130,35 +130,6 @@
|
||||
return array;
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of methods like `_.max` and `_.min` which accepts a
|
||||
* `comparator` to determine the extremum value.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Function} iteratee The iteratee invoked per iteration.
|
||||
* @param {Function} comparator The comparator used to compare values.
|
||||
* @returns {*} Returns the extremum value.
|
||||
*/
|
||||
function baseExtremum(array, iteratee, comparator) {
|
||||
var index = -1,
|
||||
length = array.length;
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index],
|
||||
current = iteratee(value);
|
||||
|
||||
if (current != null && (computed === undefined
|
||||
? current === current
|
||||
: comparator(current, computed)
|
||||
)) {
|
||||
var computed = current,
|
||||
result = value;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of methods like `_.find` and `_.findKey`, without
|
||||
* support for iteratee shorthands, which iterates over `collection` using
|
||||
@@ -251,38 +222,6 @@
|
||||
return (value && value.Object === Object) ? value : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares values to sort them in ascending order.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to compare.
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {number} Returns the sort order indicator for `value`.
|
||||
*/
|
||||
function compareAscending(value, other) {
|
||||
if (value !== other) {
|
||||
var valIsNull = value === null,
|
||||
valIsUndef = value === undefined,
|
||||
valIsReflexive = value === value;
|
||||
|
||||
var othIsNull = other === null,
|
||||
othIsUndef = other === undefined,
|
||||
othIsReflexive = other === other;
|
||||
|
||||
if ((value > other && !othIsNull) || !valIsReflexive ||
|
||||
(valIsNull && !othIsUndef && othIsReflexive) ||
|
||||
(valIsUndef && othIsReflexive)) {
|
||||
return 1;
|
||||
}
|
||||
if ((value < other && !valIsNull) || !othIsReflexive ||
|
||||
(othIsNull && !valIsUndef && valIsReflexive) ||
|
||||
(othIsUndef && valIsReflexive)) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by `_.escape` to convert characters to HTML entities.
|
||||
*
|
||||
@@ -313,20 +252,6 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is a valid array-like index.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
||||
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
||||
*/
|
||||
function isIndex(value, length) {
|
||||
value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
|
||||
length = length == null ? MAX_SAFE_INTEGER : length;
|
||||
return value > -1 && value % 1 == 0 && value < length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `iterator` to an array.
|
||||
*
|
||||
@@ -379,9 +304,6 @@
|
||||
nativeKeys = Object.keys,
|
||||
nativeMax = Math.max;
|
||||
|
||||
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
|
||||
var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
@@ -402,9 +324,9 @@
|
||||
* Shortcut fusion is an optimization to merge iteratee calls; this avoids
|
||||
* the creation of intermediate arrays and can greatly reduce the number of
|
||||
* iteratee executions. Sections of a chain sequence qualify for shortcut
|
||||
* fusion if the section is applied to an array of at least two hundred
|
||||
* elements and any iteratees accept only one argument. The heuristic for
|
||||
* whether a section qualifies for shortcut fusion is subject to change.
|
||||
* fusion if the section is applied to an array of at least `200` elements
|
||||
* and any iteratees accept only one argument. The heuristic for whether a
|
||||
* section qualifies for shortcut fusion is subject to change.
|
||||
*
|
||||
* Chaining is supported in custom builds as long as the `_#value` method is
|
||||
* directly or indirectly included in the build.
|
||||
@@ -464,7 +386,7 @@
|
||||
* `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`,
|
||||
* `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`,
|
||||
* `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`,
|
||||
* `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
|
||||
* `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`,
|
||||
@@ -616,6 +538,35 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of methods like `_.max` and `_.min` which accepts a
|
||||
* `comparator` to determine the extremum value.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Function} iteratee The iteratee invoked per iteration.
|
||||
* @param {Function} comparator The comparator used to compare values.
|
||||
* @returns {*} Returns the extremum value.
|
||||
*/
|
||||
function baseExtremum(array, iteratee, comparator) {
|
||||
var index = -1,
|
||||
length = array.length;
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index],
|
||||
current = iteratee(value);
|
||||
|
||||
if (current != null && (computed === undefined
|
||||
? (current === current && !false)
|
||||
: comparator(current, computed)
|
||||
)) {
|
||||
var computed = current,
|
||||
result = value;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `_.filter` without support for iteratee shorthands.
|
||||
*
|
||||
@@ -640,23 +591,24 @@
|
||||
* @private
|
||||
* @param {Array} array The array to flatten.
|
||||
* @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.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
*/
|
||||
function baseFlatten(array, depth, isStrict, result) {
|
||||
result || (result = []);
|
||||
|
||||
function baseFlatten(array, depth, predicate, isStrict, result) {
|
||||
var index = -1,
|
||||
length = array.length;
|
||||
|
||||
predicate || (predicate = isFlattenable);
|
||||
result || (result = []);
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
if (depth > 0 && isArrayLikeObject(value) &&
|
||||
(isStrict || isArray(value) || isArguments(value))) {
|
||||
if (depth > 0 && predicate(value)) {
|
||||
if (depth > 1) {
|
||||
// Recursively flatten arrays (susceptible to call stack limits).
|
||||
baseFlatten(value, depth - 1, isStrict, result);
|
||||
baseFlatten(value, depth - 1, predicate, isStrict, result);
|
||||
} else {
|
||||
arrayPush(result, value);
|
||||
}
|
||||
@@ -669,7 +621,7 @@
|
||||
|
||||
/**
|
||||
* 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`.
|
||||
*
|
||||
* @private
|
||||
@@ -707,6 +659,19 @@
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `_.gt` which doesn't coerce arguments to numbers.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to compare.
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {boolean} Returns `true` if `value` is greater than `other`,
|
||||
* else `false`.
|
||||
*/
|
||||
function baseGt(value, other) {
|
||||
return value > other;
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `_.isEqual` which supports partial comparisons
|
||||
* and tracks traversed objects.
|
||||
@@ -855,6 +820,19 @@
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `_.lt` which doesn't coerce arguments to numbers.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to compare.
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {boolean} Returns `true` if `value` is less than `other`,
|
||||
* else `false`.
|
||||
*/
|
||||
function baseLt(value, other) {
|
||||
return value < other;
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `_.map` without support for iteratee shorthands.
|
||||
*
|
||||
@@ -1011,19 +989,45 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies properties of `source` to `object`.
|
||||
* Compares values to sort them in ascending order.
|
||||
*
|
||||
* @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.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @param {*} value The value to compare.
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {number} Returns the sort order indicator for `value`.
|
||||
*/
|
||||
var copyObject = copyObjectWith;
|
||||
function compareAscending(value, other) {
|
||||
if (value !== other) {
|
||||
var valIsDefined = value !== undefined,
|
||||
valIsNull = value === null,
|
||||
valIsReflexive = value === value,
|
||||
valIsSymbol = false;
|
||||
|
||||
var othIsDefined = other !== undefined,
|
||||
othIsNull = other === null,
|
||||
othIsReflexive = other === other,
|
||||
othIsSymbol = false;
|
||||
|
||||
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
|
||||
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
|
||||
(valIsNull && othIsDefined && othIsReflexive) ||
|
||||
(!valIsDefined && othIsReflexive) ||
|
||||
!valIsReflexive) {
|
||||
return 1;
|
||||
}
|
||||
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
|
||||
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
|
||||
(othIsNull && valIsDefined && valIsReflexive) ||
|
||||
(!othIsDefined && valIsReflexive) ||
|
||||
!othIsReflexive) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is like `copyObject` except that it accepts a function to
|
||||
* customize copied values.
|
||||
* Copies properties of `source` to `object`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} source The object to copy properties from.
|
||||
@@ -1032,7 +1036,7 @@
|
||||
* @param {Function} [customizer] The function to customize copied values.
|
||||
* @returns {Object} Returns `object`.
|
||||
*/
|
||||
function copyObjectWith(source, props, object, customizer) {
|
||||
function copyObject(source, props, object, customizer) {
|
||||
object || (object = {});
|
||||
|
||||
var index = -1,
|
||||
@@ -1393,6 +1397,32 @@
|
||||
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 a valid array-like index.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
||||
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
||||
*/
|
||||
function isIndex(value, length) {
|
||||
length = length == null ? MAX_SAFE_INTEGER : length;
|
||||
return !!length &&
|
||||
(typeof value == 'number' || reIsUint.test(value)) &&
|
||||
(value > -1 && value % 1 == 0 && value < length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is likely a prototype object.
|
||||
*
|
||||
@@ -1407,6 +1437,15 @@
|
||||
return value === proto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `value` to a string key if it's not a string or symbol.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to inspect.
|
||||
* @returns {string|symbol} Returns the key.
|
||||
*/
|
||||
var toKey = String;
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
@@ -1521,14 +1560,14 @@
|
||||
* // => undefined
|
||||
*/
|
||||
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`
|
||||
* 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
|
||||
* from the end of `array`.
|
||||
* for equality comparisons. If `fromIndex` is negative, it's used as the
|
||||
* offset from the end of `array`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -1806,6 +1845,7 @@
|
||||
* @param {Array|Function|Object|string} [predicate=_.identity]
|
||||
* The function invoked per iteration.
|
||||
* @returns {Array} Returns the new filtered array.
|
||||
* @see _.reject
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
@@ -1873,7 +1913,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).
|
||||
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
||||
*
|
||||
@@ -1889,6 +1929,7 @@
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
||||
* @returns {Array|Object} Returns `collection`.
|
||||
* @see _.forEachRight
|
||||
* @example
|
||||
*
|
||||
* _([1, 2]).forEach(function(value) {
|
||||
@@ -1916,8 +1957,8 @@
|
||||
* The guarded methods are:
|
||||
* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
|
||||
* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
|
||||
* `sampleSize`, `slice`, `some`, `sortBy`, `take`, `takeRight`, `template`,
|
||||
* `trim`, `trimEnd`, `trimStart`, and `words`
|
||||
* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
|
||||
* `template`, `trim`, `trimEnd`, `trimStart`, and `words`
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -1956,7 +1997,7 @@
|
||||
* Reduces `collection` to a value which is the accumulated result of running
|
||||
* each element in `collection` thru `iteratee`, where each successive
|
||||
* 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:
|
||||
* (accumulator, value, index|key, collection).
|
||||
*
|
||||
@@ -1975,6 +2016,7 @@
|
||||
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
||||
* @param {*} [accumulator] The initial value.
|
||||
* @returns {*} Returns the accumulated value.
|
||||
* @see _.reduceRight
|
||||
* @example
|
||||
*
|
||||
* _.reduce([1, 2], function(sum, n) {
|
||||
@@ -2075,8 +2117,7 @@
|
||||
* @category Collection
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])}
|
||||
* [iteratees=[_.identity]] The iteratees to sort by, specified individually
|
||||
* or in arrays.
|
||||
* [iteratees=[_.identity]] The iteratees to sort by.
|
||||
* @returns {Array} Returns the new sorted array.
|
||||
* @example
|
||||
*
|
||||
@@ -2389,6 +2430,7 @@
|
||||
* @category Lang
|
||||
* @param {*} value The value to clone.
|
||||
* @returns {*} Returns the cloned value.
|
||||
* @see _.cloneDeep
|
||||
* @example
|
||||
*
|
||||
* var objects = [{ 'a': 1 }, { 'b': 2 }];
|
||||
@@ -2440,32 +2482,6 @@
|
||||
return value === other || (value !== value && other !== other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is greater than `other`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 3.9.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to compare.
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {boolean} Returns `true` if `value` is greater than `other`,
|
||||
* else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.gt(3, 1);
|
||||
* // => true
|
||||
*
|
||||
* _.gt(3, 3);
|
||||
* // => false
|
||||
*
|
||||
* _.gt(1, 3);
|
||||
* // => false
|
||||
*/
|
||||
function gt(value, other) {
|
||||
return value > other;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is likely an `arguments` object.
|
||||
*
|
||||
@@ -2659,12 +2675,7 @@
|
||||
isFunction(value.splice) || isArguments(value))) {
|
||||
return !value.length;
|
||||
}
|
||||
for (var key in value) {
|
||||
if (hasOwnProperty.call(value, key)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return !(nonEnumShadows && keys(value).length);
|
||||
return !keys(value).length;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3001,32 +3012,6 @@
|
||||
return value === undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if `value` is less than `other`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 3.9.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to compare.
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {boolean} Returns `true` if `value` is less than `other`,
|
||||
* else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.lt(1, 3);
|
||||
* // => true
|
||||
*
|
||||
* _.lt(3, 3);
|
||||
* // => false
|
||||
*
|
||||
* _.lt(3, 1);
|
||||
* // => false
|
||||
*/
|
||||
function lt(value, other) {
|
||||
return value < other;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `value` to an array.
|
||||
*
|
||||
@@ -3111,8 +3096,8 @@
|
||||
var toNumber = Number;
|
||||
|
||||
/**
|
||||
* Converts `value` to a string if it's not one. An empty string is returned
|
||||
* for `null` and `undefined` values. The sign of `-0` is preserved.
|
||||
* Converts `value` to a string. An empty string is returned for `null`
|
||||
* and `undefined` values. The sign of `-0` is preserved.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -3155,6 +3140,7 @@
|
||||
* @param {Object} object The destination object.
|
||||
* @param {...Object} [sources] The source objects.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.assignIn
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
@@ -3189,6 +3175,7 @@
|
||||
* @param {Object} object The destination object.
|
||||
* @param {...Object} [sources] The source objects.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.assign
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
@@ -3212,7 +3199,7 @@
|
||||
/**
|
||||
* This method is like `_.assignIn` except that it accepts `customizer`
|
||||
* 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).
|
||||
*
|
||||
* **Note:** This method mutates `object`.
|
||||
@@ -3226,6 +3213,7 @@
|
||||
* @param {...Object} sources The source objects.
|
||||
* @param {Function} [customizer] The function to customize assigned values.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.assignWith
|
||||
* @example
|
||||
*
|
||||
* function customizer(objValue, srcValue) {
|
||||
@@ -3238,12 +3226,12 @@
|
||||
* // => { 'a': 1, 'b': 2 }
|
||||
*/
|
||||
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
|
||||
* `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.
|
||||
*
|
||||
* @static
|
||||
@@ -3295,6 +3283,7 @@
|
||||
* @param {Object} object The destination object.
|
||||
* @param {...Object} [sources] The source objects.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.defaultsDeep
|
||||
* @example
|
||||
*
|
||||
* _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
|
||||
@@ -3317,16 +3306,16 @@
|
||||
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'a': { 'b': { 'c': 3 } } };
|
||||
* var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
|
||||
* var object = { 'a': { 'b': 2 } };
|
||||
* var other = _.create({ 'a': _.create({ 'b': 2 }) });
|
||||
*
|
||||
* _.has(object, 'a');
|
||||
* // => true
|
||||
*
|
||||
* _.has(object, 'a.b.c');
|
||||
* _.has(object, 'a.b');
|
||||
* // => true
|
||||
*
|
||||
* _.has(object, ['a', 'b', 'c']);
|
||||
* _.has(object, ['a', 'b']);
|
||||
* // => true
|
||||
*
|
||||
* _.has(other, 'a');
|
||||
@@ -3435,8 +3424,7 @@
|
||||
* @memberOf _
|
||||
* @category Object
|
||||
* @param {Object} object The source object.
|
||||
* @param {...(string|string[])} [props] The property identifiers to pick,
|
||||
* specified individually or in arrays.
|
||||
* @param {...(string|string[])} [props] The property identifiers to pick.
|
||||
* @returns {Object} Returns the new object.
|
||||
* @example
|
||||
*
|
||||
@@ -3446,7 +3434,7 @@
|
||||
* // => { 'a': 1, 'c': 3 }
|
||||
*/
|
||||
var pick = rest(function(object, props) {
|
||||
return object == null ? {} : basePick(object, baseFlatten(props, 1));
|
||||
return object == null ? {} : basePick(object, baseMap(baseFlatten(props, 1), toKey));
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -3583,8 +3571,8 @@
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `func` with the arguments of the created
|
||||
* 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
|
||||
* 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
|
||||
* created function returns `true` for elements that contain the equivalent
|
||||
* source properties, otherwise it returns `false`.
|
||||
*
|
||||
@@ -3655,7 +3643,7 @@
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* **Note:** Use `_.runInContext` to create a pristine `lodash` function to
|
||||
@@ -3700,7 +3688,7 @@
|
||||
object = this;
|
||||
methodNames = baseFunctions(source, keys(source));
|
||||
}
|
||||
var chain = (isObject(options) && 'chain' in options) ? options.chain : true,
|
||||
var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
|
||||
isFunc = isFunction(object);
|
||||
|
||||
baseEach(methodNames, function(methodName) {
|
||||
@@ -3765,7 +3753,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
|
||||
* @since 0.1.0
|
||||
@@ -3789,7 +3777,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.
|
||||
*
|
||||
* @static
|
||||
@@ -3808,12 +3796,12 @@
|
||||
*/
|
||||
function max(array) {
|
||||
return (array && array.length)
|
||||
? baseExtremum(array, identity, gt)
|
||||
? baseExtremum(array, identity, baseGt)
|
||||
: undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @static
|
||||
@@ -3832,7 +3820,7 @@
|
||||
*/
|
||||
function min(array) {
|
||||
return (array && array.length)
|
||||
? baseExtremum(array, identity, lt)
|
||||
? baseExtremum(array, identity, baseLt)
|
||||
: undefined;
|
||||
}
|
||||
|
||||
@@ -3959,9 +3947,11 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// Expose lodash on the free variable `window` or `self` when available. This
|
||||
// prevents errors in cases where lodash is loaded by a script tag in the presence
|
||||
// of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch for more details.
|
||||
// Expose Lodash on the free variable `window` or `self` when available so it's
|
||||
// globally accessible, even when bundled with Browserify, Webpack, etc. This
|
||||
// also prevents errors in cases where Lodash is loaded by a script tag in the
|
||||
// presence of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch
|
||||
// for more details. Use `_.noConflict` to remove Lodash from the global object.
|
||||
(freeWindow || freeSelf || {})._ = lodash;
|
||||
|
||||
// Some AMD build optimizers like r.js check for condition patterns like the following:
|
||||
|
||||
52
core.min.js
vendored
52
core.min.js
vendored
@@ -1,30 +1,30 @@
|
||||
/**
|
||||
* @license
|
||||
* lodash 4.8.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
||||
* lodash 4.11.2 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
||||
* 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{
|
||||
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(){
|
||||
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);
|
||||
}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),
|
||||
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){
|
||||
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={});
|
||||
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(;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]":
|
||||
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)),
|
||||
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(){
|
||||
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));
|
||||
}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){
|
||||
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;
|
||||
}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={
|
||||
"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},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({
|
||||
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);
|
||||
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 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 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;
|
||||
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);
|
||||
},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.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.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.8.1",zn("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(){
|
||||
return a}):bn&&_n?(jn&&((_n.exports=a)._=a),bn._=a):wn._=a}).call(this);
|
||||
;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n,t,r){var e;return r(n,function(n,r,u){return t(n,r,u)?(e=n,false):void 0}),e}function r(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function e(n,t){return O(t,function(t){return n[t]})}function u(n){return n&&n.Object===Object?n:null}function o(n){return gn[n]}function i(n){var t=false;if(null!=n&&typeof n.toString!="function")try{t=!!(n+"")}catch(r){}return t}function c(n){return n instanceof f?n:new f(n)}function f(n,t){
|
||||
this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function a(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 l(n){return nn(n)?Bn(n):{}}function p(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(pn,r)},t)}function s(n,t){var r=true;return zn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function h(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 v(n,t){var r=[];return zn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function y(t,r,e,u,o){var i=-1,c=t.length;for(e||(e=G),o||(o=[]);++i<c;){var f=t[i];r>0&&e(f)?r>1?y(f,r-1,e,u,o):n(o,f):u||(o[o.length]=f)}return o}function g(n,t){return n&&Cn(n,t,on)}function b(n,t){return v(t,function(t){return Y(n[t])})}function _(n,t){return n>t}function d(n,t,r,e,u){return n===t?true:null==n||null==t||!nn(n)&&!tn(t)?n!==n&&t!==t:j(n,t,d,r,e,u)}function j(n,t,r,e,u,o){var c=Vn(n),f=Vn(t),a="[object Array]",l="[object Array]";
|
||||
c||(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&&!i(n),f="[object Object]"==l&&!i(t),l=a==l;o||(o=[]);var s=U(o,function(t){return t[0]===n});return s&&s[1]?s[1]==t:(o.push([n,t]),l&&!p?(r=c||isTypedArray(n)?$(n,t,r,e,u,o):q(n,t,a),o.pop(),r):2&u||(c=p&&kn.call(n,"__wrapped__"),a=f&&kn.call(t,"__wrapped__"),!c&&!a)?l?(r=z(n,t,r,e,u,o),o.pop(),r):false:(c=c?n.value():n,t=a?t.value():t,r=r(c,t,e,u,o),
|
||||
o.pop(),r))}function m(n){return typeof n=="function"?n:null==n?an:(typeof n=="object"?A:k)(n)}function w(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function x(n,t){return t>n}function O(n,t){var r=-1,e=X(n)?Array(n.length):[];return zn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function A(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&&d(n[u],r[u],pn,3)))return false}return true}}function E(n,t){return n=Object(n),H(t,function(t,r){
|
||||
return r in n&&(t[r]=n[r]),t},{})}function k(n){return function(t){return null==t?pn:t[n]}}function N(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 S(n){return N(n,0,n.length)}function T(n,t){var r;return zn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function F(t,r){return H(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args))},t)}function R(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];kn.call(f,i)&&(a===c||a!==a&&c!==c)&&(c!==pn||i in f)||(f[i]=c)}return r}function B(n){return L(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 D(n){return function(){var t=arguments,r=l(n.prototype),t=n.apply(r,t);return nn(t)?t:r}}function I(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==On&&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=D(n);return e}function $(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(!T(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 q(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 z(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 C(n){var t=n?n.length:pn;if(Z(t)&&(Vn(n)||en(n)||W(n))){n=String;for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);t=e}else t=null;return t}function G(n){return tn(n)&&X(n)&&(Vn(n)||W(n))}function J(n,t){return t=null==t?9007199254740991:t,!!t&&(typeof n=="number"||yn.test(n))&&n>-1&&0==n%1&&t>n}function M(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||En)}function P(n){return n&&n.length?n[0]:pn}function U(n,r){return t(n,m(r),zn)}function V(n,t){return zn(n,m(t))}function H(n,t,e){
|
||||
return r(n,m(t),e,3>arguments.length,zn)}function K(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=pn),r}}function L(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 Q(){
|
||||
if(!arguments.length)return[];var n=arguments[0];return Vn(n)?n:[n]}function W(n){return tn(n)&&X(n)&&kn.call(n,"callee")&&(!Dn.call(n,"callee")||"[object Arguments]"==Sn.call(n))}function X(n){return null!=n&&Z(Gn(n))&&!Y(n)}function Y(n){return n=nn(n)?Sn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function Z(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function nn(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function tn(n){return!!n&&typeof n=="object";
|
||||
}function rn(n){return typeof n=="number"||tn(n)&&"[object Number]"==Sn.call(n)}function en(n){return typeof n=="string"||!Vn(n)&&tn(n)&&"[object String]"==Sn.call(n)}function un(n){return typeof n=="string"?n:null==n?"":n+""}function on(n){var t=M(n);if(!t&&!X(n))return $n(Object(n));var r,e=C(n),u=!!e,e=e||[],o=e.length;for(r in n)!kn.call(n,r)||u&&("length"==r||J(r,o))||t&&"constructor"==r||e.push(r);return e}function cn(n){for(var t=-1,r=M(n),e=w(n),u=e.length,o=C(n),i=!!o,o=o||[],c=o.length;++t<u;){
|
||||
var f=e[t];i&&("length"==f||J(f,c))||"constructor"==f&&(r||!kn.call(n,f))||o.push(f)}return o}function fn(n){return n?e(n,on(n)):[]}function an(n){return n}function ln(t,r,e){var u=on(r),o=b(r,u);null!=e||nn(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=b(r,on(r)));var i=!(nn(e)&&"chain"in e&&!e.chain),c=Y(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__=S(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={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},bn={"function":true,object:true},_n=bn[typeof exports]&&exports&&!exports.nodeType?exports:pn,dn=bn[typeof module]&&module&&!module.nodeType?module:pn,jn=dn&&dn.exports===_n?_n:pn,mn=u(bn[typeof self]&&self),wn=u(bn[typeof window]&&window),xn=u(bn[typeof this]&&this),On=u(_n&&dn&&typeof global=="object"&&global)||wn!==(xn&&xn.window)&&wn||mn||xn||Function("return this")(),An=Array.prototype,En=Object.prototype,kn=En.hasOwnProperty,Nn=0,Sn=En.toString,Tn=On._,Fn=On.Reflect,Rn=Fn?Fn.a:pn,Bn=Object.create,Dn=En.propertyIsEnumerable,In=On.isFinite,$n=Object.keys,qn=Math.max;
|
||||
f.prototype=l(c.prototype),f.prototype.constructor=f;var zn=function(n,t){return function(r,e){if(null==r)return r;if(!X(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}}(g),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}}();Rn&&!Dn.call({valueOf:1},"valueOf")&&(w=function(n){n=Rn(n);for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r});var Gn=k("length"),Jn=String,Mn=L(function(n,t,r){
|
||||
return I(n,t,r)}),Pn=L(function(n,t){return p(n,1,t)}),Un=L(function(n,t,r){return p(n,Kn(t)||0,r)}),Vn=Array.isArray,Hn=Number,Kn=Number,Ln=B(function(n,t){R(t,on(t),n)}),Qn=B(function(n,t){R(t,cn(t),n)}),Wn=B(function(n,t,r,e){R(t,cn(t),n,e)}),Xn=L(function(n){return n.push(pn,a),Wn.apply(pn,n)}),Yn=L(function(n,t){return null==n?{}:E(n,O(y(t,1),Jn))}),Zn=m;c.assignIn=Qn,c.before=K,c.bind=Mn,c.chain=function(n){return n=c(n),n.__chain__=true,n},c.compact=function(n){return v(n,Boolean)},c.concat=function(){
|
||||
var t=arguments.length,r=Q(arguments[0]);if(2>t)return t?S(r):[];for(var e=Array(t-1);t--;)e[t-1]=arguments[t];return y(e,1),n(S(r),fn)},c.create=function(n,t){var r=l(n);return t?Ln(r,t):r},c.defaults=Xn,c.defer=Pn,c.delay=Un,c.filter=function(n,t){return v(n,m(t))},c.flatten=function(n){return n&&n.length?y(n,1):[]},c.flattenDeep=function(n){return n&&n.length?y(n,sn):[]},c.iteratee=Zn,c.keys=on,c.map=function(n,t){return O(n,m(t))},c.matches=function(n){return A(Ln({},n))},c.mixin=ln,c.negate=function(n){
|
||||
if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},c.once=function(n){return K(2,n)},c.pick=Yn,c.slice=function(n,t,r){var e=n?n.length:0;return r=r===pn?e:+r,e?N(n,null==t?0:+t,r):[]},c.sortBy=function(n,t){var r=0;return t=m(t),O(O(n,function(n,e,u){return{value:n,index:r++,criteria:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==pn,o=null===r,i=r===r,c=e!==pn,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){
|
||||
r=1;break n}if(!o&&e>r||f&&u&&i||!c&&i||!a){r=-1;break n}}r=0}return r||n.index-t.index}),k("value"))},c.tap=function(n,t){return t(n),n},c.thru=function(n,t){return t(n)},c.toArray=function(n){return X(n)?n.length?S(n):[]:fn(n)},c.values=fn,c.extend=Qn,ln(c,c),c.clone=function(n){return nn(n)?Vn(n)?S(n):R(n,on(n)):n},c.escape=function(n){return(n=un(n))&&vn.test(n)?n.replace(hn,o):n},c.every=function(n,t,r){return t=r?pn:t,s(n,m(t))},c.find=U,c.forEach=V,c.has=function(n,t){return null!=n&&kn.call(n,t);
|
||||
},c.head=P,c.identity=an,c.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},c.isArguments=W,c.isArray=Vn,c.isBoolean=function(n){return true===n||false===n||tn(n)&&"[object Boolean]"==Sn.call(n)},c.isDate=function(n){return tn(n)&&"[object Date]"==Sn.call(n)},c.isEmpty=function(n){return X(n)&&(Vn(n)||en(n)||Y(n.splice)||W(n))?!n.length:!on(n).length},c.isEqual=function(n,t){return d(n,t)},
|
||||
c.isFinite=function(n){return typeof n=="number"&&In(n)},c.isFunction=Y,c.isNaN=function(n){return rn(n)&&n!=+n},c.isNull=function(n){return null===n},c.isNumber=rn,c.isObject=nn,c.isRegExp=function(n){return nn(n)&&"[object RegExp]"==Sn.call(n)},c.isString=en,c.isUndefined=function(n){return n===pn},c.last=function(n){var t=n?n.length:0;return t?n[t-1]:pn},c.max=function(n){return n&&n.length?h(n,an,_):pn},c.min=function(n){return n&&n.length?h(n,an,x):pn},c.noConflict=function(){return On._===this&&(On._=Tn),
|
||||
this},c.noop=function(){},c.reduce=H,c.result=function(n,t,r){return t=null==n?pn:n[t],t===pn&&(t=r),Y(t)?t.call(n):t},c.size=function(n){return null==n?0:(n=X(n)?n:on(n),n.length)},c.some=function(n,t,r){return t=r?pn:t,T(n,m(t))},c.uniqueId=function(n){var t=++Nn;return un(n)+t},c.each=V,c.first=P,ln(c,function(){var n={};return g(c,function(t,r){kn.call(c.prototype,r)||(n[r]=t)}),n}(),{chain:false}),c.VERSION="4.11.2",zn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){
|
||||
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);c.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)})}}),c.prototype.toJSON=c.prototype.valueOf=c.prototype.value=function(){return F(this.__wrapped__,this.__actions__)},(wn||mn||{})._=c,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){
|
||||
return c}):_n&&dn?(jn&&((dn.exports=c)._=c),_n._=c):On._=c}).call(this);
|
||||
@@ -3,7 +3,7 @@ var baseAssign = require('./_baseAssign'),
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @static
|
||||
|
||||
23
debounce.js
23
debounce.js
@@ -23,7 +23,7 @@ var nativeMax = Math.max,
|
||||
* on the trailing edge of the timeout only if the debounced function is
|
||||
* 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`.
|
||||
*
|
||||
* @static
|
||||
@@ -62,12 +62,13 @@ var nativeMax = Math.max,
|
||||
function debounce(func, wait, options) {
|
||||
var lastArgs,
|
||||
lastThis,
|
||||
maxWait,
|
||||
result,
|
||||
timerId,
|
||||
lastCallTime = 0,
|
||||
lastInvokeTime = 0,
|
||||
leading = false,
|
||||
maxWait = false,
|
||||
maxing = false,
|
||||
trailing = true;
|
||||
|
||||
if (typeof func != 'function') {
|
||||
@@ -76,7 +77,8 @@ function debounce(func, wait, options) {
|
||||
wait = toNumber(wait) || 0;
|
||||
if (isObject(options)) {
|
||||
leading = !!options.leading;
|
||||
maxWait = 'maxWait' in options && nativeMax(toNumber(options.maxWait) || 0, wait);
|
||||
maxing = 'maxWait' in options;
|
||||
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
||||
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
||||
}
|
||||
|
||||
@@ -104,7 +106,7 @@ function debounce(func, wait, options) {
|
||||
timeSinceLastInvoke = time - lastInvokeTime,
|
||||
result = wait - timeSinceLastCall;
|
||||
|
||||
return maxWait === false ? result : nativeMin(result, maxWait - timeSinceLastInvoke);
|
||||
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
|
||||
}
|
||||
|
||||
function shouldInvoke(time) {
|
||||
@@ -115,7 +117,7 @@ function debounce(func, wait, options) {
|
||||
// trailing edge, the system time has gone backwards and we're treating
|
||||
// it as the trailing edge, or we've hit the `maxWait` limit.
|
||||
return (!lastCallTime || (timeSinceLastCall >= wait) ||
|
||||
(timeSinceLastCall < 0) || (maxWait !== false && timeSinceLastInvoke >= maxWait));
|
||||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
||||
}
|
||||
|
||||
function timerExpired() {
|
||||
@@ -164,10 +166,15 @@ function debounce(func, wait, options) {
|
||||
if (timerId === undefined) {
|
||||
return leadingEdge(lastCallTime);
|
||||
}
|
||||
// Handle invocations in a tight loop.
|
||||
clearTimeout(timerId);
|
||||
if (maxing) {
|
||||
// Handle invocations in a tight loop.
|
||||
clearTimeout(timerId);
|
||||
timerId = setTimeout(timerExpired, wait);
|
||||
return invokeFunc(lastCallTime);
|
||||
}
|
||||
}
|
||||
if (timerId === undefined) {
|
||||
timerId = setTimeout(timerExpired, wait);
|
||||
return invokeFunc(lastCallTime);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ var apply = require('./_apply'),
|
||||
* @param {Object} object The destination object.
|
||||
* @param {...Object} [sources] The source objects.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.defaultsDeep
|
||||
* @example
|
||||
*
|
||||
* _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
|
||||
|
||||
@@ -16,6 +16,7 @@ var apply = require('./_apply'),
|
||||
* @param {Object} object The destination object.
|
||||
* @param {...Object} [sources] The source objects.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.defaults
|
||||
* @example
|
||||
*
|
||||
* _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
|
||||
|
||||
@@ -16,6 +16,7 @@ var baseDifference = require('./_baseDifference'),
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {...Array} [values] The values to exclude.
|
||||
* @returns {Array} Returns the new array of filtered values.
|
||||
* @see _.without, _.xor
|
||||
* @example
|
||||
*
|
||||
* _.difference([3, 2, 1], [4, 2]);
|
||||
@@ -23,7 +24,7 @@ var baseDifference = require('./_baseDifference'),
|
||||
*/
|
||||
var difference = rest(function(array, values) {
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
return isArrayLikeObject(array)
|
||||
? baseDifference(array, baseFlatten(values, 1, true), undefined, comparator)
|
||||
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
|
||||
: [];
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
var baseClamp = require('./_baseClamp'),
|
||||
baseToString = require('./_baseToString'),
|
||||
toInteger = require('./toInteger'),
|
||||
toString = require('./toString');
|
||||
|
||||
@@ -27,7 +28,7 @@ var baseClamp = require('./_baseClamp'),
|
||||
*/
|
||||
function endsWith(string, target, position) {
|
||||
string = toString(string);
|
||||
target = typeof target == 'string' ? target : (target + '');
|
||||
target = baseToString(target);
|
||||
|
||||
var length = string.length;
|
||||
position = position === undefined
|
||||
|
||||
@@ -16,6 +16,7 @@ var arrayFilter = require('./_arrayFilter'),
|
||||
* @param {Array|Function|Object|string} [predicate=_.identity]
|
||||
* The function invoked per iteration.
|
||||
* @returns {Array} Returns the new filtered array.
|
||||
* @see _.reject
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
|
||||
1
flow.js
1
flow.js
@@ -11,6 +11,7 @@ var createFlow = require('./_createFlow');
|
||||
* @category Util
|
||||
* @param {...(Function|Function[])} [funcs] Functions to invoke.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @see _.flowRight
|
||||
* @example
|
||||
*
|
||||
* function square(n) {
|
||||
|
||||
@@ -5,11 +5,12 @@ var createFlow = require('./_createFlow');
|
||||
* invokes the given functions from right to left.
|
||||
*
|
||||
* @static
|
||||
* @since 0.1.0
|
||||
* @since 3.0.0
|
||||
* @memberOf _
|
||||
* @category Util
|
||||
* @param {...(Function|Function[])} [funcs] Functions to invoke.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @see _.flow
|
||||
* @example
|
||||
*
|
||||
* function square(n) {
|
||||
|
||||
@@ -4,7 +4,7 @@ var arrayEach = require('./_arrayEach'),
|
||||
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).
|
||||
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
||||
*
|
||||
@@ -20,6 +20,7 @@ var arrayEach = require('./_arrayEach'),
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
||||
* @returns {Array|Object} Returns `collection`.
|
||||
* @see _.forEachRight
|
||||
* @example
|
||||
*
|
||||
* _([1, 2]).forEach(function(value) {
|
||||
|
||||
@@ -15,6 +15,7 @@ var arrayEachRight = require('./_arrayEachRight'),
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
||||
* @returns {Array|Object} Returns `collection`.
|
||||
* @see _.forEach
|
||||
* @example
|
||||
*
|
||||
* _.forEachRight([1, 2], function(value) {
|
||||
|
||||
7
forIn.js
7
forIn.js
@@ -4,9 +4,9 @@ var baseFor = require('./_baseFor'),
|
||||
|
||||
/**
|
||||
* Iterates over own and inherited enumerable string keyed properties of an
|
||||
* object invoking `iteratee` for each property. The iteratee is invoked with
|
||||
* three arguments: (value, key, object). Iteratee functions may exit iteration
|
||||
* early by explicitly returning `false`.
|
||||
* object and invokes `iteratee` for each property. The iteratee is invoked
|
||||
* with three arguments: (value, key, object). Iteratee functions may exit
|
||||
* iteration early by explicitly returning `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -15,6 +15,7 @@ var baseFor = require('./_baseFor'),
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.forInRight
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
|
||||
@@ -13,6 +13,7 @@ var baseForRight = require('./_baseForRight'),
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.forIn
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
|
||||
@@ -2,10 +2,10 @@ var baseForOwn = require('./_baseForOwn'),
|
||||
baseIteratee = require('./_baseIteratee');
|
||||
|
||||
/**
|
||||
* Iterates over own enumerable string keyed properties of an object invoking
|
||||
* `iteratee` for each property. The iteratee is invoked with three arguments:
|
||||
* (value, key, object). Iteratee functions may exit iteration early by
|
||||
* explicitly returning `false`.
|
||||
* Iterates over own enumerable string keyed properties of an object and
|
||||
* invokes `iteratee` for each property. The iteratee is invoked with three
|
||||
* arguments: (value, key, object). Iteratee functions may exit iteration
|
||||
* early by explicitly returning `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -14,6 +14,7 @@ var baseForOwn = require('./_baseForOwn'),
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.forOwnRight
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
|
||||
@@ -12,6 +12,7 @@ var baseForOwnRight = require('./_baseForOwnRight'),
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see _.forOwn
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
|
||||
@@ -30,17 +30,19 @@ exports.aliasToReal = {
|
||||
'init': 'initial',
|
||||
'invertObj': 'invert',
|
||||
'juxt': 'over',
|
||||
'mapObj': 'mapValues',
|
||||
'omitAll': 'omit',
|
||||
'nAry': 'ary',
|
||||
'path': 'get',
|
||||
'pathEq': 'matchesProperty',
|
||||
'pathOr': 'getOr',
|
||||
'paths': 'at',
|
||||
'pickAll': 'pick',
|
||||
'pipe': 'flow',
|
||||
'pluck': 'map',
|
||||
'prop': 'get',
|
||||
'propOf': 'propertyOf',
|
||||
'propEq': 'matchesProperty',
|
||||
'propOr': 'getOr',
|
||||
'props': 'at',
|
||||
'unapply': 'rest',
|
||||
'unnest': 'flatten',
|
||||
'useWith': 'overArgs',
|
||||
@@ -68,16 +70,17 @@ exports.aryMethod = {
|
||||
'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
|
||||
'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
|
||||
'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
|
||||
'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'omit', 'omitBy',
|
||||
'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', 'partialRight',
|
||||
'partition', 'pick', 'pickBy', 'pull', 'pullAll', 'pullAt', 'random', 'range',
|
||||
'rangeRight', 'rearg', 'reject', 'remove', 'repeat', 'restFrom', 'result',
|
||||
'sampleSize', 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', 'sortedLastIndex',
|
||||
'sortedLastIndexOf', 'sortedUniqBy', 'split', 'spreadFrom', 'startsWith',
|
||||
'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', 'tap',
|
||||
'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd', 'trimCharsStart',
|
||||
'truncate', 'union', 'uniqBy', 'uniqWith', 'unset', 'unzipWith', 'without',
|
||||
'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'
|
||||
'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth',
|
||||
'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
|
||||
'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
|
||||
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
|
||||
'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
|
||||
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
|
||||
'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
|
||||
'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
|
||||
'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
|
||||
'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
|
||||
'zipObjectDeep'
|
||||
],
|
||||
'3': [
|
||||
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
|
||||
@@ -165,10 +168,6 @@ exports.methodRearg = {
|
||||
exports.methodSpread = {
|
||||
'invokeArgs': 2,
|
||||
'invokeArgsMap': 2,
|
||||
'over': 0,
|
||||
'overArgs': 1,
|
||||
'overEvery': 0,
|
||||
'overSome': 0,
|
||||
'partial': 1,
|
||||
'partialRight': 1,
|
||||
'without': 1
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
module.exports = require('./mapValues');
|
||||
5
fp/nth.js
Normal file
5
fp/nth.js
Normal file
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('nth', require('../nth'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
1
fp/paths.js
Normal file
1
fp/paths.js
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('./at');
|
||||
1
fp/pluck.js
Normal file
1
fp/pluck.js
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('./map');
|
||||
1
fp/propEq.js
Normal file
1
fp/propEq.js
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('./matchesProperty');
|
||||
@@ -1 +0,0 @@
|
||||
module.exports = require('./propertyOf');
|
||||
1
fp/props.js
Normal file
1
fp/props.js
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('./at');
|
||||
@@ -1,5 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('[object Object]', require('../[object Object]'), require('./_falseOptions'));
|
||||
func = convert('toString', require('../toString'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('[object Object]', require('../[object Object]'), require('./_falseOptions'));
|
||||
func = convert('valueOf', require('../valueOf'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
|
||||
@@ -11,6 +11,7 @@ var baseFunctions = require('./_baseFunctions'),
|
||||
* @category Object
|
||||
* @param {Object} object The object to inspect.
|
||||
* @returns {Array} Returns the new array of property names.
|
||||
* @see _.functionsIn
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
|
||||
@@ -11,6 +11,7 @@ var baseFunctions = require('./_baseFunctions'),
|
||||
* @category Object
|
||||
* @param {Object} object The object to inspect.
|
||||
* @returns {Array} Returns the new array of property names.
|
||||
* @see _.functions
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
|
||||
2
get.js
2
get.js
@@ -2,7 +2,7 @@ var baseGet = require('./_baseGet');
|
||||
|
||||
/**
|
||||
* Gets the value at `path` of `object`. If the resolved value is
|
||||
* `undefined` the `defaultValue` is used in its place.
|
||||
* `undefined`, the `defaultValue` is used in its place.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -8,9 +8,10 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Creates an object composed of keys generated from the results of running
|
||||
* each element of `collection` thru `iteratee`. The corresponding value of
|
||||
* each key is an array of elements responsible for generating the key. The
|
||||
* iteratee is invoked with one argument: (value).
|
||||
* each element of `collection` thru `iteratee`. The order of grouped values
|
||||
* is determined by the order they occur in `collection`. The corresponding
|
||||
* value of each key is an array of elements responsible for generating the
|
||||
* key. The iteratee is invoked with one argument: (value).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
8
gt.js
8
gt.js
@@ -1,3 +1,6 @@
|
||||
var baseGt = require('./_baseGt'),
|
||||
createRelationalOperation = require('./_createRelationalOperation');
|
||||
|
||||
/**
|
||||
* Checks if `value` is greater than `other`.
|
||||
*
|
||||
@@ -9,6 +12,7 @@
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {boolean} Returns `true` if `value` is greater than `other`,
|
||||
* else `false`.
|
||||
* @see _.lt
|
||||
* @example
|
||||
*
|
||||
* _.gt(3, 1);
|
||||
@@ -20,8 +24,6 @@
|
||||
* _.gt(1, 3);
|
||||
* // => false
|
||||
*/
|
||||
function gt(value, other) {
|
||||
return value > other;
|
||||
}
|
||||
var gt = createRelationalOperation(baseGt);
|
||||
|
||||
module.exports = gt;
|
||||
|
||||
7
gte.js
7
gte.js
@@ -1,3 +1,5 @@
|
||||
var createRelationalOperation = require('./_createRelationalOperation');
|
||||
|
||||
/**
|
||||
* Checks if `value` is greater than or equal to `other`.
|
||||
*
|
||||
@@ -9,6 +11,7 @@
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {boolean} Returns `true` if `value` is greater than or equal to
|
||||
* `other`, else `false`.
|
||||
* @see _.lte
|
||||
* @example
|
||||
*
|
||||
* _.gte(3, 1);
|
||||
@@ -20,8 +23,8 @@
|
||||
* _.gte(1, 3);
|
||||
* // => false
|
||||
*/
|
||||
function gte(value, other) {
|
||||
var gte = createRelationalOperation(function(value, other) {
|
||||
return value >= other;
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = gte;
|
||||
|
||||
8
has.js
8
has.js
@@ -13,16 +13,16 @@ var baseHas = require('./_baseHas'),
|
||||
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'a': { 'b': { 'c': 3 } } };
|
||||
* var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
|
||||
* var object = { 'a': { 'b': 2 } };
|
||||
* var other = _.create({ 'a': _.create({ 'b': 2 }) });
|
||||
*
|
||||
* _.has(object, 'a');
|
||||
* // => true
|
||||
*
|
||||
* _.has(object, 'a.b.c');
|
||||
* _.has(object, 'a.b');
|
||||
* // => true
|
||||
*
|
||||
* _.has(object, ['a', 'b', 'c']);
|
||||
* _.has(object, ['a', 'b']);
|
||||
* // => true
|
||||
*
|
||||
* _.has(other, 'a');
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user