mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
764eccfdc0 | ||
|
|
f10bb8b80b | ||
|
|
b7e3b3febd | ||
|
|
e8cff1ef54 | ||
|
|
723c02dbfa |
@@ -1,10 +1,10 @@
|
|||||||
# lodash-es v4.7.0
|
# lodash-es v4.11.0
|
||||||
|
|
||||||
The [lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules.
|
The [Lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules.
|
||||||
|
|
||||||
Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
|
Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
|
||||||
```bash
|
```bash
|
||||||
$ lodash modularize exports=es -o ./
|
$ lodash modularize exports=es -o ./
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [package source](https://github.com/lodash/lodash/tree/4.7.0-es) for more details.
|
See the [package source](https://github.com/lodash/lodash/tree/4.11.0-es) for more details.
|
||||||
|
|||||||
2
_Hash.js
2
_Hash.js
@@ -4,7 +4,7 @@ import nativeCreate from './_nativeCreate';
|
|||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an hash object.
|
* Creates a hash object.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @private
|
* @private
|
||||||
* @param {Function} func The function to invoke.
|
* @param {Function} func The function to invoke.
|
||||||
* @param {*} thisArg The `this` binding of `func`.
|
* @param {*} thisArg The `this` binding of `func`.
|
||||||
* @param {...*} args The arguments to invoke `func` with.
|
* @param {Array} args The arguments to invoke `func` with.
|
||||||
* @returns {*} Returns the result of `func`.
|
* @returns {*} Returns the result of `func`.
|
||||||
*/
|
*/
|
||||||
function apply(func, thisArg, args) {
|
function apply(func, thisArg, args) {
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import arrayPush from './_arrayPush';
|
import arrayPush from './_arrayPush';
|
||||||
import isArguments from './isArguments';
|
import isFlattenable from './_isFlattenable';
|
||||||
import isArray from './isArray';
|
|
||||||
import isArrayLikeObject from './isArrayLikeObject';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.flatten` with support for restricting flattening.
|
* The base implementation of `_.flatten` with support for restricting flattening.
|
||||||
@@ -9,23 +7,24 @@ import isArrayLikeObject from './isArrayLikeObject';
|
|||||||
* @private
|
* @private
|
||||||
* @param {Array} array The array to flatten.
|
* @param {Array} array The array to flatten.
|
||||||
* @param {number} depth The maximum recursion depth.
|
* @param {number} depth The maximum recursion depth.
|
||||||
* @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
|
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
|
||||||
|
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
|
||||||
* @param {Array} [result=[]] The initial result value.
|
* @param {Array} [result=[]] The initial result value.
|
||||||
* @returns {Array} Returns the new flattened array.
|
* @returns {Array} Returns the new flattened array.
|
||||||
*/
|
*/
|
||||||
function baseFlatten(array, depth, isStrict, result) {
|
function baseFlatten(array, depth, predicate, isStrict, result) {
|
||||||
result || (result = []);
|
|
||||||
|
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = array.length;
|
length = array.length;
|
||||||
|
|
||||||
|
predicate || (predicate = isFlattenable);
|
||||||
|
result || (result = []);
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
var value = array[index];
|
var value = array[index];
|
||||||
if (depth > 0 && isArrayLikeObject(value) &&
|
if (depth > 0 && predicate(value)) {
|
||||||
(isStrict || isArray(value) || isArguments(value))) {
|
|
||||||
if (depth > 1) {
|
if (depth > 1) {
|
||||||
// Recursively flatten arrays (susceptible to call stack limits).
|
// Recursively flatten arrays (susceptible to call stack limits).
|
||||||
baseFlatten(value, depth - 1, isStrict, result);
|
baseFlatten(value, depth - 1, predicate, isStrict, result);
|
||||||
} else {
|
} else {
|
||||||
arrayPush(result, value);
|
arrayPush(result, value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import createBaseFor from './_createBaseFor';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `baseForOwn` which iterates over `object`
|
* The base implementation of `baseForOwn` which iterates over `object`
|
||||||
* properties returned by `keysFunc` invoking `iteratee` for each property.
|
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
||||||
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import baseCastPath from './_baseCastPath';
|
import castPath from './_castPath';
|
||||||
import isKey from './_isKey';
|
import isKey from './_isKey';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10,7 +10,7 @@ import isKey from './_isKey';
|
|||||||
* @returns {*} Returns the resolved value.
|
* @returns {*} Returns the resolved value.
|
||||||
*/
|
*/
|
||||||
function baseGet(object, path) {
|
function baseGet(object, path) {
|
||||||
path = isKey(path, object) ? [path] : baseCastPath(path);
|
path = isKey(path, object) ? [path] : castPath(path);
|
||||||
|
|
||||||
var index = 0,
|
var index = 0,
|
||||||
length = path.length;
|
length = path.length;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import apply from './_apply';
|
import apply from './_apply';
|
||||||
import baseCastPath from './_baseCastPath';
|
import castPath from './_castPath';
|
||||||
import isKey from './_isKey';
|
import isKey from './_isKey';
|
||||||
import last from './last';
|
import last from './last';
|
||||||
import parent from './_parent';
|
import parent from './_parent';
|
||||||
@@ -16,7 +16,7 @@ import parent from './_parent';
|
|||||||
*/
|
*/
|
||||||
function baseInvoke(object, path, args) {
|
function baseInvoke(object, path, args) {
|
||||||
if (!isKey(path, object)) {
|
if (!isKey(path, object)) {
|
||||||
path = baseCastPath(path);
|
path = castPath(path);
|
||||||
object = parent(object, path);
|
object = parent(object, path);
|
||||||
path = last(path);
|
path = last(path);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import baseIsMatch from './_baseIsMatch';
|
import baseIsMatch from './_baseIsMatch';
|
||||||
import getMatchData from './_getMatchData';
|
import getMatchData from './_getMatchData';
|
||||||
|
import matchesStrictComparable from './_matchesStrictComparable';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.matches` which doesn't clone `source`.
|
* The base implementation of `_.matches` which doesn't clone `source`.
|
||||||
@@ -11,16 +12,7 @@ import getMatchData from './_getMatchData';
|
|||||||
function baseMatches(source) {
|
function baseMatches(source) {
|
||||||
var matchData = getMatchData(source);
|
var matchData = getMatchData(source);
|
||||||
if (matchData.length == 1 && matchData[0][2]) {
|
if (matchData.length == 1 && matchData[0][2]) {
|
||||||
var key = matchData[0][0],
|
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
|
||||||
value = matchData[0][1];
|
|
||||||
|
|
||||||
return function(object) {
|
|
||||||
if (object == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return object[key] === value &&
|
|
||||||
(value !== undefined || (key in Object(object)));
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
return function(object) {
|
return function(object) {
|
||||||
return object === source || baseIsMatch(object, source, matchData);
|
return object === source || baseIsMatch(object, source, matchData);
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import baseIsEqual from './_baseIsEqual';
|
import baseIsEqual from './_baseIsEqual';
|
||||||
import get from './get';
|
import get from './get';
|
||||||
import hasIn from './hasIn';
|
import hasIn from './hasIn';
|
||||||
|
import isKey from './_isKey';
|
||||||
|
import isStrictComparable from './_isStrictComparable';
|
||||||
|
import matchesStrictComparable from './_matchesStrictComparable';
|
||||||
|
|
||||||
/** Used to compose bitmasks for comparison styles. */
|
/** Used to compose bitmasks for comparison styles. */
|
||||||
var UNORDERED_COMPARE_FLAG = 1,
|
var UNORDERED_COMPARE_FLAG = 1,
|
||||||
@@ -15,6 +18,9 @@ var UNORDERED_COMPARE_FLAG = 1,
|
|||||||
* @returns {Function} Returns the new function.
|
* @returns {Function} Returns the new function.
|
||||||
*/
|
*/
|
||||||
function baseMatchesProperty(path, srcValue) {
|
function baseMatchesProperty(path, srcValue) {
|
||||||
|
if (isKey(path) && isStrictComparable(srcValue)) {
|
||||||
|
return matchesStrictComparable(path, srcValue);
|
||||||
|
}
|
||||||
return function(object) {
|
return function(object) {
|
||||||
var objValue = get(object, path);
|
var objValue = get(object, path);
|
||||||
return (objValue === undefined && objValue === srcValue)
|
return (objValue === undefined && objValue === srcValue)
|
||||||
|
|||||||
20
_baseNth.js
Normal file
20
_baseNth.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import isIndex from './_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;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default baseNth;
|
||||||
@@ -2,6 +2,7 @@ import arrayMap from './_arrayMap';
|
|||||||
import baseIteratee from './_baseIteratee';
|
import baseIteratee from './_baseIteratee';
|
||||||
import baseMap from './_baseMap';
|
import baseMap from './_baseMap';
|
||||||
import baseSortBy from './_baseSortBy';
|
import baseSortBy from './_baseSortBy';
|
||||||
|
import baseUnary from './_baseUnary';
|
||||||
import compareMultiple from './_compareMultiple';
|
import compareMultiple from './_compareMultiple';
|
||||||
import identity from './identity';
|
import identity from './identity';
|
||||||
|
|
||||||
@@ -16,7 +17,7 @@ import identity from './identity';
|
|||||||
*/
|
*/
|
||||||
function baseOrderBy(collection, iteratees, orders) {
|
function baseOrderBy(collection, iteratees, orders) {
|
||||||
var index = -1;
|
var index = -1;
|
||||||
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseIteratee);
|
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
|
||||||
|
|
||||||
var result = baseMap(collection, function(value, key, collection) {
|
var result = baseMap(collection, function(value, key, collection) {
|
||||||
var criteria = arrayMap(iteratees, function(iteratee) {
|
var criteria = arrayMap(iteratees, function(iteratee) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import baseCastPath from './_baseCastPath';
|
import castPath from './_castPath';
|
||||||
import isIndex from './_isIndex';
|
import isIndex from './_isIndex';
|
||||||
import isKey from './_isKey';
|
import isKey from './_isKey';
|
||||||
import last from './last';
|
import last from './last';
|
||||||
@@ -31,7 +31,7 @@ function basePullAt(array, indexes) {
|
|||||||
splice.call(array, index, 1);
|
splice.call(array, index, 1);
|
||||||
}
|
}
|
||||||
else if (!isKey(index, array)) {
|
else if (!isKey(index, array)) {
|
||||||
var path = baseCastPath(index),
|
var path = castPath(index),
|
||||||
object = parent(array, path);
|
object = parent(array, path);
|
||||||
|
|
||||||
if (object != null) {
|
if (object != null) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import assignValue from './_assignValue';
|
import assignValue from './_assignValue';
|
||||||
import baseCastPath from './_baseCastPath';
|
import castPath from './_castPath';
|
||||||
import isIndex from './_isIndex';
|
import isIndex from './_isIndex';
|
||||||
import isKey from './_isKey';
|
import isKey from './_isKey';
|
||||||
import isObject from './isObject';
|
import isObject from './isObject';
|
||||||
@@ -15,7 +15,7 @@ import isObject from './isObject';
|
|||||||
* @returns {Object} Returns `object`.
|
* @returns {Object} Returns `object`.
|
||||||
*/
|
*/
|
||||||
function baseSet(object, path, value, customizer) {
|
function baseSet(object, path, value, customizer) {
|
||||||
path = isKey(path, object) ? [path] : baseCastPath(path);
|
path = isKey(path, object) ? [path] : castPath(path);
|
||||||
|
|
||||||
var index = -1,
|
var index = -1,
|
||||||
length = path.length,
|
length = path.length,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import baseCastPath from './_baseCastPath';
|
import castPath from './_castPath';
|
||||||
import has from './has';
|
import has from './has';
|
||||||
import isKey from './_isKey';
|
import isKey from './_isKey';
|
||||||
import last from './last';
|
import last from './last';
|
||||||
@@ -13,7 +13,7 @@ import parent from './_parent';
|
|||||||
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
|
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
|
||||||
*/
|
*/
|
||||||
function baseUnset(object, path) {
|
function baseUnset(object, path) {
|
||||||
path = isKey(path, object) ? [path] : baseCastPath(path);
|
path = isKey(path, object) ? [path] : castPath(path);
|
||||||
object = parent(object, path);
|
object = parent(object, path);
|
||||||
var key = last(path);
|
var key = last(path);
|
||||||
return (object != null && has(object, key)) ? delete object[key] : true;
|
return (object != null && has(object, key)) ? delete object[key] : true;
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import isArrayLikeObject from './isArrayLikeObject';
|
|||||||
* @param {*} value The value to inspect.
|
* @param {*} value The value to inspect.
|
||||||
* @returns {Array|Object} Returns the cast array-like object.
|
* @returns {Array|Object} Returns the cast array-like object.
|
||||||
*/
|
*/
|
||||||
function baseCastArrayLikeObject(value) {
|
function castArrayLikeObject(value) {
|
||||||
return isArrayLikeObject(value) ? value : [];
|
return isArrayLikeObject(value) ? value : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
export default baseCastArrayLikeObject;
|
export default castArrayLikeObject;
|
||||||
@@ -7,8 +7,8 @@ import identity from './identity';
|
|||||||
* @param {*} value The value to inspect.
|
* @param {*} value The value to inspect.
|
||||||
* @returns {Function} Returns cast function.
|
* @returns {Function} Returns cast function.
|
||||||
*/
|
*/
|
||||||
function baseCastFunction(value) {
|
function castFunction(value) {
|
||||||
return typeof value == 'function' ? value : identity;
|
return typeof value == 'function' ? value : identity;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default baseCastFunction;
|
export default castFunction;
|
||||||
@@ -8,8 +8,8 @@ import stringToPath from './_stringToPath';
|
|||||||
* @param {*} value The value to inspect.
|
* @param {*} value The value to inspect.
|
||||||
* @returns {Array} Returns the cast property path array.
|
* @returns {Array} Returns the cast property path array.
|
||||||
*/
|
*/
|
||||||
function baseCastPath(value) {
|
function castPath(value) {
|
||||||
return isArray(value) ? value : stringToPath(value);
|
return isArray(value) ? value : stringToPath(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default baseCastPath;
|
export default castPath;
|
||||||
18
_castSlice.js
Normal file
18
_castSlice.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import baseSlice from './_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);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default castSlice;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import copyObjectWith from './_copyObjectWith';
|
import assignValue from './_assignValue';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies properties of `source` to `object`.
|
* Copies properties of `source` to `object`.
|
||||||
@@ -7,10 +7,25 @@ import copyObjectWith from './_copyObjectWith';
|
|||||||
* @param {Object} source The object to copy properties from.
|
* @param {Object} source The object to copy properties from.
|
||||||
* @param {Array} props The property identifiers to copy.
|
* @param {Array} props The property identifiers to copy.
|
||||||
* @param {Object} [object={}] The object to copy properties to.
|
* @param {Object} [object={}] The object to copy properties to.
|
||||||
|
* @param {Function} [customizer] The function to customize copied values.
|
||||||
* @returns {Object} Returns `object`.
|
* @returns {Object} Returns `object`.
|
||||||
*/
|
*/
|
||||||
function copyObject(source, props, object) {
|
function copyObject(source, props, object, customizer) {
|
||||||
return copyObjectWith(source, props, object);
|
object || (object = {});
|
||||||
|
|
||||||
|
var index = -1,
|
||||||
|
length = props.length;
|
||||||
|
|
||||||
|
while (++index < length) {
|
||||||
|
var key = props[index];
|
||||||
|
|
||||||
|
var newValue = customizer
|
||||||
|
? customizer(object[key], source[key], key, object, source)
|
||||||
|
: source[key];
|
||||||
|
|
||||||
|
assignValue(object, key, newValue);
|
||||||
|
}
|
||||||
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default copyObject;
|
export default copyObject;
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
import assignValue from './_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default copyObjectWith;
|
|
||||||
@@ -1,18 +1,8 @@
|
|||||||
|
import castSlice from './_castSlice';
|
||||||
|
import reHasComplexSymbol from './_reHasComplexSymbol';
|
||||||
import stringToArray from './_stringToArray';
|
import stringToArray from './_stringToArray';
|
||||||
import toString from './toString';
|
import toString from './toString';
|
||||||
|
|
||||||
/** Used to compose unicode character classes. */
|
|
||||||
var rsAstralRange = '\\ud800-\\udfff',
|
|
||||||
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
|
||||||
rsComboSymbolsRange = '\\u20d0-\\u20f0',
|
|
||||||
rsVarRange = '\\ufe0e\\ufe0f';
|
|
||||||
|
|
||||||
/** Used to compose unicode capture groups. */
|
|
||||||
var rsZWJ = '\\u200d';
|
|
||||||
|
|
||||||
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
|
|
||||||
var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function like `_.lowerFirst`.
|
* Creates a function like `_.lowerFirst`.
|
||||||
*
|
*
|
||||||
@@ -28,8 +18,13 @@ function createCaseFirst(methodName) {
|
|||||||
? stringToArray(string)
|
? stringToArray(string)
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
var chr = strSymbols ? strSymbols[0] : string.charAt(0),
|
var chr = strSymbols
|
||||||
trailing = strSymbols ? strSymbols.slice(1).join('') : string.slice(1);
|
? strSymbols[0]
|
||||||
|
: string.charAt(0);
|
||||||
|
|
||||||
|
var trailing = strSymbols
|
||||||
|
? castSlice(strSymbols, 1).join('')
|
||||||
|
: string.slice(1);
|
||||||
|
|
||||||
return chr[methodName]() + trailing;
|
return chr[methodName]() + trailing;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,12 @@ import arrayReduce from './_arrayReduce';
|
|||||||
import deburr from './deburr';
|
import deburr from './deburr';
|
||||||
import words from './words';
|
import words from './words';
|
||||||
|
|
||||||
|
/** Used to compose unicode capture groups. */
|
||||||
|
var rsApos = "['\u2019]";
|
||||||
|
|
||||||
|
/** Used to match apostrophes. */
|
||||||
|
var reApos = RegExp(rsApos, 'g');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function like `_.camelCase`.
|
* Creates a function like `_.camelCase`.
|
||||||
*
|
*
|
||||||
@@ -11,7 +17,7 @@ import words from './words';
|
|||||||
*/
|
*/
|
||||||
function createCompounder(callback) {
|
function createCompounder(callback) {
|
||||||
return function(string) {
|
return function(string) {
|
||||||
return arrayReduce(words(deburr(string)), callback, '');
|
return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import isObject from './isObject';
|
|||||||
*/
|
*/
|
||||||
function createCtorWrapper(Ctor) {
|
function createCtorWrapper(Ctor) {
|
||||||
return function() {
|
return function() {
|
||||||
// Use a `switch` statement to work with class constructors.
|
// Use a `switch` statement to work with class constructors. See
|
||||||
// See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
|
// http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
|
||||||
// for more details.
|
// for more details.
|
||||||
var args = arguments;
|
var args = arguments;
|
||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ import apply from './_apply';
|
|||||||
import arrayMap from './_arrayMap';
|
import arrayMap from './_arrayMap';
|
||||||
import baseFlatten from './_baseFlatten';
|
import baseFlatten from './_baseFlatten';
|
||||||
import baseIteratee from './_baseIteratee';
|
import baseIteratee from './_baseIteratee';
|
||||||
|
import baseUnary from './_baseUnary';
|
||||||
|
import isArray from './isArray';
|
||||||
|
import isFlattenableIteratee from './_isFlattenableIteratee';
|
||||||
import rest from './rest';
|
import rest from './rest';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,7 +16,10 @@ import rest from './rest';
|
|||||||
*/
|
*/
|
||||||
function createOver(arrayFunc) {
|
function createOver(arrayFunc) {
|
||||||
return rest(function(iteratees) {
|
return rest(function(iteratees) {
|
||||||
iteratees = arrayMap(baseFlatten(iteratees, 1), baseIteratee);
|
iteratees = (iteratees.length == 1 && isArray(iteratees[0]))
|
||||||
|
? arrayMap(iteratees[0], baseUnary(baseIteratee))
|
||||||
|
: arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), baseUnary(baseIteratee));
|
||||||
|
|
||||||
return rest(function(args) {
|
return rest(function(args) {
|
||||||
var thisArg = this;
|
var thisArg = this;
|
||||||
return arrayFunc(iteratees, function(iteratee) {
|
return arrayFunc(iteratees, function(iteratee) {
|
||||||
|
|||||||
@@ -1,19 +1,9 @@
|
|||||||
import baseRepeat from './_baseRepeat';
|
import baseRepeat from './_baseRepeat';
|
||||||
|
import castSlice from './_castSlice';
|
||||||
|
import reHasComplexSymbol from './_reHasComplexSymbol';
|
||||||
import stringSize from './_stringSize';
|
import stringSize from './_stringSize';
|
||||||
import stringToArray from './_stringToArray';
|
import stringToArray from './_stringToArray';
|
||||||
|
|
||||||
/** Used to compose unicode character classes. */
|
|
||||||
var rsAstralRange = '\\ud800-\\udfff',
|
|
||||||
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
|
||||||
rsComboSymbolsRange = '\\u20d0-\\u20f0',
|
|
||||||
rsVarRange = '\\ufe0e\\ufe0f';
|
|
||||||
|
|
||||||
/** Used to compose unicode capture groups. */
|
|
||||||
var rsZWJ = '\\u200d';
|
|
||||||
|
|
||||||
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
|
|
||||||
var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
|
|
||||||
|
|
||||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||||
var nativeCeil = Math.ceil;
|
var nativeCeil = Math.ceil;
|
||||||
|
|
||||||
@@ -35,7 +25,7 @@ function createPadding(length, chars) {
|
|||||||
}
|
}
|
||||||
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
||||||
return reHasComplexSymbol.test(chars)
|
return reHasComplexSymbol.test(chars)
|
||||||
? stringToArray(result).slice(0, length).join('')
|
? castSlice(stringToArray(result), 0, length).join('')
|
||||||
: result.slice(0, length);
|
: result.slice(0, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,8 @@ import root from './_root';
|
|||||||
var BIND_FLAG = 1;
|
var BIND_FLAG = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that wraps `func` to invoke it with the optional `this`
|
* Creates a function that wraps `func` to invoke it with the `this` binding
|
||||||
* binding of `thisArg` and the `partials` prepended to those provided to
|
* of `thisArg` and `partials` prepended to the arguments it receives.
|
||||||
* the wrapper.
|
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Function} func The function to wrap.
|
* @param {Function} func The function to wrap.
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import copyArray from './_copyArray';
|
|
||||||
import isLaziable from './_isLaziable';
|
import isLaziable from './_isLaziable';
|
||||||
import setData from './_setData';
|
import setData from './_setData';
|
||||||
|
|
||||||
@@ -30,7 +29,6 @@ var BIND_FLAG = 1,
|
|||||||
*/
|
*/
|
||||||
function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
|
function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
|
||||||
var isCurry = bitmask & CURRY_FLAG,
|
var isCurry = bitmask & CURRY_FLAG,
|
||||||
newArgPos = argPos ? copyArray(argPos) : undefined,
|
|
||||||
newHolders = isCurry ? holders : undefined,
|
newHolders = isCurry ? holders : undefined,
|
||||||
newHoldersRight = isCurry ? undefined : holders,
|
newHoldersRight = isCurry ? undefined : holders,
|
||||||
newPartials = isCurry ? partials : undefined,
|
newPartials = isCurry ? partials : undefined,
|
||||||
@@ -44,7 +42,7 @@ function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, par
|
|||||||
}
|
}
|
||||||
var newData = [
|
var newData = [
|
||||||
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
|
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
|
||||||
newHoldersRight, newArgPos, ary, arity
|
newHoldersRight, argPos, ary, arity
|
||||||
];
|
];
|
||||||
|
|
||||||
var result = wrapFunc.apply(undefined, newData);
|
var result = wrapFunc.apply(undefined, newData);
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
|
|||||||
case regexpTag:
|
case regexpTag:
|
||||||
case stringTag:
|
case stringTag:
|
||||||
// Coerce regexes to strings and treat strings, primitives and objects,
|
// Coerce regexes to strings and treat strings, primitives and objects,
|
||||||
// as equal. See https://es5.github.io/#x15.10.6.4 for more details.
|
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring
|
||||||
|
// for more details.
|
||||||
return object == (other + '');
|
return object == (other + '');
|
||||||
|
|
||||||
case mapTag:
|
case mapTag:
|
||||||
|
|||||||
21
_getTag.js
21
_getTag.js
@@ -3,6 +3,7 @@ import Map from './_Map';
|
|||||||
import Promise from './_Promise';
|
import Promise from './_Promise';
|
||||||
import Set from './_Set';
|
import Set from './_Set';
|
||||||
import WeakMap from './_WeakMap';
|
import WeakMap from './_WeakMap';
|
||||||
|
import toSource from './_toSource';
|
||||||
|
|
||||||
/** `Object#toString` result references. */
|
/** `Object#toString` result references. */
|
||||||
var mapTag = '[object Map]',
|
var mapTag = '[object Map]',
|
||||||
@@ -16,21 +17,19 @@ var dataViewTag = '[object DataView]';
|
|||||||
/** Used for built-in method references. */
|
/** Used for built-in method references. */
|
||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/** Used to resolve the decompiled source of functions. */
|
|
||||||
var funcToString = Function.prototype.toString;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|
||||||
/** Used to detect maps, sets, and weakmaps. */
|
/** Used to detect maps, sets, and weakmaps. */
|
||||||
var dataViewCtorString = DataView ? (DataView + '') : '',
|
var dataViewCtorString = toSource(DataView),
|
||||||
mapCtorString = Map ? funcToString.call(Map) : '',
|
mapCtorString = toSource(Map),
|
||||||
promiseCtorString = Promise ? funcToString.call(Promise) : '',
|
promiseCtorString = toSource(Promise),
|
||||||
setCtorString = Set ? funcToString.call(Set) : '',
|
setCtorString = toSource(Set),
|
||||||
weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : '';
|
weakMapCtorString = toSource(WeakMap);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the `toStringTag` of `value`.
|
* Gets the `toStringTag` of `value`.
|
||||||
@@ -52,8 +51,8 @@ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
|||||||
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
|
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
|
||||||
getTag = function(value) {
|
getTag = function(value) {
|
||||||
var result = objectToString.call(value),
|
var result = objectToString.call(value),
|
||||||
Ctor = result == objectTag ? value.constructor : null,
|
Ctor = result == objectTag ? value.constructor : undefined,
|
||||||
ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : '';
|
ctorString = Ctor ? toSource(Ctor) : undefined;
|
||||||
|
|
||||||
if (ctorString) {
|
if (ctorString) {
|
||||||
switch (ctorString) {
|
switch (ctorString) {
|
||||||
|
|||||||
36
_hasPath.js
36
_hasPath.js
@@ -1,4 +1,4 @@
|
|||||||
import baseCastPath from './_baseCastPath';
|
import castPath from './_castPath';
|
||||||
import isArguments from './isArguments';
|
import isArguments from './isArguments';
|
||||||
import isArray from './isArray';
|
import isArray from './isArray';
|
||||||
import isIndex from './_isIndex';
|
import isIndex from './_isIndex';
|
||||||
@@ -16,29 +16,25 @@ import isString from './isString';
|
|||||||
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
||||||
*/
|
*/
|
||||||
function hasPath(object, path, hasFunc) {
|
function hasPath(object, path, hasFunc) {
|
||||||
if (object == null) {
|
path = isKey(path, object) ? [path] : castPath(path);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
var result = hasFunc(object, path);
|
|
||||||
if (!result && !isKey(path)) {
|
|
||||||
path = baseCastPath(path);
|
|
||||||
|
|
||||||
var index = -1,
|
var result,
|
||||||
length = path.length;
|
index = -1,
|
||||||
|
length = path.length;
|
||||||
|
|
||||||
while (object != null && ++index < length) {
|
while (++index < length) {
|
||||||
var key = path[index];
|
var key = path[index];
|
||||||
if (!(result = hasFunc(object, key))) {
|
if (!(result = object != null && hasFunc(object, key))) {
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
object = object[key];
|
|
||||||
}
|
}
|
||||||
|
object = object[key];
|
||||||
}
|
}
|
||||||
var length = object ? object.length : undefined;
|
if (result) {
|
||||||
return result || (
|
return result;
|
||||||
!!length && isLength(length) && isIndex(path, length) &&
|
}
|
||||||
(isArray(object) || isString(object) || isArguments(object))
|
var length = object ? object.length : 0;
|
||||||
);
|
return !!length && isLength(length) && isIndex(key, length) &&
|
||||||
|
(isArray(object) || isString(object) || isArguments(object));
|
||||||
}
|
}
|
||||||
|
|
||||||
export default hasPath;
|
export default hasPath;
|
||||||
|
|||||||
16
_isFlattenable.js
Normal file
16
_isFlattenable.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import isArguments from './isArguments';
|
||||||
|
import isArray from './isArray';
|
||||||
|
import isArrayLikeObject from './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));
|
||||||
|
}
|
||||||
|
|
||||||
|
export default isFlattenable;
|
||||||
16
_isFlattenableIteratee.js
Normal file
16
_isFlattenableIteratee.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import isArray from './isArray';
|
||||||
|
import isFunction from './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]));
|
||||||
|
}
|
||||||
|
|
||||||
|
export default isFlattenableIteratee;
|
||||||
20
_matchesStrictComparable.js
Normal file
20
_matchesStrictComparable.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* A specialized version of `matchesProperty` for source values suitable
|
||||||
|
* for strict equality comparisons, i.e. `===`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} key The key of the property to get.
|
||||||
|
* @param {*} srcValue The value to match.
|
||||||
|
* @returns {Function} Returns the new function.
|
||||||
|
*/
|
||||||
|
function matchesStrictComparable(key, srcValue) {
|
||||||
|
return function(object) {
|
||||||
|
if (object == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return object[key] === srcValue &&
|
||||||
|
(srcValue !== undefined || (key in Object(object)));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export default matchesStrictComparable;
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import composeArgs from './_composeArgs';
|
import composeArgs from './_composeArgs';
|
||||||
import composeArgsRight from './_composeArgsRight';
|
import composeArgsRight from './_composeArgsRight';
|
||||||
import copyArray from './_copyArray';
|
|
||||||
import replaceHolders from './_replaceHolders';
|
import replaceHolders from './_replaceHolders';
|
||||||
|
|
||||||
/** Used as the internal argument placeholder. */
|
/** Used as the internal argument placeholder. */
|
||||||
@@ -58,20 +57,20 @@ function mergeData(data, source) {
|
|||||||
var value = source[3];
|
var value = source[3];
|
||||||
if (value) {
|
if (value) {
|
||||||
var partials = data[3];
|
var partials = data[3];
|
||||||
data[3] = partials ? composeArgs(partials, value, source[4]) : copyArray(value);
|
data[3] = partials ? composeArgs(partials, value, source[4]) : value;
|
||||||
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : copyArray(source[4]);
|
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
|
||||||
}
|
}
|
||||||
// Compose partial right arguments.
|
// Compose partial right arguments.
|
||||||
value = source[5];
|
value = source[5];
|
||||||
if (value) {
|
if (value) {
|
||||||
partials = data[5];
|
partials = data[5];
|
||||||
data[5] = partials ? composeArgsRight(partials, value, source[6]) : copyArray(value);
|
data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
|
||||||
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : copyArray(source[6]);
|
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
|
||||||
}
|
}
|
||||||
// Use source `argPos` if available.
|
// Use source `argPos` if available.
|
||||||
value = source[7];
|
value = source[7];
|
||||||
if (value) {
|
if (value) {
|
||||||
data[7] = copyArray(value);
|
data[7] = value;
|
||||||
}
|
}
|
||||||
// Use source `ary` if it's smaller.
|
// Use source `ary` if it's smaller.
|
||||||
if (srcBitmask & ARY_FLAG) {
|
if (srcBitmask & ARY_FLAG) {
|
||||||
|
|||||||
13
_reHasComplexSymbol.js
Normal file
13
_reHasComplexSymbol.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/** Used to compose unicode character classes. */
|
||||||
|
var rsAstralRange = '\\ud800-\\udfff',
|
||||||
|
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
||||||
|
rsComboSymbolsRange = '\\u20d0-\\u20f0',
|
||||||
|
rsVarRange = '\\ufe0e\\ufe0f';
|
||||||
|
|
||||||
|
/** Used to compose unicode capture groups. */
|
||||||
|
var rsZWJ = '\\u200d';
|
||||||
|
|
||||||
|
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
|
||||||
|
var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
|
||||||
|
|
||||||
|
export default reHasComplexSymbol;
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import reHasComplexSymbol from './_reHasComplexSymbol';
|
||||||
|
|
||||||
/** Used to compose unicode character classes. */
|
/** Used to compose unicode character classes. */
|
||||||
var rsAstralRange = '\\ud800-\\udfff',
|
var rsAstralRange = '\\ud800-\\udfff',
|
||||||
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
|
||||||
@@ -24,9 +26,6 @@ var reOptMod = rsModifier + '?',
|
|||||||
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
|
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
|
||||||
var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
|
var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
|
||||||
|
|
||||||
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
|
|
||||||
var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the number of symbols in `string`.
|
* Gets the number of symbols in `string`.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import isSymbol from './isSymbol';
|
import isSymbol from './isSymbol';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Casts `value` to a string if it's not a string or symbol.
|
* Converts `value` to a string key if it's not a string or symbol.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {*} value The value to inspect.
|
* @param {*} value The value to inspect.
|
||||||
* @returns {string|symbol} Returns the cast key.
|
* @returns {string|symbol} Returns the key.
|
||||||
*/
|
*/
|
||||||
function baseCastKey(key) {
|
function toKey(key) {
|
||||||
return (typeof key == 'string' || isSymbol(key)) ? key : (key + '');
|
return (typeof key == 'string' || isSymbol(key)) ? key : (key + '');
|
||||||
}
|
}
|
||||||
|
|
||||||
export default baseCastKey;
|
export default toKey;
|
||||||
23
_toSource.js
Normal file
23
_toSource.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/** Used to resolve the decompiled source of functions. */
|
||||||
|
var funcToString = Function.prototype.toString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts `func` to its source code.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Function} func The function to process.
|
||||||
|
* @returns {string} Returns the source code.
|
||||||
|
*/
|
||||||
|
function toSource(func) {
|
||||||
|
if (func != null) {
|
||||||
|
try {
|
||||||
|
return funcToString.call(func);
|
||||||
|
} catch (e) {}
|
||||||
|
try {
|
||||||
|
return (func + '');
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
export default toSource;
|
||||||
@@ -24,6 +24,7 @@ import intersectionWith from './intersectionWith';
|
|||||||
import join from './join';
|
import join from './join';
|
||||||
import last from './last';
|
import last from './last';
|
||||||
import lastIndexOf from './lastIndexOf';
|
import lastIndexOf from './lastIndexOf';
|
||||||
|
import nth from './nth';
|
||||||
import pull from './pull';
|
import pull from './pull';
|
||||||
import pullAll from './pullAll';
|
import pullAll from './pullAll';
|
||||||
import pullAllBy from './pullAllBy';
|
import pullAllBy from './pullAllBy';
|
||||||
@@ -68,12 +69,12 @@ export default {
|
|||||||
fill, findIndex, findLastIndex, flatten, flattenDeep,
|
fill, findIndex, findLastIndex, flatten, flattenDeep,
|
||||||
flattenDepth, fromPairs, head, indexOf, initial,
|
flattenDepth, fromPairs, head, indexOf, initial,
|
||||||
intersection, intersectionBy, intersectionWith, join, last,
|
intersection, intersectionBy, intersectionWith, join, last,
|
||||||
lastIndexOf, pull, pullAll, pullAllBy, pullAllWith,
|
lastIndexOf, nth, pull, pullAll, pullAllBy,
|
||||||
pullAt, remove, reverse, slice, sortedIndex,
|
pullAllWith, pullAt, remove, reverse, slice,
|
||||||
sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf,
|
sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy,
|
||||||
sortedUniq, sortedUniqBy, tail, take, takeRight,
|
sortedLastIndexOf, sortedUniq, sortedUniqBy, tail, take,
|
||||||
takeRightWhile, takeWhile, union, unionBy, unionWith,
|
takeRight, takeRightWhile, takeWhile, union, unionBy,
|
||||||
uniq, uniqBy, uniqWith, unzip, unzipWith,
|
unionWith, uniq, uniqBy, uniqWith, unzip,
|
||||||
without, xor, xorBy, xorWith, zip,
|
unzipWith, without, xor, xorBy, xorWith,
|
||||||
zipObject, zipObjectDeep, zipWith
|
zip, zipObject, zipObjectDeep, zipWith
|
||||||
};
|
};
|
||||||
|
|||||||
1
array.js
1
array.js
@@ -24,6 +24,7 @@ export { default as intersectionWith } from './intersectionWith';
|
|||||||
export { default as join } from './join';
|
export { default as join } from './join';
|
||||||
export { default as last } from './last';
|
export { default as last } from './last';
|
||||||
export { default as lastIndexOf } from './lastIndexOf';
|
export { default as lastIndexOf } from './lastIndexOf';
|
||||||
|
export { default as nth } from './nth';
|
||||||
export { default as pull } from './pull';
|
export { default as pull } from './pull';
|
||||||
export { default as pullAll } from './pullAll';
|
export { default as pullAll } from './pullAll';
|
||||||
export { default as pullAllBy } from './pullAllBy';
|
export { default as pullAllBy } from './pullAllBy';
|
||||||
|
|||||||
4
ary.js
4
ary.js
@@ -4,8 +4,8 @@ import createWrapper from './_createWrapper';
|
|||||||
var ARY_FLAG = 128;
|
var ARY_FLAG = 128;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that accepts up to `n` arguments, ignoring any
|
* Creates a function that invokes `func`, with up to `n` arguments,
|
||||||
* additional arguments.
|
* ignoring any additional arguments.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import copyObjectWith from './_copyObjectWith';
|
import copyObject from './_copyObject';
|
||||||
import createAssigner from './_createAssigner';
|
import createAssigner from './_createAssigner';
|
||||||
import keysIn from './keysIn';
|
import keysIn from './keysIn';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is like `_.assignIn` except that it accepts `customizer`
|
* This method is like `_.assignIn` except that it accepts `customizer`
|
||||||
* which is invoked to produce the assigned values. If `customizer` returns
|
* which is invoked to produce the assigned values. If `customizer` returns
|
||||||
* `undefined` assignment is handled by the method instead. The `customizer`
|
* `undefined`, assignment is handled by the method instead. The `customizer`
|
||||||
* is invoked with five arguments: (objValue, srcValue, key, object, source).
|
* is invoked with five arguments: (objValue, srcValue, key, object, source).
|
||||||
*
|
*
|
||||||
* **Note:** This method mutates `object`.
|
* **Note:** This method mutates `object`.
|
||||||
@@ -31,7 +31,7 @@ import keysIn from './keysIn';
|
|||||||
* // => { 'a': 1, 'b': 2 }
|
* // => { 'a': 1, 'b': 2 }
|
||||||
*/
|
*/
|
||||||
var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
|
var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
|
||||||
copyObjectWith(source, keysIn(source), object, customizer);
|
copyObject(source, keysIn(source), object, customizer);
|
||||||
});
|
});
|
||||||
|
|
||||||
export default assignInWith;
|
export default assignInWith;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import copyObjectWith from './_copyObjectWith';
|
import copyObject from './_copyObject';
|
||||||
import createAssigner from './_createAssigner';
|
import createAssigner from './_createAssigner';
|
||||||
import keys from './keys';
|
import keys from './keys';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is like `_.assign` except that it accepts `customizer`
|
* This method is like `_.assign` except that it accepts `customizer`
|
||||||
* which is invoked to produce the assigned values. If `customizer` returns
|
* which is invoked to produce the assigned values. If `customizer` returns
|
||||||
* `undefined` assignment is handled by the method instead. The `customizer`
|
* `undefined`, assignment is handled by the method instead. The `customizer`
|
||||||
* is invoked with five arguments: (objValue, srcValue, key, object, source).
|
* is invoked with five arguments: (objValue, srcValue, key, object, source).
|
||||||
*
|
*
|
||||||
* **Note:** This method mutates `object`.
|
* **Note:** This method mutates `object`.
|
||||||
@@ -30,7 +30,7 @@ import keys from './keys';
|
|||||||
* // => { 'a': 1, 'b': 2 }
|
* // => { 'a': 1, 'b': 2 }
|
||||||
*/
|
*/
|
||||||
var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
|
var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
|
||||||
copyObjectWith(source, keys(source), object, customizer);
|
copyObject(source, keys(source), object, customizer);
|
||||||
});
|
});
|
||||||
|
|
||||||
export default assignWith;
|
export default assignWith;
|
||||||
|
|||||||
3
at.js
3
at.js
@@ -10,8 +10,7 @@ import rest from './rest';
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @category Object
|
* @category Object
|
||||||
* @param {Object} object The object to iterate over.
|
* @param {Object} object The object to iterate over.
|
||||||
* @param {...(string|string[])} [paths] The property paths of elements to pick,
|
* @param {...(string|string[])} [paths] The property paths of elements to pick.
|
||||||
* specified individually or in arrays.
|
|
||||||
* @returns {Array} Returns the new array of picked elements.
|
* @returns {Array} Returns the new array of picked elements.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
|
|||||||
3
bind.js
3
bind.js
@@ -9,8 +9,7 @@ var BIND_FLAG = 1,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that invokes `func` with the `this` binding of `thisArg`
|
* Creates a function that invokes `func` with the `this` binding of `thisArg`
|
||||||
* and prepends any additional `_.bind` arguments to those provided to the
|
* and `partials` prepended to the arguments it receives.
|
||||||
* bound function.
|
|
||||||
*
|
*
|
||||||
* The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
|
* The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
|
||||||
* may be used as a placeholder for partially applied arguments.
|
* may be used as a placeholder for partially applied arguments.
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ import rest from './rest';
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @category Util
|
* @category Util
|
||||||
* @param {Object} object The object to bind and assign the bound methods to.
|
* @param {Object} object The object to bind and assign the bound methods to.
|
||||||
* @param {...(string|string[])} methodNames The object method names to bind,
|
* @param {...(string|string[])} methodNames The object method names to bind.
|
||||||
* specified individually or in arrays.
|
|
||||||
* @returns {Object} Returns `object`.
|
* @returns {Object} Returns `object`.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ var BIND_FLAG = 1,
|
|||||||
PARTIAL_FLAG = 32;
|
PARTIAL_FLAG = 32;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that invokes the method at `object[key]` and prepends
|
* Creates a function that invokes the method at `object[key]` with `partials`
|
||||||
* any additional `_.bindKey` arguments to those provided to the bound function.
|
* prepended to the arguments it receives.
|
||||||
*
|
*
|
||||||
* This method differs from `_.bind` by allowing bound functions to reference
|
* This method differs from `_.bind` by allowing bound functions to reference
|
||||||
* methods that may be redefined or don't yet exist. See
|
* methods that may be redefined or don't yet exist. See
|
||||||
|
|||||||
13
chunk.js
13
chunk.js
@@ -1,4 +1,5 @@
|
|||||||
import baseSlice from './_baseSlice';
|
import baseSlice from './_baseSlice';
|
||||||
|
import isIterateeCall from './_isIterateeCall';
|
||||||
import toInteger from './toInteger';
|
import toInteger from './toInteger';
|
||||||
|
|
||||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||||
@@ -15,7 +16,8 @@ var nativeCeil = Math.ceil,
|
|||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
* @category Array
|
* @category Array
|
||||||
* @param {Array} array The array to process.
|
* @param {Array} array The array to process.
|
||||||
* @param {number} [size=0] The length of each chunk.
|
* @param {number} [size=1] The length of each chunk
|
||||||
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
||||||
* @returns {Array} Returns the new array containing chunks.
|
* @returns {Array} Returns the new array containing chunks.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
@@ -25,9 +27,12 @@ var nativeCeil = Math.ceil,
|
|||||||
* _.chunk(['a', 'b', 'c', 'd'], 3);
|
* _.chunk(['a', 'b', 'c', 'd'], 3);
|
||||||
* // => [['a', 'b', 'c'], ['d']]
|
* // => [['a', 'b', 'c'], ['d']]
|
||||||
*/
|
*/
|
||||||
function chunk(array, size) {
|
function chunk(array, size, guard) {
|
||||||
size = nativeMax(toInteger(size), 0);
|
if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
|
||||||
|
size = 1;
|
||||||
|
} else {
|
||||||
|
size = nativeMax(toInteger(size), 0);
|
||||||
|
}
|
||||||
var length = array ? array.length : 0;
|
var length = array ? array.length : 0;
|
||||||
if (!length || size < 1) {
|
if (!length || size < 1) {
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import baseClone from './_baseClone';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is like `_.clone` except that it accepts `customizer` which
|
* This method is like `_.clone` except that it accepts `customizer` which
|
||||||
* is invoked to produce the cloned value. If `customizer` returns `undefined`
|
* is invoked to produce the cloned value. If `customizer` returns `undefined`,
|
||||||
* cloning is handled by the method instead. The `customizer` is invoked with
|
* cloning is handled by the method instead. The `customizer` is invoked with
|
||||||
* up to four arguments; (value [, index|key, object, stack]).
|
* up to four arguments; (value [, index|key, object, stack]).
|
||||||
*
|
*
|
||||||
|
|||||||
2
cond.js
2
cond.js
@@ -7,7 +7,7 @@ import rest from './rest';
|
|||||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that iterates over `pairs` invoking the corresponding
|
* Creates a function that iterates over `pairs` and invokes the corresponding
|
||||||
* function of the first predicate to return truthy. The predicate-function
|
* function of the first predicate to return truthy. The predicate-function
|
||||||
* pairs are invoked with the `this` binding and arguments of the created
|
* pairs are invoked with the `this` binding and arguments of the created
|
||||||
* function.
|
* function.
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an object composed of keys generated from the results of running
|
* Creates an object composed of keys generated from the results of running
|
||||||
* each element of `collection` through `iteratee`. The corresponding value
|
* each element of `collection` thru `iteratee`. The corresponding value of
|
||||||
* of each key is the number of times the key was returned by `iteratee`.
|
* each key is the number of times the key was returned by `iteratee`. The
|
||||||
* The iteratee is invoked with one argument: (value).
|
* iteratee is invoked with one argument: (value).
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import baseCreate from './_baseCreate';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an object that inherits from the `prototype` object. If a
|
* Creates an object that inherits from the `prototype` object. If a
|
||||||
* `properties` object is given its own enumerable string keyed properties
|
* `properties` object is given, its own enumerable string keyed properties
|
||||||
* are assigned to the created object.
|
* are assigned to the created object.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ var nativeMax = Math.max,
|
|||||||
* on the trailing edge of the timeout only if the debounced function is
|
* on the trailing edge of the timeout only if the debounced function is
|
||||||
* invoked more than once during the `wait` timeout.
|
* invoked more than once during the `wait` timeout.
|
||||||
*
|
*
|
||||||
* See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
|
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
||||||
* for details over the differences between `_.debounce` and `_.throttle`.
|
* for details over the differences between `_.debounce` and `_.throttle`.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
@@ -169,6 +169,9 @@ function debounce(func, wait, options) {
|
|||||||
timerId = setTimeout(timerExpired, wait);
|
timerId = setTimeout(timerExpired, wait);
|
||||||
return invokeFunc(lastCallTime);
|
return invokeFunc(lastCallTime);
|
||||||
}
|
}
|
||||||
|
if (timerId === undefined) {
|
||||||
|
timerId = setTimeout(timerExpired, wait);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
debounced.cancel = cancel;
|
debounced.cancel = cancel;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import rest from './rest';
|
|||||||
*/
|
*/
|
||||||
var difference = rest(function(array, values) {
|
var difference = rest(function(array, values) {
|
||||||
return isArrayLikeObject(array)
|
return isArrayLikeObject(array)
|
||||||
? baseDifference(array, baseFlatten(values, 1, true))
|
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
|
||||||
: [];
|
: [];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ var differenceBy = rest(function(array, values) {
|
|||||||
iteratee = undefined;
|
iteratee = undefined;
|
||||||
}
|
}
|
||||||
return isArrayLikeObject(array)
|
return isArrayLikeObject(array)
|
||||||
? baseDifference(array, baseFlatten(values, 1, true), baseIteratee(iteratee))
|
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee))
|
||||||
: [];
|
: [];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ var differenceWith = rest(function(array, values) {
|
|||||||
comparator = undefined;
|
comparator = undefined;
|
||||||
}
|
}
|
||||||
return isArrayLikeObject(array)
|
return isArrayLikeObject(array)
|
||||||
? baseDifference(array, baseFlatten(values, 1, true), undefined, comparator)
|
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
|
||||||
: [];
|
: [];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import toString from './toString';
|
import toString from './toString';
|
||||||
|
|
||||||
/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */
|
/**
|
||||||
|
* Used to match `RegExp`
|
||||||
|
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
|
||||||
|
*/
|
||||||
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
|
||||||
reHasRegExpChar = RegExp(reRegExpChar.source);
|
reHasRegExpChar = RegExp(reRegExpChar.source);
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import map from './map';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a flattened array of values by running each element in `collection`
|
* Creates a flattened array of values by running each element in `collection`
|
||||||
* through `iteratee` and flattening the mapped results. The iteratee is
|
* thru `iteratee` and flattening the mapped results. The iteratee is invoked
|
||||||
* invoked with three arguments: (value, index|key, collection).
|
* with three arguments: (value, index|key, collection).
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import baseIteratee from './_baseIteratee';
|
|||||||
import isArray from './isArray';
|
import isArray from './isArray';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterates over elements of `collection` invoking `iteratee` for each element.
|
* Iterates over elements of `collection` and invokes `iteratee` for each element.
|
||||||
* The iteratee is invoked with three arguments: (value, index|key, collection).
|
* The iteratee is invoked with three arguments: (value, index|key, collection).
|
||||||
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
||||||
*
|
*
|
||||||
|
|||||||
6
forIn.js
6
forIn.js
@@ -4,9 +4,9 @@ import keysIn from './keysIn';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterates over own and inherited enumerable string keyed properties of an
|
* Iterates over own and inherited enumerable string keyed properties of an
|
||||||
* object invoking `iteratee` for each property. The iteratee is invoked with
|
* object and invokes `iteratee` for each property. The iteratee is invoked
|
||||||
* three arguments: (value, key, object). Iteratee functions may exit iteration
|
* with three arguments: (value, key, object). Iteratee functions may exit
|
||||||
* early by explicitly returning `false`.
|
* iteration early by explicitly returning `false`.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import baseForOwn from './_baseForOwn';
|
|||||||
import baseIteratee from './_baseIteratee';
|
import baseIteratee from './_baseIteratee';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterates over own enumerable string keyed properties of an object invoking
|
* Iterates over own enumerable string keyed properties of an object and
|
||||||
* `iteratee` for each property. The iteratee is invoked with three arguments:
|
* invokes `iteratee` for each property. The iteratee is invoked with three
|
||||||
* (value, key, object). Iteratee functions may exit iteration early by
|
* arguments: (value, key, object). Iteratee functions may exit iteration
|
||||||
* explicitly returning `false`.
|
* early by explicitly returning `false`.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
2
get.js
2
get.js
@@ -2,7 +2,7 @@ import baseGet from './_baseGet';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value at `path` of `object`. If the resolved value is
|
* 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
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -8,9 +8,10 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an object composed of keys generated from the results of running
|
* Creates an object composed of keys generated from the results of running
|
||||||
* each element of `collection` through `iteratee`. The corresponding value
|
* each element of `collection` thru `iteratee`. The order of grouped values
|
||||||
* of each key is an array of elements responsible for generating the key.
|
* is determined by the order they occur in `collection`. The corresponding
|
||||||
* The iteratee is invoked with one argument: (value).
|
* value of each key is an array of elements responsible for generating the
|
||||||
|
* key. The iteratee is invoked with one argument: (value).
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
10
has.js
10
has.js
@@ -13,23 +13,23 @@ import hasPath from './_hasPath';
|
|||||||
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* var object = { 'a': { 'b': { 'c': 3 } } };
|
* var object = { 'a': { 'b': 2 } };
|
||||||
* var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
|
* var other = _.create({ 'a': _.create({ 'b': 2 }) });
|
||||||
*
|
*
|
||||||
* _.has(object, 'a');
|
* _.has(object, 'a');
|
||||||
* // => true
|
* // => true
|
||||||
*
|
*
|
||||||
* _.has(object, 'a.b.c');
|
* _.has(object, 'a.b');
|
||||||
* // => true
|
* // => true
|
||||||
*
|
*
|
||||||
* _.has(object, ['a', 'b', 'c']);
|
* _.has(object, ['a', 'b']);
|
||||||
* // => true
|
* // => true
|
||||||
*
|
*
|
||||||
* _.has(other, 'a');
|
* _.has(other, 'a');
|
||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function has(object, path) {
|
function has(object, path) {
|
||||||
return hasPath(object, path, baseHas);
|
return object != null && hasPath(object, path, baseHas);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default has;
|
export default has;
|
||||||
|
|||||||
8
hasIn.js
8
hasIn.js
@@ -13,22 +13,22 @@ import hasPath from './_hasPath';
|
|||||||
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
|
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
|
||||||
*
|
*
|
||||||
* _.hasIn(object, 'a');
|
* _.hasIn(object, 'a');
|
||||||
* // => true
|
* // => true
|
||||||
*
|
*
|
||||||
* _.hasIn(object, 'a.b.c');
|
* _.hasIn(object, 'a.b');
|
||||||
* // => true
|
* // => true
|
||||||
*
|
*
|
||||||
* _.hasIn(object, ['a', 'b', 'c']);
|
* _.hasIn(object, ['a', 'b']);
|
||||||
* // => true
|
* // => true
|
||||||
*
|
*
|
||||||
* _.hasIn(object, 'b');
|
* _.hasIn(object, 'b');
|
||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function hasIn(object, path) {
|
function hasIn(object, path) {
|
||||||
return hasPath(object, path, baseHasIn);
|
return object != null && hasPath(object, path, baseHasIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default hasIn;
|
export default hasIn;
|
||||||
|
|||||||
2
head.js
2
head.js
@@ -17,7 +17,7 @@
|
|||||||
* // => undefined
|
* // => undefined
|
||||||
*/
|
*/
|
||||||
function head(array) {
|
function head(array) {
|
||||||
return array ? array[0] : undefined;
|
return (array && array.length) ? array[0] : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default head;
|
export default head;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import toNumber from './toNumber';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `n` is between `start` and up to but not including, `end`. If
|
* Checks if `n` is between `start` and up to but not including, `end`. If
|
||||||
* `end` is not specified it's set to `start` with `start` then set to `0`.
|
* `end` is not specified, it's set to `start` with `start` then set to `0`.
|
||||||
* If `start` is greater than `end` the params are swapped to support
|
* If `start` is greater than `end` the params are swapped to support
|
||||||
* negative ranges.
|
* negative ranges.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import values from './values';
|
|||||||
var nativeMax = Math.max;
|
var nativeMax = Math.max;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `value` is in `collection`. If `collection` is a string it's
|
* Checks if `value` is in `collection`. If `collection` is a string, it's
|
||||||
* checked for a substring of `value`, otherwise
|
* checked for a substring of `value`, otherwise
|
||||||
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||||
* is used for equality comparisons. If `fromIndex` is negative, it's used as
|
* is used for equality comparisons. If `fromIndex` is negative, it's used as
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ var nativeMax = Math.max;
|
|||||||
/**
|
/**
|
||||||
* Gets the index at which the first occurrence of `value` is found in `array`
|
* Gets the index at which the first occurrence of `value` is found in `array`
|
||||||
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||||
* for equality comparisons. If `fromIndex` is negative, it's used as the offset
|
* for equality comparisons. If `fromIndex` is negative, it's used as the
|
||||||
* from the end of `array`.
|
* offset from the end of `array`.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import arrayMap from './_arrayMap';
|
import arrayMap from './_arrayMap';
|
||||||
import baseCastArrayLikeObject from './_baseCastArrayLikeObject';
|
|
||||||
import baseIntersection from './_baseIntersection';
|
import baseIntersection from './_baseIntersection';
|
||||||
|
import castArrayLikeObject from './_castArrayLikeObject';
|
||||||
import rest from './rest';
|
import rest from './rest';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,7 +21,7 @@ import rest from './rest';
|
|||||||
* // => [2]
|
* // => [2]
|
||||||
*/
|
*/
|
||||||
var intersection = rest(function(arrays) {
|
var intersection = rest(function(arrays) {
|
||||||
var mapped = arrayMap(arrays, baseCastArrayLikeObject);
|
var mapped = arrayMap(arrays, castArrayLikeObject);
|
||||||
return (mapped.length && mapped[0] === arrays[0])
|
return (mapped.length && mapped[0] === arrays[0])
|
||||||
? baseIntersection(mapped)
|
? baseIntersection(mapped)
|
||||||
: [];
|
: [];
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import arrayMap from './_arrayMap';
|
import arrayMap from './_arrayMap';
|
||||||
import baseCastArrayLikeObject from './_baseCastArrayLikeObject';
|
|
||||||
import baseIntersection from './_baseIntersection';
|
import baseIntersection from './_baseIntersection';
|
||||||
import baseIteratee from './_baseIteratee';
|
import baseIteratee from './_baseIteratee';
|
||||||
|
import castArrayLikeObject from './_castArrayLikeObject';
|
||||||
import last from './last';
|
import last from './last';
|
||||||
import rest from './rest';
|
import rest from './rest';
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ import rest from './rest';
|
|||||||
*/
|
*/
|
||||||
var intersectionBy = rest(function(arrays) {
|
var intersectionBy = rest(function(arrays) {
|
||||||
var iteratee = last(arrays),
|
var iteratee = last(arrays),
|
||||||
mapped = arrayMap(arrays, baseCastArrayLikeObject);
|
mapped = arrayMap(arrays, castArrayLikeObject);
|
||||||
|
|
||||||
if (iteratee === last(mapped)) {
|
if (iteratee === last(mapped)) {
|
||||||
iteratee = undefined;
|
iteratee = undefined;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import arrayMap from './_arrayMap';
|
import arrayMap from './_arrayMap';
|
||||||
import baseCastArrayLikeObject from './_baseCastArrayLikeObject';
|
|
||||||
import baseIntersection from './_baseIntersection';
|
import baseIntersection from './_baseIntersection';
|
||||||
|
import castArrayLikeObject from './_castArrayLikeObject';
|
||||||
import last from './last';
|
import last from './last';
|
||||||
import rest from './rest';
|
import rest from './rest';
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ import rest from './rest';
|
|||||||
*/
|
*/
|
||||||
var intersectionWith = rest(function(arrays) {
|
var intersectionWith = rest(function(arrays) {
|
||||||
var comparator = last(arrays),
|
var comparator = last(arrays),
|
||||||
mapped = arrayMap(arrays, baseCastArrayLikeObject);
|
mapped = arrayMap(arrays, castArrayLikeObject);
|
||||||
|
|
||||||
if (comparator === last(mapped)) {
|
if (comparator === last(mapped)) {
|
||||||
comparator = undefined;
|
comparator = undefined;
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is like `_.invert` except that the inverted object is generated
|
* This method is like `_.invert` except that the inverted object is generated
|
||||||
* from the results of running each element of `object` through `iteratee`.
|
* from the results of running each element of `object` thru `iteratee`. The
|
||||||
* The corresponding inverted value of each inverted key is an array of keys
|
* corresponding inverted value of each inverted key is an array of keys
|
||||||
* responsible for generating the inverted value. The iteratee is invoked
|
* responsible for generating the inverted value. The iteratee is invoked
|
||||||
* with one argument: (value).
|
* with one argument: (value).
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import rest from './rest';
|
|||||||
/**
|
/**
|
||||||
* Invokes the method at `path` of each element in `collection`, returning
|
* Invokes the method at `path` of each element in `collection`, returning
|
||||||
* an array of the results of each invoked method. Any additional arguments
|
* an array of the results of each invoked method. Any additional arguments
|
||||||
* are provided to each invoked method. If `methodName` is a function it's
|
* are provided to each invoked method. If `methodName` is a function, it's
|
||||||
* invoked for, and `this` bound to, each element in `collection`.
|
* invoked for and `this` bound to, each element in `collection`.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ var objectProto = Object.prototype;
|
|||||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ var arrayBufferTag = '[object ArrayBuffer]';
|
|||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ var boolTag = '[object Boolean]';
|
|||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ var dateTag = '[object Date]';
|
|||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import baseIsEqual from './_baseIsEqual';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is like `_.isEqual` except that it accepts `customizer` which
|
* This method is like `_.isEqual` except that it accepts `customizer` which
|
||||||
* is invoked to compare values. If `customizer` returns `undefined` comparisons
|
* is invoked to compare values. If `customizer` returns `undefined`, comparisons
|
||||||
* are handled by the method instead. The `customizer` is invoked with up to
|
* are handled by the method instead. The `customizer` is invoked with up to
|
||||||
* six arguments: (objValue, othValue [, index|key, object, other, stack]).
|
* six arguments: (objValue, othValue [, index|key, object, other, stack]).
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ var errorTag = '[object Error]';
|
|||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ var funcTag = '[object Function]',
|
|||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import getMatchData from './_getMatchData';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is like `_.isMatch` except that it accepts `customizer` which
|
* This method is like `_.isMatch` except that it accepts `customizer` which
|
||||||
* is invoked to compare values. If `customizer` returns `undefined` comparisons
|
* is invoked to compare values. If `customizer` returns `undefined`, comparisons
|
||||||
* are handled by the method instead. The `customizer` is invoked with five
|
* are handled by the method instead. The `customizer` is invoked with five
|
||||||
* arguments: (objValue, srcValue, index|key, object, source).
|
* arguments: (objValue, srcValue, index|key, object, source).
|
||||||
*
|
*
|
||||||
|
|||||||
7
isNaN.js
7
isNaN.js
@@ -3,9 +3,10 @@ import isNumber from './isNumber';
|
|||||||
/**
|
/**
|
||||||
* Checks if `value` is `NaN`.
|
* Checks if `value` is `NaN`.
|
||||||
*
|
*
|
||||||
* **Note:** This method is not the same as
|
* **Note:** This method is based on
|
||||||
* [`isNaN`](https://es5.github.io/#x15.1.2.4) which returns `true` for
|
* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
|
||||||
* `undefined` and other non-numeric values.
|
* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
|
||||||
|
* `undefined` and other non-number values.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
17
isNative.js
17
isNative.js
@@ -1,8 +1,12 @@
|
|||||||
import isFunction from './isFunction';
|
import isFunction from './isFunction';
|
||||||
import isHostObject from './_isHostObject';
|
import isHostObject from './_isHostObject';
|
||||||
import isObjectLike from './isObjectLike';
|
import isObject from './isObject';
|
||||||
|
import toSource from './_toSource';
|
||||||
|
|
||||||
/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */
|
/**
|
||||||
|
* Used to match `RegExp`
|
||||||
|
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
|
||||||
|
*/
|
||||||
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
||||||
|
|
||||||
/** Used to detect host constructors (Safari). */
|
/** Used to detect host constructors (Safari). */
|
||||||
@@ -42,14 +46,11 @@ var reIsNative = RegExp('^' +
|
|||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isNative(value) {
|
function isNative(value) {
|
||||||
if (value == null) {
|
if (!isObject(value)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (isFunction(value)) {
|
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
|
||||||
return reIsNative.test(funcToString.call(value));
|
return pattern.test(toSource(value));
|
||||||
}
|
|
||||||
return isObjectLike(value) &&
|
|
||||||
(isHostObject(value) ? reIsNative : reIsHostCtor).test(value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default isNative;
|
export default isNative;
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ var numberTag = '[object Number]';
|
|||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
|
* Checks if `value` is the
|
||||||
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
|
||||||
|
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
|||||||
var objectCtorString = funcToString.call(Object);
|
var objectCtorString = funcToString.call(Object);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ var regexpTag = '[object RegExp]';
|
|||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ var stringTag = '[object String]';
|
|||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ var symbolTag = '[object Symbol]';
|
|||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ typedArrayTags[weakMapTag] = false;
|
|||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ var weakSetTag = '[object WeakSet]';
|
|||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import baseIteratee from './_baseIteratee';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a function that invokes `func` with the arguments of the created
|
* Creates a function that invokes `func` with the arguments of the created
|
||||||
* function. If `func` is a property name the created function returns the
|
* function. If `func` is a property name, the created function returns the
|
||||||
* property value for a given element. If `func` is an array or object the
|
* property value for a given element. If `func` is an array or object, the
|
||||||
* created function returns `true` for elements that contain the equivalent
|
* created function returns `true` for elements that contain the equivalent
|
||||||
* source properties, otherwise it returns `false`.
|
* source properties, otherwise it returns `false`.
|
||||||
*
|
*
|
||||||
|
|||||||
4
keyBy.js
4
keyBy.js
@@ -2,8 +2,8 @@ import createAggregator from './_createAggregator';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an object composed of keys generated from the results of running
|
* Creates an object composed of keys generated from the results of running
|
||||||
* each element of `collection` through `iteratee`. The corresponding value
|
* each element of `collection` thru `iteratee`. The corresponding value of
|
||||||
* of each key is the last element responsible for generating the key. The
|
* each key is the last element responsible for generating the key. The
|
||||||
* iteratee is invoked with one argument: (value).
|
* iteratee is invoked with one argument: (value).
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @license
|
* @license
|
||||||
* lodash 4.7.0 (Custom Build) <https://lodash.com/>
|
* lodash 4.11.0 (Custom Build) <https://lodash.com/>
|
||||||
* Build: `lodash modularize exports="es" -o ./`
|
* Build: `lodash modularize exports="es" -o ./`
|
||||||
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||||
* Released under MIT license <https://lodash.com/license>
|
* Released under MIT license <https://lodash.com/license>
|
||||||
@@ -44,7 +44,7 @@ import toInteger from './toInteger';
|
|||||||
import lodash from './wrapperLodash';
|
import lodash from './wrapperLodash';
|
||||||
|
|
||||||
/** Used as the semantic version number. */
|
/** Used as the semantic version number. */
|
||||||
var VERSION = '4.7.0';
|
var VERSION = '4.11.0';
|
||||||
|
|
||||||
/** Used to compose bitmasks for wrapper metadata. */
|
/** Used to compose bitmasks for wrapper metadata. */
|
||||||
var BIND_KEY_FLAG = 2;
|
var BIND_KEY_FLAG = 2;
|
||||||
@@ -342,6 +342,7 @@ lodash.meanBy = math.meanBy;
|
|||||||
lodash.min = math.min;
|
lodash.min = math.min;
|
||||||
lodash.minBy = math.minBy;
|
lodash.minBy = math.minBy;
|
||||||
lodash.multiply = math.multiply;
|
lodash.multiply = math.multiply;
|
||||||
|
lodash.nth = array.nth;
|
||||||
lodash.noop = util.noop;
|
lodash.noop = util.noop;
|
||||||
lodash.now = date.now;
|
lodash.now = date.now;
|
||||||
lodash.pad = string.pad;
|
lodash.pad = string.pad;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @license
|
* @license
|
||||||
* lodash 4.7.0 (Custom Build) <https://lodash.com/>
|
* lodash 4.11.0 (Custom Build) <https://lodash.com/>
|
||||||
* Build: `lodash modularize exports="es" -o ./`
|
* Build: `lodash modularize exports="es" -o ./`
|
||||||
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||||
* Released under MIT license <https://lodash.com/license>
|
* Released under MIT license <https://lodash.com/license>
|
||||||
@@ -184,6 +184,7 @@ export { default as negate } from './negate';
|
|||||||
export { default as next } from './next';
|
export { default as next } from './next';
|
||||||
export { default as noop } from './noop';
|
export { default as noop } from './noop';
|
||||||
export { default as now } from './now';
|
export { default as now } from './now';
|
||||||
|
export { default as nth } from './nth';
|
||||||
export { default as nthArg } from './nthArg';
|
export { default as nthArg } from './nthArg';
|
||||||
export { default as omit } from './omit';
|
export { default as omit } from './omit';
|
||||||
export { default as omitBy } from './omitBy';
|
export { default as omitBy } from './omitBy';
|
||||||
|
|||||||
10
map.js
10
map.js
@@ -4,7 +4,7 @@ import baseMap from './_baseMap';
|
|||||||
import isArray from './isArray';
|
import isArray from './isArray';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an array of values by running each element in `collection` through
|
* Creates an array of values by running each element in `collection` thru
|
||||||
* `iteratee`. The iteratee is invoked with three arguments:
|
* `iteratee`. The iteratee is invoked with three arguments:
|
||||||
* (value, index|key, collection).
|
* (value, index|key, collection).
|
||||||
*
|
*
|
||||||
@@ -12,10 +12,10 @@ import isArray from './isArray';
|
|||||||
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
|
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
|
||||||
*
|
*
|
||||||
* The guarded methods are:
|
* The guarded methods are:
|
||||||
* `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`,
|
* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
|
||||||
* `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`,
|
* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
|
||||||
* `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`,
|
* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
|
||||||
* and `words`
|
* `template`, `trim`, `trimEnd`, `trimStart`, and `words`
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import baseIteratee from './_baseIteratee';
|
|||||||
/**
|
/**
|
||||||
* The opposite of `_.mapValues`; this method creates an object with the
|
* The opposite of `_.mapValues`; this method creates an object with the
|
||||||
* same values as `object` and keys generated by running each own enumerable
|
* same values as `object` and keys generated by running each own enumerable
|
||||||
* string keyed property of `object` through `iteratee`. The iteratee is
|
* string keyed property of `object` thru `iteratee`. The iteratee is invoked
|
||||||
* invoked with three arguments: (value, key, object).
|
* with three arguments: (value, key, object).
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import baseForOwn from './_baseForOwn';
|
|||||||
import baseIteratee from './_baseIteratee';
|
import baseIteratee from './_baseIteratee';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an object with the same keys as `object` and values generated by
|
* Creates an object with the same keys as `object` and values generated
|
||||||
* running each own enumerable string keyed property of `object` through
|
* by running each own enumerable string keyed property of `object` thru
|
||||||
* `iteratee`. The iteratee is invoked with three arguments:
|
* `iteratee`. The iteratee is invoked with three arguments:
|
||||||
* (value, key, object).
|
* (value, key, object).
|
||||||
*
|
*
|
||||||
|
|||||||
2
max.js
2
max.js
@@ -3,7 +3,7 @@ import gt from './gt';
|
|||||||
import identity from './identity';
|
import identity from './identity';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Computes the maximum value of `array`. If `array` is empty or falsey
|
* Computes the maximum value of `array`. If `array` is empty or falsey,
|
||||||
* `undefined` is returned.
|
* `undefined` is returned.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user