mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Bump to v4.12.0.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# lodash-amd v4.11.2
|
||||
# lodash-amd v4.12.0
|
||||
|
||||
The [Lodash](https://lodash.com/) library exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
|
||||
|
||||
@@ -27,4 +27,4 @@ require({
|
||||
});
|
||||
```
|
||||
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.11.2-amd) for more details.
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.12.0-amd) for more details.
|
||||
|
||||
26
_Hash.js
26
_Hash.js
@@ -1,19 +1,29 @@
|
||||
define(['./_nativeCreate'], function(nativeCreate) {
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
define(['./_hashClear', './_hashDelete', './_hashGet', './_hashHas', './_hashSet'], function(hashClear, hashDelete, hashGet, hashHas, hashSet) {
|
||||
|
||||
/**
|
||||
* Creates a hash object.
|
||||
*
|
||||
* @private
|
||||
* @constructor
|
||||
* @returns {Object} Returns the new hash object.
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
function Hash() {}
|
||||
function Hash(entries) {
|
||||
var index = -1,
|
||||
length = entries ? entries.length : 0;
|
||||
|
||||
// Avoid inheriting from `Object.prototype` when possible.
|
||||
Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;
|
||||
this.clear();
|
||||
while (++index < length) {
|
||||
var entry = entries[index];
|
||||
this.set(entry[0], entry[1]);
|
||||
}
|
||||
}
|
||||
|
||||
// Add methods to `Hash`.
|
||||
Hash.prototype.clear = hashClear;
|
||||
Hash.prototype['delete'] = hashDelete;
|
||||
Hash.prototype.get = hashGet;
|
||||
Hash.prototype.has = hashHas;
|
||||
Hash.prototype.set = hashSet;
|
||||
|
||||
return Hash;
|
||||
});
|
||||
|
||||
29
_ListCache.js
Normal file
29
_ListCache.js
Normal file
@@ -0,0 +1,29 @@
|
||||
define(['./_listCacheClear', './_listCacheDelete', './_listCacheGet', './_listCacheHas', './_listCacheSet'], function(listCacheClear, listCacheDelete, listCacheGet, listCacheHas, listCacheSet) {
|
||||
|
||||
/**
|
||||
* Creates an list cache object.
|
||||
*
|
||||
* @private
|
||||
* @constructor
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
function ListCache(entries) {
|
||||
var index = -1,
|
||||
length = entries ? entries.length : 0;
|
||||
|
||||
this.clear();
|
||||
while (++index < length) {
|
||||
var entry = entries[index];
|
||||
this.set(entry[0], entry[1]);
|
||||
}
|
||||
}
|
||||
|
||||
// Add methods to `ListCache`.
|
||||
ListCache.prototype.clear = listCacheClear;
|
||||
ListCache.prototype['delete'] = listCacheDelete;
|
||||
ListCache.prototype.get = listCacheGet;
|
||||
ListCache.prototype.has = listCacheHas;
|
||||
ListCache.prototype.set = listCacheSet;
|
||||
|
||||
return ListCache;
|
||||
});
|
||||
20
_MapCache.js
20
_MapCache.js
@@ -1,29 +1,29 @@
|
||||
define(['./_mapClear', './_mapDelete', './_mapGet', './_mapHas', './_mapSet'], function(mapClear, mapDelete, mapGet, mapHas, mapSet) {
|
||||
define(['./_mapCacheClear', './_mapCacheDelete', './_mapCacheGet', './_mapCacheHas', './_mapCacheSet'], function(mapCacheClear, mapCacheDelete, mapCacheGet, mapCacheHas, mapCacheSet) {
|
||||
|
||||
/**
|
||||
* Creates a map cache object to store key-value pairs.
|
||||
*
|
||||
* @private
|
||||
* @constructor
|
||||
* @param {Array} [values] The values to cache.
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
function MapCache(values) {
|
||||
function MapCache(entries) {
|
||||
var index = -1,
|
||||
length = values ? values.length : 0;
|
||||
length = entries ? entries.length : 0;
|
||||
|
||||
this.clear();
|
||||
while (++index < length) {
|
||||
var entry = values[index];
|
||||
var entry = entries[index];
|
||||
this.set(entry[0], entry[1]);
|
||||
}
|
||||
}
|
||||
|
||||
// Add methods to `MapCache`.
|
||||
MapCache.prototype.clear = mapClear;
|
||||
MapCache.prototype['delete'] = mapDelete;
|
||||
MapCache.prototype.get = mapGet;
|
||||
MapCache.prototype.has = mapHas;
|
||||
MapCache.prototype.set = mapSet;
|
||||
MapCache.prototype.clear = mapCacheClear;
|
||||
MapCache.prototype['delete'] = mapCacheDelete;
|
||||
MapCache.prototype.get = mapCacheGet;
|
||||
MapCache.prototype.has = mapCacheHas;
|
||||
MapCache.prototype.set = mapCacheSet;
|
||||
|
||||
return MapCache;
|
||||
});
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
define(['./_MapCache', './_cachePush'], function(MapCache, cachePush) {
|
||||
define(['./_MapCache', './_setCacheAdd', './_setCacheHas'], function(MapCache, setCacheAdd, setCacheHas) {
|
||||
|
||||
/**
|
||||
*
|
||||
* Creates a set cache object to store unique values.
|
||||
* Creates an array cache object to store unique values.
|
||||
*
|
||||
* @private
|
||||
* @constructor
|
||||
@@ -14,12 +14,13 @@ define(['./_MapCache', './_cachePush'], function(MapCache, cachePush) {
|
||||
|
||||
this.__data__ = new MapCache;
|
||||
while (++index < length) {
|
||||
this.push(values[index]);
|
||||
this.add(values[index]);
|
||||
}
|
||||
}
|
||||
|
||||
// Add methods to `SetCache`.
|
||||
SetCache.prototype.push = cachePush;
|
||||
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
||||
SetCache.prototype.has = setCacheHas;
|
||||
|
||||
return SetCache;
|
||||
});
|
||||
|
||||
15
_Stack.js
15
_Stack.js
@@ -1,21 +1,14 @@
|
||||
define(['./_stackClear', './_stackDelete', './_stackGet', './_stackHas', './_stackSet'], function(stackClear, stackDelete, stackGet, stackHas, stackSet) {
|
||||
define(['./_ListCache', './_stackClear', './_stackDelete', './_stackGet', './_stackHas', './_stackSet'], function(ListCache, stackClear, stackDelete, stackGet, stackHas, stackSet) {
|
||||
|
||||
/**
|
||||
* Creates a stack cache object to store key-value pairs.
|
||||
*
|
||||
* @private
|
||||
* @constructor
|
||||
* @param {Array} [values] The values to cache.
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
function Stack(values) {
|
||||
var index = -1,
|
||||
length = values ? values.length : 0;
|
||||
|
||||
this.clear();
|
||||
while (++index < length) {
|
||||
var entry = values[index];
|
||||
this.set(entry[0], entry[1]);
|
||||
}
|
||||
function Stack(entries) {
|
||||
this.__data__ = new ListCache(entries);
|
||||
}
|
||||
|
||||
// Add methods to `Stack`.
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Creates a new array concatenating `array` with `other`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The first array to concatenate.
|
||||
* @param {Array} other The second array to concatenate.
|
||||
* @returns {Array} Returns the new concatenated array.
|
||||
*/
|
||||
function arrayConcat(array, other) {
|
||||
var index = -1,
|
||||
length = array.length,
|
||||
othIndex = -1,
|
||||
othLength = other.length,
|
||||
result = Array(length + othLength);
|
||||
|
||||
while (++index < length) {
|
||||
result[index] = array[index];
|
||||
}
|
||||
while (++othIndex < othLength) {
|
||||
result[index++] = other[othIndex];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
return arrayConcat;
|
||||
});
|
||||
21
_assocSet.js
21
_assocSet.js
@@ -1,21 +0,0 @@
|
||||
define(['./_assocIndexOf'], function(assocIndexOf) {
|
||||
|
||||
/**
|
||||
* Sets the associative array `key` to `value`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {string} key The key of the value to set.
|
||||
* @param {*} value The value to set.
|
||||
*/
|
||||
function assocSet(array, key, value) {
|
||||
var index = assocIndexOf(array, key);
|
||||
if (index < 0) {
|
||||
array.push([key, value]);
|
||||
} else {
|
||||
array[index][1] = value;
|
||||
}
|
||||
}
|
||||
|
||||
return assocSet;
|
||||
});
|
||||
@@ -9,7 +9,7 @@ define(['./get'], function(get) {
|
||||
* @private
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {string[]} paths The property paths of elements to pick.
|
||||
* @returns {Array} Returns the new array of picked elements.
|
||||
* @returns {Array} Returns the picked elements.
|
||||
*/
|
||||
function baseAt(object, paths) {
|
||||
var index = -1,
|
||||
|
||||
@@ -8,7 +8,7 @@ define(['./keys'], function(keys) {
|
||||
*
|
||||
* @private
|
||||
* @param {Object} source The object of property predicates to conform to.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new spec function.
|
||||
*/
|
||||
function baseConforms(source) {
|
||||
var props = keys(source),
|
||||
|
||||
@@ -7,7 +7,7 @@ define(['./_arrayFilter', './isFunction'], function(arrayFilter, isFunction) {
|
||||
* @private
|
||||
* @param {Object} object The object to inspect.
|
||||
* @param {Array} props The property names to filter.
|
||||
* @returns {Array} Returns the new array of filtered property names.
|
||||
* @returns {Array} Returns the function names.
|
||||
*/
|
||||
function baseFunctions(object, props) {
|
||||
return arrayFilter(props, function(key) {
|
||||
|
||||
@@ -13,9 +13,7 @@ define(['./_arrayPush', './isArray'], function(arrayPush, isArray) {
|
||||
*/
|
||||
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
||||
var result = keysFunc(object);
|
||||
return isArray(object)
|
||||
? result
|
||||
: arrayPush(result, symbolsFunc(object));
|
||||
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
|
||||
}
|
||||
|
||||
return baseGetAllKeys;
|
||||
|
||||
@@ -5,7 +5,7 @@ define(['./_baseIsMatch', './_getMatchData', './_matchesStrictComparable'], func
|
||||
*
|
||||
* @private
|
||||
* @param {Object} source The object of property values to match.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new spec function.
|
||||
*/
|
||||
function baseMatches(source) {
|
||||
var matchData = getMatchData(source);
|
||||
|
||||
@@ -13,7 +13,7 @@ define(['./_baseIsEqual', './get', './hasIn', './_isKey', './_isStrictComparable
|
||||
* @private
|
||||
* @param {string} path The path of the property to get.
|
||||
* @param {*} srcValue The value to match.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new spec function.
|
||||
*/
|
||||
function baseMatchesProperty(path, srcValue) {
|
||||
if (isKey(path) && isStrictComparable(srcValue)) {
|
||||
|
||||
@@ -8,7 +8,7 @@ define([], function() {
|
||||
*
|
||||
* @private
|
||||
* @param {string} key The key of the property to get.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new accessor function.
|
||||
*/
|
||||
function baseProperty(key) {
|
||||
return function(object) {
|
||||
|
||||
@@ -5,7 +5,7 @@ define(['./_baseGet'], function(baseGet) {
|
||||
*
|
||||
* @private
|
||||
* @param {Array|string} path The path of the property to get.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new accessor function.
|
||||
*/
|
||||
function basePropertyDeep(path) {
|
||||
return function(object) {
|
||||
|
||||
@@ -13,7 +13,7 @@ define([], function() {
|
||||
* @param {number} end The end of the range.
|
||||
* @param {number} step The value to increment or decrement by.
|
||||
* @param {boolean} [fromRight] Specify iterating from right to left.
|
||||
* @returns {Array} Returns the new array of numbers.
|
||||
* @returns {Array} Returns the range of numbers.
|
||||
*/
|
||||
function baseRange(start, end, step, fromRight) {
|
||||
var index = -1,
|
||||
|
||||
@@ -7,7 +7,7 @@ define(['./_arrayMap'], function(arrayMap) {
|
||||
* @private
|
||||
* @param {Object} object The object to query.
|
||||
* @param {Array} props The property names to get values for.
|
||||
* @returns {Object} Returns the new array of key-value pairs.
|
||||
* @returns {Object} Returns the key-value pairs.
|
||||
*/
|
||||
function baseToPairs(object, props) {
|
||||
return arrayMap(props, function(key) {
|
||||
|
||||
@@ -5,7 +5,7 @@ define([], function() {
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to cap arguments for.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new capped function.
|
||||
*/
|
||||
function baseUnary(func) {
|
||||
return function(value) {
|
||||
|
||||
24
_cacheHas.js
24
_cacheHas.js
@@ -1,25 +1,15 @@
|
||||
define(['./_isKeyable'], function(isKeyable) {
|
||||
|
||||
/** Used to stand-in for `undefined` hash values. */
|
||||
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Checks if `value` is in `cache`.
|
||||
* Checks if a cache value for `key` exists.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} cache The set cache to search.
|
||||
* @param {*} value The value to search for.
|
||||
* @returns {number} Returns `true` if `value` is found, else `false`.
|
||||
* @param {Object} cache The cache to query.
|
||||
* @param {string} key The key of the entry to check.
|
||||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||||
*/
|
||||
function cacheHas(cache, value) {
|
||||
var map = cache.__data__;
|
||||
if (isKeyable(value)) {
|
||||
var data = map.__data__,
|
||||
hash = typeof value == 'string' ? data.string : data.hash;
|
||||
|
||||
return hash[value] === HASH_UNDEFINED;
|
||||
}
|
||||
return map.has(value);
|
||||
function cacheHas(cache, key) {
|
||||
return cache.has(key);
|
||||
}
|
||||
|
||||
return cacheHas;
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
define(['./_isKeyable'], function(isKeyable) {
|
||||
|
||||
/** Used to stand-in for `undefined` hash values. */
|
||||
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
||||
|
||||
/**
|
||||
* Adds `value` to the set cache.
|
||||
*
|
||||
* @private
|
||||
* @name push
|
||||
* @memberOf SetCache
|
||||
* @param {*} value The value to cache.
|
||||
*/
|
||||
function cachePush(value) {
|
||||
var map = this.__data__;
|
||||
if (isKeyable(value)) {
|
||||
var data = map.__data__,
|
||||
hash = typeof value == 'string' ? data.string : data.hash;
|
||||
|
||||
hash[value] = HASH_UNDEFINED;
|
||||
}
|
||||
else {
|
||||
map.set(value, HASH_UNDEFINED);
|
||||
}
|
||||
}
|
||||
|
||||
return cachePush;
|
||||
});
|
||||
@@ -8,7 +8,7 @@ define([], function() {
|
||||
* placeholders, and provided arguments into a single array of arguments.
|
||||
*
|
||||
* @private
|
||||
* @param {Array|Object} args The provided arguments.
|
||||
* @param {Array} args The provided arguments.
|
||||
* @param {Array} partials The arguments to prepend to those provided.
|
||||
* @param {Array} holders The `partials` placeholder indexes.
|
||||
* @params {boolean} [isCurried] Specify composing for a curried function.
|
||||
|
||||
@@ -8,7 +8,7 @@ define([], function() {
|
||||
* is tailored for `_.partialRight`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array|Object} args The provided arguments.
|
||||
* @param {Array} args The provided arguments.
|
||||
* @param {Array} partials The arguments to append to those provided.
|
||||
* @param {Array} holders The `partials` placeholder indexes.
|
||||
* @params {boolean} [isCurried] Specify composing for a curried function.
|
||||
|
||||
@@ -17,7 +17,7 @@ define(['./_isIterateeCall', './rest'], function(isIterateeCall, rest) {
|
||||
customizer = length > 1 ? sources[length - 1] : undefined,
|
||||
guard = length > 2 ? sources[2] : undefined;
|
||||
|
||||
customizer = typeof customizer == 'function'
|
||||
customizer = (assigner.length > 3 && typeof customizer == 'function')
|
||||
? (length--, customizer)
|
||||
: undefined;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ define(['./_castSlice', './_reHasComplexSymbol', './_stringToArray', './toString
|
||||
*
|
||||
* @private
|
||||
* @param {string} methodName The name of the `String` case method to use.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new case function.
|
||||
*/
|
||||
function createCaseFirst(methodName) {
|
||||
return function(string) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_apply', './_createCtorWrapper', './_createHybridWrapper', './_createRecurryWrapper', './_getPlaceholder', './_replaceHolders', './_root'], function(apply, createCtorWrapper, createHybridWrapper, createRecurryWrapper, getPlaceholder, replaceHolders, root) {
|
||||
define(['./_apply', './_createCtorWrapper', './_createHybridWrapper', './_createRecurryWrapper', './_getHolder', './_replaceHolders', './_root'], function(apply, createCtorWrapper, createHybridWrapper, createRecurryWrapper, getHolder, replaceHolders, root) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -20,7 +20,7 @@ define(['./_apply', './_createCtorWrapper', './_createHybridWrapper', './_create
|
||||
var length = arguments.length,
|
||||
args = Array(length),
|
||||
index = length,
|
||||
placeholder = getPlaceholder(wrapper);
|
||||
placeholder = getHolder(wrapper);
|
||||
|
||||
while (index--) {
|
||||
args[index] = arguments[index];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_composeArgs', './_composeArgsRight', './_countHolders', './_createCtorWrapper', './_createRecurryWrapper', './_getPlaceholder', './_reorder', './_replaceHolders', './_root'], function(composeArgs, composeArgsRight, countHolders, createCtorWrapper, createRecurryWrapper, getPlaceholder, reorder, replaceHolders, root) {
|
||||
define(['./_composeArgs', './_composeArgsRight', './_countHolders', './_createCtorWrapper', './_createRecurryWrapper', './_getHolder', './_reorder', './_replaceHolders', './_root'], function(composeArgs, composeArgsRight, countHolders, createCtorWrapper, createRecurryWrapper, getHolder, reorder, replaceHolders, root) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -41,14 +41,14 @@ define(['./_composeArgs', './_composeArgsRight', './_countHolders', './_createCt
|
||||
|
||||
function wrapper() {
|
||||
var length = arguments.length,
|
||||
index = length,
|
||||
args = Array(length);
|
||||
args = Array(length),
|
||||
index = length;
|
||||
|
||||
while (index--) {
|
||||
args[index] = arguments[index];
|
||||
}
|
||||
if (isCurried) {
|
||||
var placeholder = getPlaceholder(wrapper),
|
||||
var placeholder = getHolder(wrapper),
|
||||
holdersCount = countHolders(args, placeholder);
|
||||
}
|
||||
if (partials) {
|
||||
|
||||
@@ -5,7 +5,7 @@ define(['./_apply', './_arrayMap', './_baseFlatten', './_baseIteratee', './_base
|
||||
*
|
||||
* @private
|
||||
* @param {Function} arrayFunc The function to iterate over iteratees.
|
||||
* @returns {Function} Returns the new invoker function.
|
||||
* @returns {Function} Returns the new over function.
|
||||
*/
|
||||
function createOver(arrayFunc) {
|
||||
return rest(function(iteratees) {
|
||||
|
||||
28
_createToPairs.js
Normal file
28
_createToPairs.js
Normal file
@@ -0,0 +1,28 @@
|
||||
define(['./_baseToPairs', './_getTag', './_mapToArray', './_setToPairs'], function(baseToPairs, getTag, mapToArray, setToPairs) {
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var mapTag = '[object Map]',
|
||||
setTag = '[object Set]';
|
||||
|
||||
/**
|
||||
* Creates a `_.toPairs` or `_.toPairsIn` function.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} keysFunc The function to get the keys of a given object.
|
||||
* @returns {Function} Returns the new pairs function.
|
||||
*/
|
||||
function createToPairs(keysFunc) {
|
||||
return function(object) {
|
||||
var tag = getTag(object);
|
||||
if (tag == mapTag) {
|
||||
return mapToArray(object);
|
||||
}
|
||||
if (tag == setTag) {
|
||||
return setToPairs(object);
|
||||
}
|
||||
return baseToPairs(object, keysFunc(object));
|
||||
};
|
||||
}
|
||||
|
||||
return createToPairs;
|
||||
});
|
||||
@@ -34,6 +34,7 @@ define(['./_baseSetData', './_createBaseWrapper', './_createCurryWrapper', './_c
|
||||
* 64 - `_.partialRight`
|
||||
* 128 - `_.rearg`
|
||||
* 256 - `_.ary`
|
||||
* 512 - `_.flip`
|
||||
* @param {*} [thisArg] The `this` binding of `func`.
|
||||
* @param {Array} [partials] The arguments to be partially applied.
|
||||
* @param {Array} [holders] The `partials` placeholder indexes.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_arraySome'], function(arraySome) {
|
||||
define(['./_SetCache', './_arraySome'], function(SetCache, arraySome) {
|
||||
|
||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||
var undefined;
|
||||
@@ -22,9 +22,7 @@ define(['./_arraySome'], function(arraySome) {
|
||||
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
|
||||
*/
|
||||
function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
|
||||
var index = -1,
|
||||
isPartial = bitmask & PARTIAL_COMPARE_FLAG,
|
||||
isUnordered = bitmask & UNORDERED_COMPARE_FLAG,
|
||||
var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
|
||||
arrLength = array.length,
|
||||
othLength = other.length;
|
||||
|
||||
@@ -36,7 +34,10 @@ define(['./_arraySome'], function(arraySome) {
|
||||
if (stacked) {
|
||||
return stacked == other;
|
||||
}
|
||||
var result = true;
|
||||
var index = -1,
|
||||
result = true,
|
||||
seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;
|
||||
|
||||
stack.set(array, other);
|
||||
|
||||
// Ignore non-index properties.
|
||||
@@ -57,10 +58,12 @@ define(['./_arraySome'], function(arraySome) {
|
||||
break;
|
||||
}
|
||||
// Recursively compare arrays (susceptible to call stack limits).
|
||||
if (isUnordered) {
|
||||
if (!arraySome(other, function(othValue) {
|
||||
return arrValue === othValue ||
|
||||
equalFunc(arrValue, othValue, customizer, bitmask, stack);
|
||||
if (seen) {
|
||||
if (!arraySome(other, function(othValue, othIndex) {
|
||||
if (!seen.has(othIndex) &&
|
||||
(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
|
||||
return seen.add(othIndex);
|
||||
}
|
||||
})) {
|
||||
result = false;
|
||||
break;
|
||||
|
||||
@@ -7,10 +7,10 @@ define([], function() {
|
||||
* @param {Function} func The function to inspect.
|
||||
* @returns {*} Returns the placeholder value.
|
||||
*/
|
||||
function getPlaceholder(func) {
|
||||
function getHolder(func) {
|
||||
var object = func;
|
||||
return object.placeholder;
|
||||
}
|
||||
|
||||
return getPlaceholder;
|
||||
return getHolder;
|
||||
});
|
||||
19
_getMapData.js
Normal file
19
_getMapData.js
Normal file
@@ -0,0 +1,19 @@
|
||||
define(['./_isKeyable'], function(isKeyable) {
|
||||
|
||||
/**
|
||||
* Gets the data for `map`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} map The map to query.
|
||||
* @param {string} key The reference key.
|
||||
* @returns {*} Returns the map data.
|
||||
*/
|
||||
function getMapData(map, key) {
|
||||
var data = map.__data__;
|
||||
return isKeyable(key)
|
||||
? data[typeof key == 'string' ? 'string' : 'hash']
|
||||
: data.map;
|
||||
}
|
||||
|
||||
return getMapData;
|
||||
});
|
||||
15
_hashClear.js
Normal file
15
_hashClear.js
Normal file
@@ -0,0 +1,15 @@
|
||||
define(['./_nativeCreate'], function(nativeCreate) {
|
||||
|
||||
/**
|
||||
* Removes all key-value entries from the hash.
|
||||
*
|
||||
* @private
|
||||
* @name clear
|
||||
* @memberOf Hash
|
||||
*/
|
||||
function hashClear() {
|
||||
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
||||
}
|
||||
|
||||
return hashClear;
|
||||
});
|
||||
@@ -1,15 +1,17 @@
|
||||
define(['./_hashHas'], function(hashHas) {
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Removes `key` and its value from the hash.
|
||||
*
|
||||
* @private
|
||||
* @name delete
|
||||
* @memberOf Hash
|
||||
* @param {Object} hash The hash to modify.
|
||||
* @param {string} key The key of the value to remove.
|
||||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||||
*/
|
||||
function hashDelete(hash, key) {
|
||||
return hashHas(hash, key) && delete hash[key];
|
||||
function hashDelete(key) {
|
||||
return this.has(key) && delete this.__data__[key];
|
||||
}
|
||||
|
||||
return hashDelete;
|
||||
|
||||
10
_hashGet.js
10
_hashGet.js
@@ -16,16 +16,18 @@ define(['./_nativeCreate'], function(nativeCreate) {
|
||||
* Gets the hash value for `key`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} hash The hash to query.
|
||||
* @name get
|
||||
* @memberOf Hash
|
||||
* @param {string} key The key of the value to get.
|
||||
* @returns {*} Returns the entry value.
|
||||
*/
|
||||
function hashGet(hash, key) {
|
||||
function hashGet(key) {
|
||||
var data = this.__data__;
|
||||
if (nativeCreate) {
|
||||
var result = hash[key];
|
||||
var result = data[key];
|
||||
return result === HASH_UNDEFINED ? undefined : result;
|
||||
}
|
||||
return hasOwnProperty.call(hash, key) ? hash[key] : undefined;
|
||||
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
||||
}
|
||||
|
||||
return hashGet;
|
||||
|
||||
@@ -13,12 +13,14 @@ define(['./_nativeCreate'], function(nativeCreate) {
|
||||
* Checks if a hash value for `key` exists.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} hash The hash to query.
|
||||
* @name has
|
||||
* @memberOf Hash
|
||||
* @param {string} key The key of the entry to check.
|
||||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||||
*/
|
||||
function hashHas(hash, key) {
|
||||
return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key);
|
||||
function hashHas(key) {
|
||||
var data = this.__data__;
|
||||
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
|
||||
}
|
||||
|
||||
return hashHas;
|
||||
|
||||
10
_hashSet.js
10
_hashSet.js
@@ -10,12 +10,16 @@ define(['./_nativeCreate'], function(nativeCreate) {
|
||||
* Sets the hash `key` to `value`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} hash The hash to modify.
|
||||
* @name set
|
||||
* @memberOf Hash
|
||||
* @param {string} key The key of the value to set.
|
||||
* @param {*} value The value to set.
|
||||
* @returns {Object} Returns the hash instance.
|
||||
*/
|
||||
function hashSet(hash, key, value) {
|
||||
hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
||||
function hashSet(key, value) {
|
||||
var data = this.__data__;
|
||||
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
||||
return this;
|
||||
}
|
||||
|
||||
return hashSet;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./isArguments', './isArray', './isArrayLikeObject'], function(isArguments, isArray, isArrayLikeObject) {
|
||||
define(['./isArguments', './isArray'], function(isArguments, isArray) {
|
||||
|
||||
/**
|
||||
* Checks if `value` is a flattenable `arguments` object or array.
|
||||
@@ -8,7 +8,7 @@ define(['./isArguments', './isArray', './isArrayLikeObject'], function(isArgumen
|
||||
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
|
||||
*/
|
||||
function isFlattenable(value) {
|
||||
return isArrayLikeObject(value) && (isArray(value) || isArguments(value));
|
||||
return isArray(value) || isArguments(value);
|
||||
}
|
||||
|
||||
return isFlattenable;
|
||||
|
||||
15
_listCacheClear.js
Normal file
15
_listCacheClear.js
Normal file
@@ -0,0 +1,15 @@
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Removes all key-value entries from the list cache.
|
||||
*
|
||||
* @private
|
||||
* @name clear
|
||||
* @memberOf ListCache
|
||||
*/
|
||||
function listCacheClear() {
|
||||
this.__data__ = [];
|
||||
}
|
||||
|
||||
return listCacheClear;
|
||||
});
|
||||
@@ -7,26 +7,29 @@ define(['./_assocIndexOf'], function(assocIndexOf) {
|
||||
var splice = arrayProto.splice;
|
||||
|
||||
/**
|
||||
* Removes `key` and its value from the associative array.
|
||||
* Removes `key` and its value from the list cache.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to modify.
|
||||
* @name delete
|
||||
* @memberOf ListCache
|
||||
* @param {string} key The key of the value to remove.
|
||||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||||
*/
|
||||
function assocDelete(array, key) {
|
||||
var index = assocIndexOf(array, key);
|
||||
function listCacheDelete(key) {
|
||||
var data = this.__data__,
|
||||
index = assocIndexOf(data, key);
|
||||
|
||||
if (index < 0) {
|
||||
return false;
|
||||
}
|
||||
var lastIndex = array.length - 1;
|
||||
var lastIndex = data.length - 1;
|
||||
if (index == lastIndex) {
|
||||
array.pop();
|
||||
data.pop();
|
||||
} else {
|
||||
splice.call(array, index, 1);
|
||||
splice.call(data, index, 1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return assocDelete;
|
||||
return listCacheDelete;
|
||||
});
|
||||
@@ -4,17 +4,20 @@ define(['./_assocIndexOf'], function(assocIndexOf) {
|
||||
var undefined;
|
||||
|
||||
/**
|
||||
* Gets the associative array value for `key`.
|
||||
* Gets the list cache value for `key`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to query.
|
||||
* @name get
|
||||
* @memberOf ListCache
|
||||
* @param {string} key The key of the value to get.
|
||||
* @returns {*} Returns the entry value.
|
||||
*/
|
||||
function assocGet(array, key) {
|
||||
var index = assocIndexOf(array, key);
|
||||
return index < 0 ? undefined : array[index][1];
|
||||
function listCacheGet(key) {
|
||||
var data = this.__data__,
|
||||
index = assocIndexOf(data, key);
|
||||
|
||||
return index < 0 ? undefined : data[index][1];
|
||||
}
|
||||
|
||||
return assocGet;
|
||||
return listCacheGet;
|
||||
});
|
||||
@@ -1,16 +1,17 @@
|
||||
define(['./_assocIndexOf'], function(assocIndexOf) {
|
||||
|
||||
/**
|
||||
* Checks if an associative array value for `key` exists.
|
||||
* Checks if a list cache value for `key` exists.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to query.
|
||||
* @name has
|
||||
* @memberOf ListCache
|
||||
* @param {string} key The key of the entry to check.
|
||||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||||
*/
|
||||
function assocHas(array, key) {
|
||||
return assocIndexOf(array, key) > -1;
|
||||
function listCacheHas(key) {
|
||||
return assocIndexOf(this.__data__, key) > -1;
|
||||
}
|
||||
|
||||
return assocHas;
|
||||
return listCacheHas;
|
||||
});
|
||||
26
_listCacheSet.js
Normal file
26
_listCacheSet.js
Normal file
@@ -0,0 +1,26 @@
|
||||
define(['./_assocIndexOf'], function(assocIndexOf) {
|
||||
|
||||
/**
|
||||
* Sets the list cache `key` to `value`.
|
||||
*
|
||||
* @private
|
||||
* @name set
|
||||
* @memberOf ListCache
|
||||
* @param {string} key The key of the value to set.
|
||||
* @param {*} value The value to set.
|
||||
* @returns {Object} Returns the list cache instance.
|
||||
*/
|
||||
function listCacheSet(key, value) {
|
||||
var data = this.__data__,
|
||||
index = assocIndexOf(data, key);
|
||||
|
||||
if (index < 0) {
|
||||
data.push([key, value]);
|
||||
} else {
|
||||
data[index][1] = value;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
return listCacheSet;
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_Hash', './_Map'], function(Hash, Map) {
|
||||
define(['./_Hash', './_ListCache', './_Map'], function(Hash, ListCache, Map) {
|
||||
|
||||
/**
|
||||
* Removes all key-value entries from the map.
|
||||
@@ -7,13 +7,13 @@ define(['./_Hash', './_Map'], function(Hash, Map) {
|
||||
* @name clear
|
||||
* @memberOf MapCache
|
||||
*/
|
||||
function mapClear() {
|
||||
function mapCacheClear() {
|
||||
this.__data__ = {
|
||||
'hash': new Hash,
|
||||
'map': Map ? new Map : [],
|
||||
'map': new (Map || ListCache),
|
||||
'string': new Hash
|
||||
};
|
||||
}
|
||||
|
||||
return mapClear;
|
||||
return mapCacheClear;
|
||||
});
|
||||
17
_mapCacheDelete.js
Normal file
17
_mapCacheDelete.js
Normal file
@@ -0,0 +1,17 @@
|
||||
define(['./_getMapData'], function(getMapData) {
|
||||
|
||||
/**
|
||||
* Removes `key` and its value from the map.
|
||||
*
|
||||
* @private
|
||||
* @name delete
|
||||
* @memberOf MapCache
|
||||
* @param {string} key The key of the value to remove.
|
||||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||||
*/
|
||||
function mapCacheDelete(key) {
|
||||
return getMapData(this, key)['delete'](key);
|
||||
}
|
||||
|
||||
return mapCacheDelete;
|
||||
});
|
||||
17
_mapCacheGet.js
Normal file
17
_mapCacheGet.js
Normal file
@@ -0,0 +1,17 @@
|
||||
define(['./_getMapData'], function(getMapData) {
|
||||
|
||||
/**
|
||||
* Gets the map value for `key`.
|
||||
*
|
||||
* @private
|
||||
* @name get
|
||||
* @memberOf MapCache
|
||||
* @param {string} key The key of the value to get.
|
||||
* @returns {*} Returns the entry value.
|
||||
*/
|
||||
function mapCacheGet(key) {
|
||||
return getMapData(this, key).get(key);
|
||||
}
|
||||
|
||||
return mapCacheGet;
|
||||
});
|
||||
17
_mapCacheHas.js
Normal file
17
_mapCacheHas.js
Normal file
@@ -0,0 +1,17 @@
|
||||
define(['./_getMapData'], function(getMapData) {
|
||||
|
||||
/**
|
||||
* Checks if a map value for `key` exists.
|
||||
*
|
||||
* @private
|
||||
* @name has
|
||||
* @memberOf MapCache
|
||||
* @param {string} key The key of the entry to check.
|
||||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||||
*/
|
||||
function mapCacheHas(key) {
|
||||
return getMapData(this, key).has(key);
|
||||
}
|
||||
|
||||
return mapCacheHas;
|
||||
});
|
||||
19
_mapCacheSet.js
Normal file
19
_mapCacheSet.js
Normal file
@@ -0,0 +1,19 @@
|
||||
define(['./_getMapData'], function(getMapData) {
|
||||
|
||||
/**
|
||||
* Sets the map `key` to `value`.
|
||||
*
|
||||
* @private
|
||||
* @name set
|
||||
* @memberOf MapCache
|
||||
* @param {string} key The key of the value to set.
|
||||
* @param {*} value The value to set.
|
||||
* @returns {Object} Returns the map cache instance.
|
||||
*/
|
||||
function mapCacheSet(key, value) {
|
||||
getMapData(this, key).set(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
return mapCacheSet;
|
||||
});
|
||||
@@ -1,21 +0,0 @@
|
||||
define(['./_Map', './_assocDelete', './_hashDelete', './_isKeyable'], function(Map, assocDelete, hashDelete, isKeyable) {
|
||||
|
||||
/**
|
||||
* Removes `key` and its value from the map.
|
||||
*
|
||||
* @private
|
||||
* @name delete
|
||||
* @memberOf MapCache
|
||||
* @param {string} key The key of the value to remove.
|
||||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||||
*/
|
||||
function mapDelete(key) {
|
||||
var data = this.__data__;
|
||||
if (isKeyable(key)) {
|
||||
return hashDelete(typeof key == 'string' ? data.string : data.hash, key);
|
||||
}
|
||||
return Map ? data.map['delete'](key) : assocDelete(data.map, key);
|
||||
}
|
||||
|
||||
return mapDelete;
|
||||
});
|
||||
21
_mapGet.js
21
_mapGet.js
@@ -1,21 +0,0 @@
|
||||
define(['./_Map', './_assocGet', './_hashGet', './_isKeyable'], function(Map, assocGet, hashGet, isKeyable) {
|
||||
|
||||
/**
|
||||
* Gets the map value for `key`.
|
||||
*
|
||||
* @private
|
||||
* @name get
|
||||
* @memberOf MapCache
|
||||
* @param {string} key The key of the value to get.
|
||||
* @returns {*} Returns the entry value.
|
||||
*/
|
||||
function mapGet(key) {
|
||||
var data = this.__data__;
|
||||
if (isKeyable(key)) {
|
||||
return hashGet(typeof key == 'string' ? data.string : data.hash, key);
|
||||
}
|
||||
return Map ? data.map.get(key) : assocGet(data.map, key);
|
||||
}
|
||||
|
||||
return mapGet;
|
||||
});
|
||||
21
_mapHas.js
21
_mapHas.js
@@ -1,21 +0,0 @@
|
||||
define(['./_Map', './_assocHas', './_hashHas', './_isKeyable'], function(Map, assocHas, hashHas, isKeyable) {
|
||||
|
||||
/**
|
||||
* Checks if a map value for `key` exists.
|
||||
*
|
||||
* @private
|
||||
* @name has
|
||||
* @memberOf MapCache
|
||||
* @param {string} key The key of the entry to check.
|
||||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||||
*/
|
||||
function mapHas(key) {
|
||||
var data = this.__data__;
|
||||
if (isKeyable(key)) {
|
||||
return hashHas(typeof key == 'string' ? data.string : data.hash, key);
|
||||
}
|
||||
return Map ? data.map.has(key) : assocHas(data.map, key);
|
||||
}
|
||||
|
||||
return mapHas;
|
||||
});
|
||||
26
_mapSet.js
26
_mapSet.js
@@ -1,26 +0,0 @@
|
||||
define(['./_Map', './_assocSet', './_hashSet', './_isKeyable'], function(Map, assocSet, hashSet, isKeyable) {
|
||||
|
||||
/**
|
||||
* Sets the map `key` to `value`.
|
||||
*
|
||||
* @private
|
||||
* @name set
|
||||
* @memberOf MapCache
|
||||
* @param {string} key The key of the value to set.
|
||||
* @param {*} value The value to set.
|
||||
* @returns {Object} Returns the map cache instance.
|
||||
*/
|
||||
function mapSet(key, value) {
|
||||
var data = this.__data__;
|
||||
if (isKeyable(key)) {
|
||||
hashSet(typeof key == 'string' ? data.string : data.hash, key, value);
|
||||
} else if (Map) {
|
||||
data.map.set(key, value);
|
||||
} else {
|
||||
assocSet(data.map, key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
return mapSet;
|
||||
});
|
||||
@@ -1,11 +1,11 @@
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Converts `map` to an array.
|
||||
* Converts `map` to its key-value pairs.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} map The map to convert.
|
||||
* @returns {Array} Returns the converted array.
|
||||
* @returns {Array} Returns the key-value pairs.
|
||||
*/
|
||||
function mapToArray(map) {
|
||||
var index = -1,
|
||||
|
||||
@@ -10,7 +10,7 @@ define([], function() {
|
||||
* @private
|
||||
* @param {string} key The key of the property to get.
|
||||
* @param {*} srcValue The value to match.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new spec function.
|
||||
*/
|
||||
function matchesStrictComparable(key, srcValue) {
|
||||
return function(object) {
|
||||
|
||||
22
_setCacheAdd.js
Normal file
22
_setCacheAdd.js
Normal file
@@ -0,0 +1,22 @@
|
||||
define([], function() {
|
||||
|
||||
/** Used to stand-in for `undefined` hash values. */
|
||||
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
||||
|
||||
/**
|
||||
* Adds `value` to the array cache.
|
||||
*
|
||||
* @private
|
||||
* @name add
|
||||
* @memberOf SetCache
|
||||
* @alias push
|
||||
* @param {*} value The value to cache.
|
||||
* @returns {Object} Returns the cache instance.
|
||||
*/
|
||||
function setCacheAdd(value) {
|
||||
this.__data__.set(value, HASH_UNDEFINED);
|
||||
return this;
|
||||
}
|
||||
|
||||
return setCacheAdd;
|
||||
});
|
||||
17
_setCacheHas.js
Normal file
17
_setCacheHas.js
Normal file
@@ -0,0 +1,17 @@
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Checks if `value` is in the array cache.
|
||||
*
|
||||
* @private
|
||||
* @name has
|
||||
* @memberOf SetCache
|
||||
* @param {*} value The value to search for.
|
||||
* @returns {number} Returns `true` if `value` is found, else `false`.
|
||||
*/
|
||||
function setCacheHas(value) {
|
||||
return this.__data__.has(value);
|
||||
}
|
||||
|
||||
return setCacheHas;
|
||||
});
|
||||
@@ -1,11 +1,11 @@
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Converts `set` to an array.
|
||||
* Converts `set` to an array of its values.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} set The set to convert.
|
||||
* @returns {Array} Returns the converted array.
|
||||
* @returns {Array} Returns the values.
|
||||
*/
|
||||
function setToArray(set) {
|
||||
var index = -1,
|
||||
|
||||
21
_setToPairs.js
Normal file
21
_setToPairs.js
Normal file
@@ -0,0 +1,21 @@
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Converts `set` to its value-value pairs.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} set The set to convert.
|
||||
* @returns {Array} Returns the value-value pairs.
|
||||
*/
|
||||
function setToPairs(set) {
|
||||
var index = -1,
|
||||
result = Array(set.size);
|
||||
|
||||
set.forEach(function(value) {
|
||||
result[++index] = [value, value];
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
return setToPairs;
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
define([], function() {
|
||||
define(['./_ListCache'], function(ListCache) {
|
||||
|
||||
/**
|
||||
* Removes all key-value entries from the stack.
|
||||
@@ -8,7 +8,7 @@ define([], function() {
|
||||
* @memberOf Stack
|
||||
*/
|
||||
function stackClear() {
|
||||
this.__data__ = { 'array': [], 'map': null };
|
||||
this.__data__ = new ListCache;
|
||||
}
|
||||
|
||||
return stackClear;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_assocDelete'], function(assocDelete) {
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Removes `key` and its value from the stack.
|
||||
@@ -10,10 +10,7 @@ define(['./_assocDelete'], function(assocDelete) {
|
||||
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
||||
*/
|
||||
function stackDelete(key) {
|
||||
var data = this.__data__,
|
||||
array = data.array;
|
||||
|
||||
return array ? assocDelete(array, key) : data.map['delete'](key);
|
||||
return this.__data__['delete'](key);
|
||||
}
|
||||
|
||||
return stackDelete;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_assocGet'], function(assocGet) {
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Gets the stack value for `key`.
|
||||
@@ -10,10 +10,7 @@ define(['./_assocGet'], function(assocGet) {
|
||||
* @returns {*} Returns the entry value.
|
||||
*/
|
||||
function stackGet(key) {
|
||||
var data = this.__data__,
|
||||
array = data.array;
|
||||
|
||||
return array ? assocGet(array, key) : data.map.get(key);
|
||||
return this.__data__.get(key);
|
||||
}
|
||||
|
||||
return stackGet;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_assocHas'], function(assocHas) {
|
||||
define([], function() {
|
||||
|
||||
/**
|
||||
* Checks if a stack value for `key` exists.
|
||||
@@ -10,10 +10,7 @@ define(['./_assocHas'], function(assocHas) {
|
||||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||||
*/
|
||||
function stackHas(key) {
|
||||
var data = this.__data__,
|
||||
array = data.array;
|
||||
|
||||
return array ? assocHas(array, key) : data.map.has(key);
|
||||
return this.__data__.has(key);
|
||||
}
|
||||
|
||||
return stackHas;
|
||||
|
||||
20
_stackSet.js
20
_stackSet.js
@@ -1,4 +1,4 @@
|
||||
define(['./_MapCache', './_assocSet'], function(MapCache, assocSet) {
|
||||
define(['./_ListCache', './_MapCache'], function(ListCache, MapCache) {
|
||||
|
||||
/** Used as the size to enable large array optimizations. */
|
||||
var LARGE_ARRAY_SIZE = 200;
|
||||
@@ -14,21 +14,11 @@ define(['./_MapCache', './_assocSet'], function(MapCache, assocSet) {
|
||||
* @returns {Object} Returns the stack cache instance.
|
||||
*/
|
||||
function stackSet(key, value) {
|
||||
var data = this.__data__,
|
||||
array = data.array;
|
||||
|
||||
if (array) {
|
||||
if (array.length < (LARGE_ARRAY_SIZE - 1)) {
|
||||
assocSet(array, key, value);
|
||||
} else {
|
||||
data.array = null;
|
||||
data.map = new MapCache(array);
|
||||
}
|
||||
}
|
||||
var map = data.map;
|
||||
if (map) {
|
||||
map.set(key, value);
|
||||
var cache = this.__data__;
|
||||
if (cache instanceof ListCache && cache.__data__.length == LARGE_ARRAY_SIZE) {
|
||||
cache = this.__data__ = new MapCache(cache.__data__);
|
||||
}
|
||||
cache.set(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
3
array.js
3
array.js
@@ -1,4 +1,4 @@
|
||||
define(['./chunk', './compact', './concat', './difference', './differenceBy', './differenceWith', './drop', './dropRight', './dropRightWhile', './dropWhile', './fill', './findIndex', './findLastIndex', './flatten', './flattenDeep', './flattenDepth', './fromPairs', './head', './indexOf', './initial', './intersection', './intersectionBy', './intersectionWith', './join', './last', './lastIndexOf', './nth', './pull', './pullAll', './pullAllBy', './pullAllWith', './pullAt', './remove', './reverse', './slice', './sortedIndex', './sortedIndexBy', './sortedIndexOf', './sortedLastIndex', './sortedLastIndexBy', './sortedLastIndexOf', './sortedUniq', './sortedUniqBy', './tail', './take', './takeRight', './takeRightWhile', './takeWhile', './union', './unionBy', './unionWith', './uniq', './uniqBy', './uniqWith', './unzip', './unzipWith', './without', './xor', './xorBy', './xorWith', './zip', './zipObject', './zipObjectDeep', './zipWith'], function(chunk, compact, concat, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, findIndex, findLastIndex, flatten, flattenDeep, flattenDepth, fromPairs, head, indexOf, initial, intersection, intersectionBy, intersectionWith, join, last, lastIndexOf, nth, pull, pullAll, pullAllBy, pullAllWith, pullAt, remove, reverse, slice, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, tail, take, takeRight, takeRightWhile, takeWhile, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, without, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith) {
|
||||
define(['./chunk', './compact', './concat', './difference', './differenceBy', './differenceWith', './drop', './dropRight', './dropRightWhile', './dropWhile', './fill', './findIndex', './findLastIndex', './first', './flatten', './flattenDeep', './flattenDepth', './fromPairs', './head', './indexOf', './initial', './intersection', './intersectionBy', './intersectionWith', './join', './last', './lastIndexOf', './nth', './pull', './pullAll', './pullAllBy', './pullAllWith', './pullAt', './remove', './reverse', './slice', './sortedIndex', './sortedIndexBy', './sortedIndexOf', './sortedLastIndex', './sortedLastIndexBy', './sortedLastIndexOf', './sortedUniq', './sortedUniqBy', './tail', './take', './takeRight', './takeRightWhile', './takeWhile', './union', './unionBy', './unionWith', './uniq', './uniqBy', './uniqWith', './unzip', './unzipWith', './without', './xor', './xorBy', './xorWith', './zip', './zipObject', './zipObjectDeep', './zipWith'], function(chunk, compact, concat, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, findIndex, findLastIndex, first, flatten, flattenDeep, flattenDepth, fromPairs, head, indexOf, initial, intersection, intersectionBy, intersectionWith, join, last, lastIndexOf, nth, pull, pullAll, pullAllBy, pullAllWith, pullAt, remove, reverse, slice, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, tail, take, takeRight, takeRightWhile, takeWhile, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, without, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith) {
|
||||
return {
|
||||
'chunk': chunk,
|
||||
'compact': compact,
|
||||
@@ -13,6 +13,7 @@ define(['./chunk', './compact', './concat', './difference', './differenceBy', '.
|
||||
'fill': fill,
|
||||
'findIndex': findIndex,
|
||||
'findLastIndex': findLastIndex,
|
||||
'first': first,
|
||||
'flatten': flatten,
|
||||
'flattenDeep': flattenDeep,
|
||||
'flattenDepth': flattenDepth,
|
||||
|
||||
2
ary.js
2
ary.js
@@ -17,7 +17,7 @@ define(['./_createWrapper'], function(createWrapper) {
|
||||
* @param {Function} func The function to cap arguments for.
|
||||
* @param {number} [n=func.length] The arity cap.
|
||||
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new capped function.
|
||||
* @example
|
||||
*
|
||||
* _.map(['6', '8', '10'], _.ary(parseInt, 1));
|
||||
|
||||
2
at.js
2
at.js
@@ -9,7 +9,7 @@ define(['./_baseAt', './_baseFlatten', './rest'], function(baseAt, baseFlatten,
|
||||
* @category Object
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {...(string|string[])} [paths] The property paths of elements to pick.
|
||||
* @returns {Array} Returns the new array of picked elements.
|
||||
* @returns {Array} Returns the picked values.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
|
||||
|
||||
4
bind.js
4
bind.js
@@ -1,4 +1,4 @@
|
||||
define(['./_createWrapper', './_getPlaceholder', './_replaceHolders', './rest'], function(createWrapper, getPlaceholder, replaceHolders, rest) {
|
||||
define(['./_createWrapper', './_getHolder', './_replaceHolders', './rest'], function(createWrapper, getHolder, replaceHolders, rest) {
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_FLAG = 1,
|
||||
@@ -42,7 +42,7 @@ define(['./_createWrapper', './_getPlaceholder', './_replaceHolders', './rest'],
|
||||
var bind = rest(function(func, thisArg, partials) {
|
||||
var bitmask = BIND_FLAG;
|
||||
if (partials.length) {
|
||||
var holders = replaceHolders(partials, getPlaceholder(bind));
|
||||
var holders = replaceHolders(partials, getHolder(bind));
|
||||
bitmask |= PARTIAL_FLAG;
|
||||
}
|
||||
return createWrapper(func, bitmask, thisArg, partials, holders);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['./_createWrapper', './_getPlaceholder', './_replaceHolders', './rest'], function(createWrapper, getPlaceholder, replaceHolders, rest) {
|
||||
define(['./_createWrapper', './_getHolder', './_replaceHolders', './rest'], function(createWrapper, getHolder, replaceHolders, rest) {
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_FLAG = 1,
|
||||
@@ -53,7 +53,7 @@ define(['./_createWrapper', './_getPlaceholder', './_replaceHolders', './rest'],
|
||||
var bindKey = rest(function(object, key, partials) {
|
||||
var bitmask = BIND_FLAG | BIND_KEY_FLAG;
|
||||
if (partials.length) {
|
||||
var holders = replaceHolders(partials, getPlaceholder(bindKey));
|
||||
var holders = replaceHolders(partials, getHolder(bindKey));
|
||||
bitmask |= PARTIAL_FLAG;
|
||||
}
|
||||
return createWrapper(key, bitmask, object, partials, holders);
|
||||
|
||||
2
chunk.js
2
chunk.js
@@ -19,7 +19,7 @@ define(['./_baseSlice', './_isIterateeCall', './toInteger'], function(baseSlice,
|
||||
* @param {Array} array The array to process.
|
||||
* @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 of chunks.
|
||||
* @example
|
||||
*
|
||||
* _.chunk(['a', 'b', 'c', 'd'], 2);
|
||||
|
||||
18
concat.js
18
concat.js
@@ -1,4 +1,4 @@
|
||||
define(['./_arrayConcat', './_baseFlatten', './castArray', './_copyArray'], function(arrayConcat, baseFlatten, castArray, copyArray) {
|
||||
define(['./_arrayPush', './_baseFlatten', './_copyArray', './isArray'], function(arrayPush, baseFlatten, copyArray, isArray) {
|
||||
|
||||
/**
|
||||
* Creates a new array concatenating `array` with any additional arrays
|
||||
@@ -24,16 +24,16 @@ define(['./_arrayConcat', './_baseFlatten', './castArray', './_copyArray'], func
|
||||
*/
|
||||
function concat() {
|
||||
var length = arguments.length,
|
||||
array = castArray(arguments[0]);
|
||||
args = Array(length ? length - 1 : 0),
|
||||
array = arguments[0],
|
||||
index = length;
|
||||
|
||||
if (length < 2) {
|
||||
return length ? copyArray(array) : [];
|
||||
while (index--) {
|
||||
args[index - 1] = arguments[index];
|
||||
}
|
||||
var args = Array(length - 1);
|
||||
while (length--) {
|
||||
args[length - 1] = arguments[length];
|
||||
}
|
||||
return arrayConcat(array, baseFlatten(args, 1));
|
||||
return length
|
||||
? arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1))
|
||||
: [];
|
||||
}
|
||||
|
||||
return concat;
|
||||
|
||||
2
cond.js
2
cond.js
@@ -14,7 +14,7 @@ define(['./_apply', './_arrayMap', './_baseIteratee', './rest'], function(apply,
|
||||
* @since 4.0.0
|
||||
* @category Util
|
||||
* @param {Array} pairs The predicate-function pairs.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new composite function.
|
||||
* @example
|
||||
*
|
||||
* var func = _.cond([
|
||||
|
||||
@@ -10,7 +10,7 @@ define(['./_baseClone', './_baseConforms'], function(baseClone, baseConforms) {
|
||||
* @since 4.0.0
|
||||
* @category Util
|
||||
* @param {Object} source The object of property predicates to conform to.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new spec function.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
|
||||
@@ -8,7 +8,7 @@ define([], function() {
|
||||
* @since 2.4.0
|
||||
* @category Util
|
||||
* @param {*} value The value to return from the new function.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new constant function.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'user': 'fred' };
|
||||
|
||||
3
first.js
Normal file
3
first.js
Normal file
@@ -0,0 +1,3 @@
|
||||
define(["./head"], function(head) {
|
||||
return head;
|
||||
});
|
||||
2
flip.js
2
flip.js
@@ -11,7 +11,7 @@ define(['./_createWrapper'], function(createWrapper) {
|
||||
* @since 4.0.0
|
||||
* @category Function
|
||||
* @param {Function} func The function to flip arguments for.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new flipped function.
|
||||
* @example
|
||||
*
|
||||
* var flipped = _.flip(function() {
|
||||
|
||||
2
flow.js
2
flow.js
@@ -10,7 +10,7 @@ define(['./_createFlow'], function(createFlow) {
|
||||
* @since 3.0.0
|
||||
* @category Util
|
||||
* @param {...(Function|Function[])} [funcs] Functions to invoke.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new composite function.
|
||||
* @see _.flowRight
|
||||
* @example
|
||||
*
|
||||
|
||||
@@ -9,7 +9,7 @@ define(['./_createFlow'], function(createFlow) {
|
||||
* @memberOf _
|
||||
* @category Util
|
||||
* @param {...(Function|Function[])} [funcs] Functions to invoke.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new composite function.
|
||||
* @see _.flow
|
||||
* @example
|
||||
*
|
||||
|
||||
@@ -31,9 +31,8 @@ define(['./_arrayEach', './_baseEach', './_baseIteratee', './isArray'], function
|
||||
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
|
||||
*/
|
||||
function forEach(collection, iteratee) {
|
||||
return (typeof iteratee == 'function' && isArray(collection))
|
||||
? arrayEach(collection, iteratee)
|
||||
: baseEach(collection, baseIteratee(iteratee));
|
||||
var func = isArray(collection) ? arrayEach : baseEach;
|
||||
return func(collection, baseIteratee(iteratee, 3));
|
||||
}
|
||||
|
||||
return forEach;
|
||||
|
||||
@@ -21,9 +21,8 @@ define(['./_arrayEachRight', './_baseEachRight', './_baseIteratee', './isArray']
|
||||
* // => Logs `2` then `1`.
|
||||
*/
|
||||
function forEachRight(collection, iteratee) {
|
||||
return (typeof iteratee == 'function' && isArray(collection))
|
||||
? arrayEachRight(collection, iteratee)
|
||||
: baseEachRight(collection, baseIteratee(iteratee));
|
||||
var func = isArray(collection) ? arrayEachRight : baseEachRight;
|
||||
return func(collection, baseIteratee(iteratee, 3));
|
||||
}
|
||||
|
||||
return forEachRight;
|
||||
|
||||
2
forIn.js
2
forIn.js
@@ -31,7 +31,7 @@ define(['./_baseFor', './_baseIteratee', './keysIn'], function(baseFor, baseIter
|
||||
function forIn(object, iteratee) {
|
||||
return object == null
|
||||
? object
|
||||
: baseFor(object, baseIteratee(iteratee), keysIn);
|
||||
: baseFor(object, baseIteratee(iteratee, 3), keysIn);
|
||||
}
|
||||
|
||||
return forIn;
|
||||
|
||||
@@ -29,7 +29,7 @@ define(['./_baseForRight', './_baseIteratee', './keysIn'], function(baseForRight
|
||||
function forInRight(object, iteratee) {
|
||||
return object == null
|
||||
? object
|
||||
: baseForRight(object, baseIteratee(iteratee), keysIn);
|
||||
: baseForRight(object, baseIteratee(iteratee, 3), keysIn);
|
||||
}
|
||||
|
||||
return forInRight;
|
||||
|
||||
@@ -29,7 +29,7 @@ define(['./_baseForOwn', './_baseIteratee'], function(baseForOwn, baseIteratee)
|
||||
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
|
||||
*/
|
||||
function forOwn(object, iteratee) {
|
||||
return object && baseForOwn(object, baseIteratee(iteratee));
|
||||
return object && baseForOwn(object, baseIteratee(iteratee, 3));
|
||||
}
|
||||
|
||||
return forOwn;
|
||||
|
||||
@@ -27,7 +27,7 @@ define(['./_baseForOwnRight', './_baseIteratee'], function(baseForOwnRight, base
|
||||
* // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
|
||||
*/
|
||||
function forOwnRight(object, iteratee) {
|
||||
return object && baseForOwnRight(object, baseIteratee(iteratee));
|
||||
return object && baseForOwnRight(object, baseIteratee(iteratee, 3));
|
||||
}
|
||||
|
||||
return forOwnRight;
|
||||
|
||||
@@ -9,7 +9,7 @@ define(['./_baseFunctions', './keys'], function(baseFunctions, keys) {
|
||||
* @memberOf _
|
||||
* @category Object
|
||||
* @param {Object} object The object to inspect.
|
||||
* @returns {Array} Returns the new array of property names.
|
||||
* @returns {Array} Returns the function names.
|
||||
* @see _.functionsIn
|
||||
* @example
|
||||
*
|
||||
|
||||
@@ -9,7 +9,7 @@ define(['./_baseFunctions', './keysIn'], function(baseFunctions, keysIn) {
|
||||
* @since 4.0.0
|
||||
* @category Object
|
||||
* @param {Object} object The object to inspect.
|
||||
* @returns {Array} Returns the new array of property names.
|
||||
* @returns {Array} Returns the function names.
|
||||
* @see _.functions
|
||||
* @example
|
||||
*
|
||||
|
||||
@@ -21,14 +21,14 @@ define(['./_root'], function(root) {
|
||||
* _.isFinite(3);
|
||||
* // => true
|
||||
*
|
||||
* _.isFinite(Number.MAX_VALUE);
|
||||
* // => true
|
||||
*
|
||||
* _.isFinite(3.14);
|
||||
* _.isFinite(Number.MIN_VALUE);
|
||||
* // => true
|
||||
*
|
||||
* _.isFinite(Infinity);
|
||||
* // => false
|
||||
*
|
||||
* _.isFinite('3');
|
||||
* // => false
|
||||
*/
|
||||
function isFinite(value) {
|
||||
return typeof value == 'number' && nativeIsFinite(value);
|
||||
|
||||
3
lang.js
3
lang.js
@@ -1,4 +1,4 @@
|
||||
define(['./castArray', './clone', './cloneDeep', './cloneDeepWith', './cloneWith', './eq', './gt', './gte', './isArguments', './isArray', './isArrayBuffer', './isArrayLike', './isArrayLikeObject', './isBoolean', './isBuffer', './isDate', './isElement', './isEmpty', './isEqual', './isEqualWith', './isError', './isFinite', './isFunction', './isInteger', './isLength', './isMap', './isMatch', './isMatchWith', './isNaN', './isNative', './isNil', './isNull', './isNumber', './isObject', './isObjectLike', './isPlainObject', './isRegExp', './isSafeInteger', './isSet', './isString', './isSymbol', './isTypedArray', './isUndefined', './isWeakMap', './isWeakSet', './lt', './lte', './toArray', './toInteger', './toLength', './toNumber', './toPlainObject', './toSafeInteger', './toString'], function(castArray, clone, cloneDeep, cloneDeepWith, cloneWith, eq, gt, gte, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, lt, lte, toArray, toInteger, toLength, toNumber, toPlainObject, toSafeInteger, toString) {
|
||||
define(['./castArray', './clone', './cloneDeep', './cloneDeepWith', './cloneWith', './eq', './gt', './gte', './isArguments', './isArray', './isArrayBuffer', './isArrayLike', './isArrayLikeObject', './isBoolean', './isBuffer', './isDate', './isElement', './isEmpty', './isEqual', './isEqualWith', './isError', './isFinite', './isFunction', './isInteger', './isLength', './isMap', './isMatch', './isMatchWith', './isNaN', './isNative', './isNil', './isNull', './isNumber', './isObject', './isObjectLike', './isPlainObject', './isRegExp', './isSafeInteger', './isSet', './isString', './isSymbol', './isTypedArray', './isUndefined', './isWeakMap', './isWeakSet', './lt', './lte', './toArray', './toFinite', './toInteger', './toLength', './toNumber', './toPlainObject', './toSafeInteger', './toString'], function(castArray, clone, cloneDeep, cloneDeepWith, cloneWith, eq, gt, gte, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, lt, lte, toArray, toFinite, toInteger, toLength, toNumber, toPlainObject, toSafeInteger, toString) {
|
||||
return {
|
||||
'castArray': castArray,
|
||||
'clone': clone,
|
||||
@@ -48,6 +48,7 @@ define(['./castArray', './clone', './cloneDeep', './cloneDeepWith', './cloneWith
|
||||
'lt': lt,
|
||||
'lte': lte,
|
||||
'toArray': toArray,
|
||||
'toFinite': toFinite,
|
||||
'toInteger': toInteger,
|
||||
'toLength': toLength,
|
||||
'toNumber': toNumber,
|
||||
|
||||
@@ -13,7 +13,7 @@ define(['./_baseClone', './_baseMatches'], function(baseClone, baseMatches) {
|
||||
* @since 3.0.0
|
||||
* @category Util
|
||||
* @param {Object} source The object of property values to match.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new spec function.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
|
||||
@@ -13,7 +13,7 @@ define(['./_baseClone', './_baseMatchesProperty'], function(baseClone, baseMatch
|
||||
* @category Util
|
||||
* @param {Array|string} path The path of the property to get.
|
||||
* @param {*} srcValue The value to match.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new spec function.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
|
||||
@@ -22,7 +22,7 @@ define(['./_MapCache'], function(MapCache) {
|
||||
* @category Function
|
||||
* @param {Function} func The function to have its output memoized.
|
||||
* @param {Function} [resolver] The function to resolve the cache key.
|
||||
* @returns {Function} Returns the new memoizing function.
|
||||
* @returns {Function} Returns the new memoized function.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'a': 1, 'b': 2 };
|
||||
|
||||
2
merge.js
2
merge.js
@@ -5,7 +5,7 @@ define(['./_baseMerge', './_createAssigner'], function(baseMerge, createAssigner
|
||||
* inherited enumerable string keyed properties of source objects into the
|
||||
* destination object. Source properties that resolve to `undefined` are
|
||||
* skipped if a destination value exists. Array and plain object properties
|
||||
* are merged recursively.Other objects and value types are overridden by
|
||||
* are merged recursively. Other objects and value types are overridden by
|
||||
* assignment. Source objects are applied from left to right. Subsequent
|
||||
* sources overwrite property assignments of previous sources.
|
||||
*
|
||||
|
||||
@@ -10,7 +10,7 @@ define(['./_baseInvoke', './rest'], function(baseInvoke, rest) {
|
||||
* @category Util
|
||||
* @param {Array|string} path The path of the method to invoke.
|
||||
* @param {...*} [args] The arguments to invoke the method with.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new invoker function.
|
||||
* @example
|
||||
*
|
||||
* var objects = [
|
||||
|
||||
@@ -11,7 +11,7 @@ define(['./_baseInvoke', './rest'], function(baseInvoke, rest) {
|
||||
* @category Util
|
||||
* @param {Object} object The object to query.
|
||||
* @param {...*} [args] The arguments to invoke the method with.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new invoker function.
|
||||
* @example
|
||||
*
|
||||
* var array = _.times(3, _.constant),
|
||||
|
||||
@@ -13,7 +13,7 @@ define([], function() {
|
||||
* @since 3.0.0
|
||||
* @category Function
|
||||
* @param {Function} predicate The predicate to negate.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new negated function.
|
||||
* @example
|
||||
*
|
||||
* function isEven(n) {
|
||||
|
||||
4
nth.js
4
nth.js
@@ -4,8 +4,8 @@ define(['./_baseNth', './toInteger'], function(baseNth, toInteger) {
|
||||
var undefined;
|
||||
|
||||
/**
|
||||
* Gets the nth element of `array`. If `n` is negative, the nth element
|
||||
* from the end is returned.
|
||||
* Gets the element at `n` index of `array`. If `n` is negative, the nth
|
||||
* element from the end is returned.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
define(['./_baseNth', './rest', './toInteger'], function(baseNth, rest, toInteger) {
|
||||
|
||||
/**
|
||||
* Creates a function that returns its nth argument. If `n` is negative,
|
||||
* Creates a function that gets the argument at `n` index. If `n` is negative,
|
||||
* the nth argument from the end is returned.
|
||||
*
|
||||
* @static
|
||||
@@ -9,7 +9,7 @@ define(['./_baseNth', './rest', './toInteger'], function(baseNth, rest, toIntege
|
||||
* @since 4.0.0
|
||||
* @category Util
|
||||
* @param {number} [n=0] The index of the argument to return.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @returns {Function} Returns the new pass-thru function.
|
||||
* @example
|
||||
*
|
||||
* var func = _.nthArg(1);
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
{
|
||||
"name": "lodash-amd",
|
||||
"version": "4.11.2",
|
||||
"version": "4.12.0",
|
||||
"description": "Lodash exported as AMD modules.",
|
||||
"keywords": "amd, modules, stdlib, util",
|
||||
"homepage": "https://lodash.com/custom-builds",
|
||||
"bugs": "https://github.com/lodash/lodash-cli/issues",
|
||||
"repository": "lodash/lodash",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"main": "main.js",
|
||||
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||
"contributors": [
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user