Comparing version 4.11.2 to 4.12.0
@@ -9,3 +9,3 @@ var get = require('./get'); | ||
* @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. | ||
*/ | ||
@@ -12,0 +12,0 @@ function baseAt(object, paths) { |
@@ -8,3 +8,3 @@ var keys = require('./keys'); | ||
* @param {Object} source The object of property predicates to conform to. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new spec function. | ||
*/ | ||
@@ -11,0 +11,0 @@ function baseConforms(source) { |
@@ -11,3 +11,3 @@ var arrayFilter = require('./_arrayFilter'), | ||
* @param {Array} props The property names to filter. | ||
* @returns {Array} Returns the new array of filtered property names. | ||
* @returns {Array} Returns the function names. | ||
*/ | ||
@@ -14,0 +14,0 @@ function baseFunctions(object, props) { |
@@ -17,7 +17,5 @@ var arrayPush = require('./_arrayPush'), | ||
var result = keysFunc(object); | ||
return isArray(object) | ||
? result | ||
: arrayPush(result, symbolsFunc(object)); | ||
return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); | ||
} | ||
module.exports = baseGetAllKeys; |
@@ -10,3 +10,3 @@ var baseIsMatch = require('./_baseIsMatch'), | ||
* @param {Object} source The object of property values to match. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new spec function. | ||
*/ | ||
@@ -13,0 +13,0 @@ function baseMatches(source) { |
@@ -19,3 +19,3 @@ var baseIsEqual = require('./_baseIsEqual'), | ||
* @param {*} srcValue The value to match. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new spec function. | ||
*/ | ||
@@ -22,0 +22,0 @@ function baseMatchesProperty(path, srcValue) { |
@@ -6,3 +6,3 @@ /** | ||
* @param {string} key The key of the property to get. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new accessor function. | ||
*/ | ||
@@ -9,0 +9,0 @@ function baseProperty(key) { |
@@ -8,3 +8,3 @@ var baseGet = require('./_baseGet'); | ||
* @param {Array|string} path The path of the property to get. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new accessor function. | ||
*/ | ||
@@ -11,0 +11,0 @@ function basePropertyDeep(path) { |
@@ -14,3 +14,3 @@ /* Built-in method references for those with the same name as other `lodash` methods. */ | ||
* @param {boolean} [fromRight] Specify iterating from right to left. | ||
* @returns {Array} Returns the new array of numbers. | ||
* @returns {Array} Returns the range of numbers. | ||
*/ | ||
@@ -17,0 +17,0 @@ function baseRange(start, end, step, fromRight) { |
@@ -10,3 +10,3 @@ var arrayMap = require('./_arrayMap'); | ||
* @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. | ||
*/ | ||
@@ -13,0 +13,0 @@ function baseToPairs(object, props) { |
@@ -6,3 +6,3 @@ /** | ||
* @param {Function} func The function to cap arguments for. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new capped function. | ||
*/ | ||
@@ -9,0 +9,0 @@ function baseUnary(func) { |
@@ -1,25 +0,13 @@ | ||
var isKeyable = require('./_isKeyable'); | ||
/** Used to stand-in for `undefined` hash values. */ | ||
var HASH_UNDEFINED = '__lodash_hash_undefined__'; | ||
/** | ||
* 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); | ||
} | ||
module.exports = cacheHas; |
@@ -9,3 +9,3 @@ /* Built-in method references for those with the same name as other `lodash` methods. */ | ||
* @private | ||
* @param {Array|Object} args The provided arguments. | ||
* @param {Array} args The provided arguments. | ||
* @param {Array} partials The arguments to prepend to those provided. | ||
@@ -12,0 +12,0 @@ * @param {Array} holders The `partials` placeholder indexes. |
@@ -9,3 +9,3 @@ /* Built-in method references for those with the same name as other `lodash` methods. */ | ||
* @private | ||
* @param {Array|Object} args The provided arguments. | ||
* @param {Array} args The provided arguments. | ||
* @param {Array} partials The arguments to append to those provided. | ||
@@ -12,0 +12,0 @@ * @param {Array} holders The `partials` placeholder indexes. |
@@ -18,3 +18,3 @@ var isIterateeCall = require('./_isIterateeCall'), | ||
customizer = typeof customizer == 'function' | ||
customizer = (assigner.length > 3 && typeof customizer == 'function') | ||
? (length--, customizer) | ||
@@ -21,0 +21,0 @@ : undefined; |
@@ -11,3 +11,3 @@ var castSlice = require('./_castSlice'), | ||
* @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. | ||
*/ | ||
@@ -14,0 +14,0 @@ function createCaseFirst(methodName) { |
@@ -5,3 +5,3 @@ var apply = require('./_apply'), | ||
createRecurryWrapper = require('./_createRecurryWrapper'), | ||
getPlaceholder = require('./_getPlaceholder'), | ||
getHolder = require('./_getHolder'), | ||
replaceHolders = require('./_replaceHolders'), | ||
@@ -27,3 +27,3 @@ root = require('./_root'); | ||
index = length, | ||
placeholder = getPlaceholder(wrapper); | ||
placeholder = getHolder(wrapper); | ||
@@ -30,0 +30,0 @@ while (index--) { |
@@ -6,3 +6,3 @@ var composeArgs = require('./_composeArgs'), | ||
createRecurryWrapper = require('./_createRecurryWrapper'), | ||
getPlaceholder = require('./_getPlaceholder'), | ||
getHolder = require('./_getHolder'), | ||
reorder = require('./_reorder'), | ||
@@ -50,4 +50,4 @@ replaceHolders = require('./_replaceHolders'), | ||
var length = arguments.length, | ||
index = length, | ||
args = Array(length); | ||
args = Array(length), | ||
index = length; | ||
@@ -58,3 +58,3 @@ while (index--) { | ||
if (isCurried) { | ||
var placeholder = getPlaceholder(wrapper), | ||
var placeholder = getHolder(wrapper), | ||
holdersCount = countHolders(args, placeholder); | ||
@@ -61,0 +61,0 @@ } |
@@ -15,3 +15,3 @@ var apply = require('./_apply'), | ||
* @param {Function} arrayFunc The function to iterate over iteratees. | ||
* @returns {Function} Returns the new invoker function. | ||
* @returns {Function} Returns the new over function. | ||
*/ | ||
@@ -18,0 +18,0 @@ function createOver(arrayFunc) { |
@@ -42,2 +42,3 @@ var baseSetData = require('./_baseSetData'), | ||
* 256 - `_.ary` | ||
* 512 - `_.flip` | ||
* @param {*} [thisArg] The `this` binding of `func`. | ||
@@ -44,0 +45,0 @@ * @param {Array} [partials] The arguments to be partially applied. |
@@ -1,2 +0,3 @@ | ||
var arraySome = require('./_arraySome'); | ||
var SetCache = require('./_SetCache'), | ||
arraySome = require('./_arraySome'); | ||
@@ -22,5 +23,3 @@ /** Used to compose bitmasks for comparison styles. */ | ||
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, | ||
@@ -37,3 +36,6 @@ othLength = other.length; | ||
} | ||
var result = true; | ||
var index = -1, | ||
result = true, | ||
seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; | ||
stack.set(array, other); | ||
@@ -59,6 +61,8 @@ | ||
// 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); | ||
} | ||
})) { | ||
@@ -65,0 +69,0 @@ result = false; |
30
_Hash.js
@@ -1,6 +0,7 @@ | ||
var nativeCreate = require('./_nativeCreate'); | ||
var hashClear = require('./_hashClear'), | ||
hashDelete = require('./_hashDelete'), | ||
hashGet = require('./_hashGet'), | ||
hashHas = require('./_hashHas'), | ||
hashSet = require('./_hashSet'); | ||
/** Used for built-in method references. */ | ||
var objectProto = Object.prototype; | ||
/** | ||
@@ -11,9 +12,22 @@ * Creates a hash object. | ||
* @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; | ||
module.exports = Hash; |
@@ -1,3 +0,1 @@ | ||
var hashHas = require('./_hashHas'); | ||
/** | ||
@@ -7,2 +5,4 @@ * Removes `key` and its value from the hash. | ||
* @private | ||
* @name delete | ||
* @memberOf Hash | ||
* @param {Object} hash The hash to modify. | ||
@@ -12,6 +12,6 @@ * @param {string} key The key of the value to remove. | ||
*/ | ||
function hashDelete(hash, key) { | ||
return hashHas(hash, key) && delete hash[key]; | ||
function hashDelete(key) { | ||
return this.has(key) && delete this.__data__[key]; | ||
} | ||
module.exports = hashDelete; |
@@ -16,14 +16,16 @@ var nativeCreate = require('./_nativeCreate'); | ||
* @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; | ||
} | ||
module.exports = hashGet; |
@@ -13,10 +13,12 @@ var nativeCreate = require('./_nativeCreate'); | ||
* @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); | ||
} | ||
module.exports = hashHas; |
@@ -10,10 +10,14 @@ var nativeCreate = require('./_nativeCreate'); | ||
* @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; | ||
} | ||
module.exports = hashSet; |
var isArguments = require('./isArguments'), | ||
isArray = require('./isArray'), | ||
isArrayLikeObject = require('./isArrayLikeObject'); | ||
isArray = require('./isArray'); | ||
@@ -13,5 +12,5 @@ /** | ||
function isFlattenable(value) { | ||
return isArrayLikeObject(value) && (isArray(value) || isArguments(value)); | ||
return isArray(value) || isArguments(value); | ||
} | ||
module.exports = isFlattenable; |
@@ -1,6 +0,6 @@ | ||
var mapClear = require('./_mapClear'), | ||
mapDelete = require('./_mapDelete'), | ||
mapGet = require('./_mapGet'), | ||
mapHas = require('./_mapHas'), | ||
mapSet = require('./_mapSet'); | ||
var mapCacheClear = require('./_mapCacheClear'), | ||
mapCacheDelete = require('./_mapCacheDelete'), | ||
mapCacheGet = require('./_mapCacheGet'), | ||
mapCacheHas = require('./_mapCacheHas'), | ||
mapCacheSet = require('./_mapCacheSet'); | ||
@@ -12,11 +12,11 @@ /** | ||
* @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]); | ||
@@ -27,8 +27,8 @@ } | ||
// 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; | ||
module.exports = MapCache; |
/** | ||
* 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. | ||
*/ | ||
@@ -8,0 +8,0 @@ function mapToArray(map) { |
@@ -8,3 +8,3 @@ /** | ||
* @param {*} srcValue The value to match. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new spec function. | ||
*/ | ||
@@ -11,0 +11,0 @@ function matchesStrictComparable(key, srcValue) { |
var MapCache = require('./_MapCache'), | ||
cachePush = require('./_cachePush'); | ||
setCacheAdd = require('./_setCacheAdd'), | ||
setCacheHas = require('./_setCacheHas'); | ||
/** | ||
* | ||
* Creates a set cache object to store unique values. | ||
* Creates an array cache object to store unique values. | ||
* | ||
@@ -18,3 +19,3 @@ * @private | ||
while (++index < length) { | ||
this.push(values[index]); | ||
this.add(values[index]); | ||
} | ||
@@ -24,4 +25,5 @@ } | ||
// Add methods to `SetCache`. | ||
SetCache.prototype.push = cachePush; | ||
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; | ||
SetCache.prototype.has = setCacheHas; | ||
module.exports = SetCache; |
/** | ||
* 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. | ||
*/ | ||
@@ -8,0 +8,0 @@ function setToArray(set) { |
@@ -1,2 +0,3 @@ | ||
var stackClear = require('./_stackClear'), | ||
var ListCache = require('./_ListCache'), | ||
stackClear = require('./_stackClear'), | ||
stackDelete = require('./_stackDelete'), | ||
@@ -12,13 +13,6 @@ stackGet = require('./_stackGet'), | ||
* @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); | ||
} | ||
@@ -25,0 +19,0 @@ |
@@ -0,1 +1,3 @@ | ||
var ListCache = require('./_ListCache'); | ||
/** | ||
@@ -9,5 +11,5 @@ * Removes all key-value entries from the stack. | ||
function stackClear() { | ||
this.__data__ = { 'array': [], 'map': null }; | ||
this.__data__ = new ListCache; | ||
} | ||
module.exports = stackClear; |
@@ -1,3 +0,1 @@ | ||
var assocDelete = require('./_assocDelete'); | ||
/** | ||
@@ -13,8 +11,5 @@ * Removes `key` and its value from the stack. | ||
function stackDelete(key) { | ||
var data = this.__data__, | ||
array = data.array; | ||
return array ? assocDelete(array, key) : data.map['delete'](key); | ||
return this.__data__['delete'](key); | ||
} | ||
module.exports = stackDelete; |
@@ -1,3 +0,1 @@ | ||
var assocGet = require('./_assocGet'); | ||
/** | ||
@@ -13,8 +11,5 @@ * Gets the stack value for `key`. | ||
function stackGet(key) { | ||
var data = this.__data__, | ||
array = data.array; | ||
return array ? assocGet(array, key) : data.map.get(key); | ||
return this.__data__.get(key); | ||
} | ||
module.exports = stackGet; |
@@ -1,3 +0,1 @@ | ||
var assocHas = require('./_assocHas'); | ||
/** | ||
@@ -13,8 +11,5 @@ * Checks if a stack value for `key` exists. | ||
function stackHas(key) { | ||
var data = this.__data__, | ||
array = data.array; | ||
return array ? assocHas(array, key) : data.map.has(key); | ||
return this.__data__.has(key); | ||
} | ||
module.exports = stackHas; |
@@ -1,3 +0,3 @@ | ||
var MapCache = require('./_MapCache'), | ||
assocSet = require('./_assocSet'); | ||
var ListCache = require('./_ListCache'), | ||
MapCache = require('./_MapCache'); | ||
@@ -18,17 +18,7 @@ /** Used as the size to enable large array optimizations. */ | ||
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 cache = this.__data__; | ||
if (cache instanceof ListCache && cache.__data__.length == LARGE_ARRAY_SIZE) { | ||
cache = this.__data__ = new MapCache(cache.__data__); | ||
} | ||
var map = data.map; | ||
if (map) { | ||
map.set(key, value); | ||
} | ||
cache.set(key, value); | ||
return this; | ||
@@ -35,0 +25,0 @@ } |
@@ -15,2 +15,3 @@ module.exports = { | ||
'findLastIndex': require('./findLastIndex'), | ||
'first': require('./first'), | ||
'flatten': require('./flatten'), | ||
@@ -17,0 +18,0 @@ 'flattenDeep': require('./flattenDeep'), |
@@ -17,3 +17,3 @@ var createWrapper = require('./_createWrapper'); | ||
* @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 | ||
@@ -20,0 +20,0 @@ * |
@@ -14,3 +14,3 @@ var baseAt = require('./_baseAt'), | ||
* @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 | ||
@@ -17,0 +17,0 @@ * |
var createWrapper = require('./_createWrapper'), | ||
getPlaceholder = require('./_getPlaceholder'), | ||
getHolder = require('./_getHolder'), | ||
replaceHolders = require('./_replaceHolders'), | ||
@@ -48,3 +48,3 @@ rest = require('./rest'); | ||
if (partials.length) { | ||
var holders = replaceHolders(partials, getPlaceholder(bind)); | ||
var holders = replaceHolders(partials, getHolder(bind)); | ||
bitmask |= PARTIAL_FLAG; | ||
@@ -51,0 +51,0 @@ } |
var createWrapper = require('./_createWrapper'), | ||
getPlaceholder = require('./_getPlaceholder'), | ||
getHolder = require('./_getHolder'), | ||
replaceHolders = require('./_replaceHolders'), | ||
@@ -59,3 +59,3 @@ rest = require('./rest'); | ||
if (partials.length) { | ||
var holders = replaceHolders(partials, getPlaceholder(bindKey)); | ||
var holders = replaceHolders(partials, getHolder(bindKey)); | ||
bitmask |= PARTIAL_FLAG; | ||
@@ -62,0 +62,0 @@ } |
@@ -21,3 +21,3 @@ var baseSlice = require('./_baseSlice'), | ||
* @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 | ||
@@ -24,0 +24,0 @@ * |
@@ -1,5 +0,5 @@ | ||
var arrayConcat = require('./_arrayConcat'), | ||
var arrayPush = require('./_arrayPush'), | ||
baseFlatten = require('./_baseFlatten'), | ||
castArray = require('./castArray'), | ||
copyArray = require('./_copyArray'); | ||
copyArray = require('./_copyArray'), | ||
isArray = require('./isArray'); | ||
@@ -30,14 +30,14 @@ /** | ||
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)) | ||
: []; | ||
} | ||
module.exports = concat; |
@@ -20,3 +20,3 @@ var apply = require('./_apply'), | ||
* @param {Array} pairs The predicate-function pairs. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new composite function. | ||
* @example | ||
@@ -23,0 +23,0 @@ * |
@@ -14,3 +14,3 @@ var baseClone = require('./_baseClone'), | ||
* @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 | ||
@@ -17,0 +17,0 @@ * |
@@ -9,3 +9,3 @@ /** | ||
* @param {*} value The value to return from the new function. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new constant function. | ||
* @example | ||
@@ -12,0 +12,0 @@ * |
/** | ||
* @license | ||
* lodash 4.11.2 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE | ||
* Build: `lodash core -o ./dist/lodash.core.js` | ||
* lodash lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE | ||
*/ | ||
@@ -9,23 +8,22 @@ ;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n,t,r){var e;return r(n,function(n,r,u){return t(n,r,u)?(e=n,false):void 0}),e}function r(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function e(n,t){return O(t,function(t){return n[t]})}function u(n){return n&&n.Object===Object?n:null}function o(n){return gn[n]}function i(n){var t=false;if(null!=n&&typeof n.toString!="function")try{t=!!(n+"")}catch(r){}return t}function c(n){return n instanceof f?n:new f(n)}function f(n,t){ | ||
}return f}function v(n,t){var r=[];return zn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function y(t,r,e,u,o){var i=-1,c=t.length;for(e||(e=G),o||(o=[]);++i<c;){var f=t[i];r>0&&e(f)?r>1?y(f,r-1,e,u,o):n(o,f):u||(o[o.length]=f)}return o}function g(n,t){return n&&Cn(n,t,on)}function b(n,t){return v(t,function(t){return Y(n[t])})}function _(n,t){return n>t}function d(n,t,r,e,u){return n===t?true:null==n||null==t||!nn(n)&&!tn(t)?n!==n&&t!==t:j(n,t,d,r,e,u)}function j(n,t,r,e,u,o){var c=Vn(n),f=Vn(t),a="[object Array]",l="[object Array]"; | ||
c||(a=Sn.call(n),a="[object Arguments]"==a?"[object Object]":a),f||(l=Sn.call(t),l="[object Arguments]"==l?"[object Object]":l);var p="[object Object]"==a&&!i(n),f="[object Object]"==l&&!i(t),l=a==l;o||(o=[]);var s=U(o,function(t){return t[0]===n});return s&&s[1]?s[1]==t:(o.push([n,t]),l&&!p?(r=c||isTypedArray(n)?$(n,t,r,e,u,o):q(n,t,a),o.pop(),r):2&u||(c=p&&kn.call(n,"__wrapped__"),a=f&&kn.call(t,"__wrapped__"),!c&&!a)?l?(r=z(n,t,r,e,u,o),o.pop(),r):false:(c=c?n.value():n,t=a?t.value():t,r=r(c,t,e,u,o), | ||
o.pop(),r))}function m(n){return typeof n=="function"?n:null==n?an:(typeof n=="object"?A:k)(n)}function w(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function x(n,t){return t>n}function O(n,t){var r=-1,e=X(n)?Array(n.length):[];return zn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function A(n){var t=on(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&d(n[u],r[u],pn,3)))return false}return true}}function E(n,t){return n=Object(n),H(t,function(t,r){ | ||
return r in n&&(t[r]=n[r]),t},{})}function k(n){return function(t){return null==t?pn:t[n]}}function N(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e<u;)r[e]=n[e+t];return r}function S(n){return N(n,0,n.length)}function T(n,t){var r;return zn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function F(t,r){return H(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args))},t)}function R(n,t,r,e){r||(r={});for(var u=-1,o=t.length;++u<o;){ | ||
var i=t[u],c=e?e(r[i],n[i],i,r,n):n[i],f=r,a=f[i];kn.call(f,i)&&(a===c||a!==a&&c!==c)&&(c!==pn||i in f)||(f[i]=c)}return r}function B(n){return L(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:pn,o=typeof o=="function"?(u--,o):pn;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function D(n){return function(){var t=arguments,r=l(n.prototype),t=n.apply(r,t);return nn(t)?t:r}}function I(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==On&&this instanceof e?u:n;++c<f;)a[c]=r[c]; | ||
for(;i--;)a[c++]=arguments[++o];return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");var u=D(n);return e}function $(n,t,r,e,u,o){var i=-1,c=1&u,f=n.length,a=t.length;if(f!=a&&!(2&u&&a>f))return false;for(a=true;++i<f;){var l=n[i],p=t[i];if(void 0!==pn){a=false;break}if(c){if(!T(t,function(n){return l===n||r(l,n,e,u,o)})){a=false;break}}else if(l!==p&&!r(l,p,e,u,o)){a=false;break}}return a}function q(n,t,r){switch(r){case"[object Boolean]":case"[object Date]":return+n==+t;case"[object Error]": | ||
return n.name==t.name&&n.message==t.message;case"[object Number]":return n!=+n?t!=+t:n==+t;case"[object RegExp]":case"[object String]":return n==t+""}return false}function z(n,t,r,e,u,o){var i=2&u,c=on(n),f=c.length,a=on(t).length;if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:kn.call(t,p)))return false}for(a=true;++l<f;){var p=c[l],s=n[p],h=t[p];if(void 0!==pn||s!==h&&!r(s,h,e,u,o)){a=false;break}i||(i="constructor"==p)}return a&&!i&&(r=n.constructor,e=t.constructor,r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(a=false)), | ||
a}function C(n){var t=n?n.length:pn;if(Z(t)&&(Vn(n)||en(n)||W(n))){n=String;for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);t=e}else t=null;return t}function G(n){return tn(n)&&X(n)&&(Vn(n)||W(n))}function J(n,t){return t=null==t?9007199254740991:t,!!t&&(typeof n=="number"||yn.test(n))&&n>-1&&0==n%1&&t>n}function M(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||En)}function P(n){return n&&n.length?n[0]:pn}function U(n,r){return t(n,m(r),zn)}function V(n,t){return zn(n,m(t))}function H(n,t,e){ | ||
return r(n,m(t),e,3>arguments.length,zn)}function K(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=pn),r}}function L(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=qn(t===pn?n.length-1:Hn(t),0),function(){for(var r=arguments,e=-1,u=qn(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];for(u=Array(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function Q(){ | ||
if(!arguments.length)return[];var n=arguments[0];return Vn(n)?n:[n]}function W(n){return tn(n)&&X(n)&&kn.call(n,"callee")&&(!Dn.call(n,"callee")||"[object Arguments]"==Sn.call(n))}function X(n){return null!=n&&Z(Gn(n))&&!Y(n)}function Y(n){return n=nn(n)?Sn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function Z(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function nn(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function tn(n){return!!n&&typeof n=="object"; | ||
}function rn(n){return typeof n=="number"||tn(n)&&"[object Number]"==Sn.call(n)}function en(n){return typeof n=="string"||!Vn(n)&&tn(n)&&"[object String]"==Sn.call(n)}function un(n){return typeof n=="string"?n:null==n?"":n+""}function on(n){var t=M(n);if(!t&&!X(n))return $n(Object(n));var r,e=C(n),u=!!e,e=e||[],o=e.length;for(r in n)!kn.call(n,r)||u&&("length"==r||J(r,o))||t&&"constructor"==r||e.push(r);return e}function cn(n){for(var t=-1,r=M(n),e=w(n),u=e.length,o=C(n),i=!!o,o=o||[],c=o.length;++t<u;){ | ||
var f=e[t];i&&("length"==f||J(f,c))||"constructor"==f&&(r||!kn.call(n,f))||o.push(f)}return o}function fn(n){return n?e(n,on(n)):[]}function an(n){return n}function ln(t,r,e){var u=on(r),o=b(r,u);null!=e||nn(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=b(r,on(r)));var i=!(nn(e)&&"chain"in e&&!e.chain),c=Y(t);return zn(o,function(e){var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=S(this.__actions__)).push({func:u,args:arguments, | ||
thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var pn,sn=1/0,hn=/[&<>"'`]/g,vn=RegExp(hn.source),yn=/^(?:0|[1-9]\d*)$/,gn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},bn={"function":true,object:true},_n=bn[typeof exports]&&exports&&!exports.nodeType?exports:pn,dn=bn[typeof module]&&module&&!module.nodeType?module:pn,jn=dn&&dn.exports===_n?_n:pn,mn=u(bn[typeof self]&&self),wn=u(bn[typeof window]&&window),xn=u(bn[typeof this]&&this),On=u(_n&&dn&&typeof global=="object"&&global)||wn!==(xn&&xn.window)&&wn||mn||xn||Function("return this")(),An=Array.prototype,En=Object.prototype,kn=En.hasOwnProperty,Nn=0,Sn=En.toString,Tn=On._,Fn=On.Reflect,Rn=Fn?Fn.a:pn,Bn=Object.create,Dn=En.propertyIsEnumerable,In=On.isFinite,$n=Object.keys,qn=Math.max; | ||
f.prototype=l(c.prototype),f.prototype.constructor=f;var zn=function(n,t){return function(r,e){if(null==r)return r;if(!X(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}(g),Cn=function(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}();Rn&&!Dn.call({valueOf:1},"valueOf")&&(w=function(n){n=Rn(n);for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r});var Gn=k("length"),Jn=String,Mn=L(function(n,t,r){ | ||
return I(n,t,r)}),Pn=L(function(n,t){return p(n,1,t)}),Un=L(function(n,t,r){return p(n,Kn(t)||0,r)}),Vn=Array.isArray,Hn=Number,Kn=Number,Ln=B(function(n,t){R(t,on(t),n)}),Qn=B(function(n,t){R(t,cn(t),n)}),Wn=B(function(n,t,r,e){R(t,cn(t),n,e)}),Xn=L(function(n){return n.push(pn,a),Wn.apply(pn,n)}),Yn=L(function(n,t){return null==n?{}:E(n,O(y(t,1),Jn))}),Zn=m;c.assignIn=Qn,c.before=K,c.bind=Mn,c.chain=function(n){return n=c(n),n.__chain__=true,n},c.compact=function(n){return v(n,Boolean)},c.concat=function(){ | ||
var t=arguments.length,r=Q(arguments[0]);if(2>t)return t?S(r):[];for(var e=Array(t-1);t--;)e[t-1]=arguments[t];return y(e,1),n(S(r),fn)},c.create=function(n,t){var r=l(n);return t?Ln(r,t):r},c.defaults=Xn,c.defer=Pn,c.delay=Un,c.filter=function(n,t){return v(n,m(t))},c.flatten=function(n){return n&&n.length?y(n,1):[]},c.flattenDeep=function(n){return n&&n.length?y(n,sn):[]},c.iteratee=Zn,c.keys=on,c.map=function(n,t){return O(n,m(t))},c.matches=function(n){return A(Ln({},n))},c.mixin=ln,c.negate=function(n){ | ||
if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},c.once=function(n){return K(2,n)},c.pick=Yn,c.slice=function(n,t,r){var e=n?n.length:0;return r=r===pn?e:+r,e?N(n,null==t?0:+t,r):[]},c.sortBy=function(n,t){var r=0;return t=m(t),O(O(n,function(n,e,u){return{value:n,index:r++,criteria:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==pn,o=null===r,i=r===r,c=e!==pn,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){ | ||
r=1;break n}if(!o&&e>r||f&&u&&i||!c&&i||!a){r=-1;break n}}r=0}return r||n.index-t.index}),k("value"))},c.tap=function(n,t){return t(n),n},c.thru=function(n,t){return t(n)},c.toArray=function(n){return X(n)?n.length?S(n):[]:fn(n)},c.values=fn,c.extend=Qn,ln(c,c),c.clone=function(n){return nn(n)?Vn(n)?S(n):R(n,on(n)):n},c.escape=function(n){return(n=un(n))&&vn.test(n)?n.replace(hn,o):n},c.every=function(n,t,r){return t=r?pn:t,s(n,m(t))},c.find=U,c.forEach=V,c.has=function(n,t){return null!=n&&kn.call(n,t); | ||
},c.head=P,c.identity=an,c.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?qn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1},c.isArguments=W,c.isArray=Vn,c.isBoolean=function(n){return true===n||false===n||tn(n)&&"[object Boolean]"==Sn.call(n)},c.isDate=function(n){return tn(n)&&"[object Date]"==Sn.call(n)},c.isEmpty=function(n){return X(n)&&(Vn(n)||en(n)||Y(n.splice)||W(n))?!n.length:!on(n).length},c.isEqual=function(n,t){return d(n,t)}, | ||
c.isFinite=function(n){return typeof n=="number"&&In(n)},c.isFunction=Y,c.isNaN=function(n){return rn(n)&&n!=+n},c.isNull=function(n){return null===n},c.isNumber=rn,c.isObject=nn,c.isRegExp=function(n){return nn(n)&&"[object RegExp]"==Sn.call(n)},c.isString=en,c.isUndefined=function(n){return n===pn},c.last=function(n){var t=n?n.length:0;return t?n[t-1]:pn},c.max=function(n){return n&&n.length?h(n,an,_):pn},c.min=function(n){return n&&n.length?h(n,an,x):pn},c.noConflict=function(){return On._===this&&(On._=Tn), | ||
this},c.noop=function(){},c.reduce=H,c.result=function(n,t,r){return t=null==n?pn:n[t],t===pn&&(t=r),Y(t)?t.call(n):t},c.size=function(n){return null==n?0:(n=X(n)?n:on(n),n.length)},c.some=function(n,t,r){return t=r?pn:t,T(n,m(t))},c.uniqueId=function(n){var t=++Nn;return un(n)+t},c.each=V,c.first=P,ln(c,function(){var n={};return g(c,function(t,r){kn.call(c.prototype,r)||(n[r]=t)}),n}(),{chain:false}),c.VERSION="4.11.2",zn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){ | ||
var t=(/^(?:replace|split)$/.test(n)?String.prototype:An)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);c.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Vn(u)?u:[],n)}return this[r](function(r){return t.apply(Vn(r)?r:[],n)})}}),c.prototype.toJSON=c.prototype.valueOf=c.prototype.value=function(){return F(this.__wrapped__,this.__actions__)},(wn||mn||{})._=c,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){ | ||
return c}):_n&&dn?(jn&&((dn.exports=c)._=c),_n._=c):On._=c}).call(this); | ||
c||(a=Sn.call(n),a="[object Arguments]"==a?"[object Object]":a),f||(l=Sn.call(t),l="[object Arguments]"==l?"[object Object]":l);var p="[object Object]"==a&&!i(n),f="[object Object]"==l&&!i(t),l=a==l;o||(o=[]);var s=V(o,function(t){return t[0]===n});return s&&s[1]?s[1]==t:(o.push([n,t]),l&&!p?(r=c||isTypedArray(n)?$(n,t,r,e,u,o):q(n,t,a),o.pop(),r):2&u||(c=p&&kn.call(n,"__wrapped__"),a=f&&kn.call(t,"__wrapped__"),!c&&!a)?l?(r=z(n,t,r,e,u,o),o.pop(),r):false:(c=c?n.value():n,t=a?t.value():t,r=r(c,t,e,u,o), | ||
o.pop(),r))}function m(n){return typeof n=="function"?n:null==n?an:(typeof n=="object"?A:k)(n)}function w(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function x(n,t){return t>n}function O(n,t){var r=-1,e=X(n)?Array(n.length):[];return zn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function A(n){var t=on(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&d(n[u],r[u],pn,3)))return false}return true}}function E(n,t){return n=Object(n),K(t,function(t,r){ | ||
return r in n&&(t[r]=n[r]),t},{})}function k(n){return function(t){return null==t?pn:t[n]}}function N(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e<u;)r[e]=n[e+t];return r}function S(n){return N(n,0,n.length)}function T(n,t){var r;return zn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function F(t,r){return K(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args))},t)}function R(n,t,r,e){r||(r={});for(var u=-1,o=t.length;++u<o;){ | ||
var i=t[u],c=e?e(r[i],n[i],i,r,n):n[i],f=r,a=f[i];kn.call(f,i)&&(a===c||a!==a&&c!==c)&&(c!==pn||i in f)||(f[i]=c)}return r}function B(n){return Q(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:pn,o=n.length>3&&typeof o=="function"?(u--,o):pn;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function D(n){return function(){var t=arguments,r=l(n.prototype),t=n.apply(r,t);return nn(t)?t:r}}function I(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==On&&this instanceof e?u:n;++c<f;)a[c]=r[c]; | ||
for(;i--;)a[c++]=arguments[++o];return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");var u=D(n);return e}function $(n,t,r,e,u,o){var i=n.length,c=t.length;if(i!=c&&!(2&u&&c>i))return false;for(var c=-1,f=true,a=1&u?[]:pn;++c<i;){var l=n[c],p=t[c];if(void 0!==pn){f=false;break}if(a){if(!T(t,function(n,t){return U(a,t)||l!==n&&!r(l,n,e,u,o)?void 0:a.push(t)})){f=false;break}}else if(l!==p&&!r(l,p,e,u,o)){f=false;break}}return f}function q(n,t,r){switch(r){case"[object Boolean]":case"[object Date]": | ||
return+n==+t;case"[object Error]":return n.name==t.name&&n.message==t.message;case"[object Number]":return n!=+n?t!=+t:n==+t;case"[object RegExp]":case"[object String]":return n==t+""}return false}function z(n,t,r,e,u,o){var i=2&u,c=on(n),f=c.length,a=on(t).length;if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:kn.call(t,p)))return false}for(a=true;++l<f;){var p=c[l],s=n[p],h=t[p];if(void 0!==pn||s!==h&&!r(s,h,e,u,o)){a=false;break}i||(i="constructor"==p)}return a&&!i&&(r=n.constructor,e=t.constructor, | ||
r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(a=false)),a}function C(n){var t=n?n.length:pn;if(Z(t)&&(Vn(n)||en(n)||W(n))){n=String;for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);t=e}else t=null;return t}function G(n){return Vn(n)||W(n)}function J(n,t){return t=null==t?9007199254740991:t,!!t&&(typeof n=="number"||yn.test(n))&&n>-1&&0==n%1&&t>n}function M(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||En); | ||
}function P(n){return n&&n.length?n[0]:pn}function U(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?qn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1}function V(n,r){return t(n,m(r),zn)}function H(n,t){return zn(n,m(t))}function K(n,t,e){return r(n,m(t),e,3>arguments.length,zn)}function L(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=pn),r}} | ||
function Q(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=qn(t===pn?n.length-1:Hn(t),0),function(){for(var r=arguments,e=-1,u=qn(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];for(u=Array(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function W(n){return tn(n)&&X(n)&&kn.call(n,"callee")&&(!Dn.call(n,"callee")||"[object Arguments]"==Sn.call(n))}function X(n){return null!=n&&Z(Gn(n))&&!Y(n)}function Y(n){return n=nn(n)?Sn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n; | ||
}function Z(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function nn(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function tn(n){return!!n&&typeof n=="object"}function rn(n){return typeof n=="number"||tn(n)&&"[object Number]"==Sn.call(n)}function en(n){return typeof n=="string"||!Vn(n)&&tn(n)&&"[object String]"==Sn.call(n)}function un(n){return typeof n=="string"?n:null==n?"":n+""}function on(n){var t=M(n);if(!t&&!X(n))return $n(Object(n));var r,e=C(n),u=!!e,e=e||[],o=e.length; | ||
for(r in n)!kn.call(n,r)||u&&("length"==r||J(r,o))||t&&"constructor"==r||e.push(r);return e}function cn(n){for(var t=-1,r=M(n),e=w(n),u=e.length,o=C(n),i=!!o,o=o||[],c=o.length;++t<u;){var f=e[t];i&&("length"==f||J(f,c))||"constructor"==f&&(r||!kn.call(n,f))||o.push(f)}return o}function fn(n){return n?e(n,on(n)):[]}function an(n){return n}function ln(t,r,e){var u=on(r),o=b(r,u);null!=e||nn(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=b(r,on(r)));var i=!(nn(e)&&"chain"in e&&!e.chain),c=Y(t);return zn(o,function(e){ | ||
var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=S(this.__actions__)).push({func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var pn,sn=1/0,hn=/[&<>"'`]/g,vn=RegExp(hn.source),yn=/^(?:0|[1-9]\d*)$/,gn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},bn={"function":true,object:true},_n=bn[typeof exports]&&exports&&!exports.nodeType?exports:pn,dn=bn[typeof module]&&module&&!module.nodeType?module:pn,jn=dn&&dn.exports===_n?_n:pn,mn=u(bn[typeof self]&&self),wn=u(bn[typeof window]&&window),xn=u(bn[typeof this]&&this),On=u(_n&&dn&&typeof global=="object"&&global)||wn!==(xn&&xn.window)&&wn||mn||xn||Function("return this")(),An=Array.prototype,En=Object.prototype,kn=En.hasOwnProperty,Nn=0,Sn=En.toString,Tn=On._,Fn=On.Reflect,Rn=Fn?Fn.a:pn,Bn=Object.create,Dn=En.propertyIsEnumerable,In=On.isFinite,$n=Object.keys,qn=Math.max; | ||
f.prototype=l(c.prototype),f.prototype.constructor=f;var zn=function(n,t){return function(r,e){if(null==r)return r;if(!X(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}(g),Cn=function(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}();Rn&&!Dn.call({valueOf:1},"valueOf")&&(w=function(n){n=Rn(n);for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r});var Gn=k("length"),Jn=String,Mn=Q(function(n,t,r){ | ||
return I(n,t,r)}),Pn=Q(function(n,t){return p(n,1,t)}),Un=Q(function(n,t,r){return p(n,Kn(t)||0,r)}),Vn=Array.isArray,Hn=Number,Kn=Number,Ln=B(function(n,t){R(t,on(t),n)}),Qn=B(function(n,t){R(t,cn(t),n)}),Wn=B(function(n,t,r,e){R(t,cn(t),n,e)}),Xn=Q(function(n){return n.push(pn,a),Wn.apply(pn,n)}),Yn=Q(function(n,t){return null==n?{}:E(n,O(y(t,1),Jn))}),Zn=m;c.assignIn=Qn,c.before=L,c.bind=Mn,c.chain=function(n){return n=c(n),n.__chain__=true,n},c.compact=function(n){return v(n,Boolean)},c.concat=function(){ | ||
for(var t=arguments.length,r=Array(t?t-1:0),e=arguments[0],u=t;u--;)r[u-1]=arguments[u];return t?n(Vn(e)?S(e):[e],y(r,1)):[]},c.create=function(n,t){var r=l(n);return t?Ln(r,t):r},c.defaults=Xn,c.defer=Pn,c.delay=Un,c.filter=function(n,t){return v(n,m(t))},c.flatten=function(n){return n&&n.length?y(n,1):[]},c.flattenDeep=function(n){return n&&n.length?y(n,sn):[]},c.iteratee=Zn,c.keys=on,c.map=function(n,t){return O(n,m(t))},c.matches=function(n){return A(Ln({},n))},c.mixin=ln,c.negate=function(n){ | ||
if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},c.once=function(n){return L(2,n)},c.pick=Yn,c.slice=function(n,t,r){var e=n?n.length:0;return r=r===pn?e:+r,e?N(n,null==t?0:+t,r):[]},c.sortBy=function(n,t){var r=0;return t=m(t),O(O(n,function(n,e,u){return{value:n,index:r++,criteria:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.criteria;var e=t.criteria;if(r!==e){var u=r!==pn,o=null===r,i=r===r,c=e!==pn,f=null===e,a=e===e;if(!f&&r>e||o&&c&&a||!u&&a||!i){ | ||
r=1;break n}if(!o&&e>r||f&&u&&i||!c&&i||!a){r=-1;break n}}r=0}return r||n.index-t.index}),k("value"))},c.tap=function(n,t){return t(n),n},c.thru=function(n,t){return t(n)},c.toArray=function(n){return X(n)?n.length?S(n):[]:fn(n)},c.values=fn,c.extend=Qn,ln(c,c),c.clone=function(n){return nn(n)?Vn(n)?S(n):R(n,on(n)):n},c.escape=function(n){return(n=un(n))&&vn.test(n)?n.replace(hn,o):n},c.every=function(n,t,r){return t=r?pn:t,s(n,m(t))},c.find=V,c.forEach=H,c.has=function(n,t){return null!=n&&kn.call(n,t); | ||
},c.head=P,c.identity=an,c.indexOf=U,c.isArguments=W,c.isArray=Vn,c.isBoolean=function(n){return true===n||false===n||tn(n)&&"[object Boolean]"==Sn.call(n)},c.isDate=function(n){return tn(n)&&"[object Date]"==Sn.call(n)},c.isEmpty=function(n){return X(n)&&(Vn(n)||en(n)||Y(n.splice)||W(n))?!n.length:!on(n).length},c.isEqual=function(n,t){return d(n,t)},c.isFinite=function(n){return typeof n=="number"&&In(n)},c.isFunction=Y,c.isNaN=function(n){return rn(n)&&n!=+n},c.isNull=function(n){return null===n},c.isNumber=rn, | ||
c.isObject=nn,c.isRegExp=function(n){return nn(n)&&"[object RegExp]"==Sn.call(n)},c.isString=en,c.isUndefined=function(n){return n===pn},c.last=function(n){var t=n?n.length:0;return t?n[t-1]:pn},c.max=function(n){return n&&n.length?h(n,an,_):pn},c.min=function(n){return n&&n.length?h(n,an,x):pn},c.noConflict=function(){return On._===this&&(On._=Tn),this},c.noop=function(){},c.reduce=K,c.result=function(n,t,r){return t=null==n?pn:n[t],t===pn&&(t=r),Y(t)?t.call(n):t},c.size=function(n){return null==n?0:(n=X(n)?n:on(n), | ||
n.length)},c.some=function(n,t,r){return t=r?pn:t,T(n,m(t))},c.uniqueId=function(n){var t=++Nn;return un(n)+t},c.each=H,c.first=P,ln(c,function(){var n={};return g(c,function(t,r){kn.call(c.prototype,r)||(n[r]=t)}),n}(),{chain:false}),c.VERSION="4.12.0",zn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:An)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);c.prototype[n]=function(){ | ||
var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Vn(u)?u:[],n)}return this[r](function(r){return t.apply(Vn(r)?r:[],n)})}}),c.prototype.toJSON=c.prototype.valueOf=c.prototype.value=function(){return F(this.__wrapped__,this.__actions__)},(wn||mn||{})._=c,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return c}):_n&&dn?(jn&&((dn.exports=c)._=c),_n._=c):On._=c}).call(this); |
@@ -14,3 +14,3 @@ var createWrapper = require('./_createWrapper'); | ||
* @param {Function} func The function to flip arguments for. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new flipped function. | ||
* @example | ||
@@ -17,0 +17,0 @@ * |
@@ -13,3 +13,3 @@ var createFlow = require('./_createFlow'); | ||
* @param {...(Function|Function[])} [funcs] Functions to invoke. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new composite function. | ||
* @see _.flowRight | ||
@@ -16,0 +16,0 @@ * @example |
@@ -12,3 +12,3 @@ var createFlow = require('./_createFlow'); | ||
* @param {...(Function|Function[])} [funcs] Functions to invoke. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new composite function. | ||
* @see _.flow | ||
@@ -15,0 +15,0 @@ * @example |
@@ -37,7 +37,6 @@ var arrayEach = require('./_arrayEach'), | ||
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)); | ||
} | ||
module.exports = forEach; |
@@ -27,7 +27,6 @@ var arrayEachRight = require('./_arrayEachRight'), | ||
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)); | ||
} | ||
module.exports = forEachRight; |
@@ -36,5 +36,5 @@ var baseFor = require('./_baseFor'), | ||
? object | ||
: baseFor(object, baseIteratee(iteratee), keysIn); | ||
: baseFor(object, baseIteratee(iteratee, 3), keysIn); | ||
} | ||
module.exports = forIn; |
@@ -34,5 +34,5 @@ var baseForRight = require('./_baseForRight'), | ||
? object | ||
: baseForRight(object, baseIteratee(iteratee), keysIn); | ||
: baseForRight(object, baseIteratee(iteratee, 3), keysIn); | ||
} | ||
module.exports = forInRight; |
@@ -33,5 +33,5 @@ var baseForOwn = require('./_baseForOwn'), | ||
function forOwn(object, iteratee) { | ||
return object && baseForOwn(object, baseIteratee(iteratee)); | ||
return object && baseForOwn(object, baseIteratee(iteratee, 3)); | ||
} | ||
module.exports = forOwn; |
@@ -31,5 +31,5 @@ var baseForOwnRight = require('./_baseForOwnRight'), | ||
function forOwnRight(object, iteratee) { | ||
return object && baseForOwnRight(object, baseIteratee(iteratee)); | ||
return object && baseForOwnRight(object, baseIteratee(iteratee, 3)); | ||
} | ||
module.exports = forOwnRight; |
@@ -192,10 +192,6 @@ var mapping = require('./_mapping'), | ||
} | ||
var methods = [], | ||
methodNames = []; | ||
var pairs = []; | ||
each(keys(source), function(key) { | ||
var value = source[key]; | ||
if (isFunction(value)) { | ||
methodNames.push(key); | ||
methods.push(func.prototype[key]); | ||
if (isFunction(source[key])) { | ||
pairs.push([key, func.prototype[key]]); | ||
} | ||
@@ -206,8 +202,8 @@ }); | ||
each(methodNames, function(methodName, index) { | ||
var method = methods[index]; | ||
if (isFunction(method)) { | ||
func.prototype[methodName] = method; | ||
each(pairs, function(pair) { | ||
var value = pair[1]; | ||
if (isFunction(value)) { | ||
func.prototype[pair[0]] = value; | ||
} else { | ||
delete func.prototype[methodName]; | ||
delete func.prototype[pair[0]]; | ||
} | ||
@@ -240,2 +236,3 @@ }); | ||
length = path.length, | ||
lastIndex = length - 1, | ||
result = clone(Object(object)), | ||
@@ -249,3 +246,3 @@ nested = result; | ||
if (value != null) { | ||
nested[key] = clone(Object(value)); | ||
nested[path[index]] = clone(index == lastIndex ? value : Object(value)); | ||
} | ||
@@ -252,0 +249,0 @@ nested = nested[key]; |
@@ -67,3 +67,3 @@ /** Used to map aliases to their real names. */ | ||
'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', | ||
'eq', 'every', 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', | ||
'eq', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', | ||
'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', | ||
@@ -70,0 +70,0 @@ 'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', |
@@ -13,3 +13,3 @@ var baseFunctions = require('./_baseFunctions'), | ||
* @param {Object} object The object to inspect. | ||
* @returns {Array} Returns the new array of property names. | ||
* @returns {Array} Returns the function names. | ||
* @see _.functionsIn | ||
@@ -16,0 +16,0 @@ * @example |
@@ -13,3 +13,3 @@ var baseFunctions = require('./_baseFunctions'), | ||
* @param {Object} object The object to inspect. | ||
* @returns {Array} Returns the new array of property names. | ||
* @returns {Array} Returns the function names. | ||
* @see _.functions | ||
@@ -16,0 +16,0 @@ * @example |
@@ -24,10 +24,10 @@ var root = require('./_root'); | ||
* | ||
* _.isFinite(Number.MAX_VALUE); | ||
* _.isFinite(Number.MIN_VALUE); | ||
* // => true | ||
* | ||
* _.isFinite(3.14); | ||
* // => true | ||
* | ||
* _.isFinite(Infinity); | ||
* // => false | ||
* | ||
* _.isFinite('3'); | ||
* // => false | ||
*/ | ||
@@ -34,0 +34,0 @@ function isFinite(value) { |
@@ -50,2 +50,3 @@ module.exports = { | ||
'toArray': require('./toArray'), | ||
'toFinite': require('./toFinite'), | ||
'toInteger': require('./toInteger'), | ||
@@ -52,0 +53,0 @@ 'toLength': require('./toLength'), |
@@ -17,3 +17,3 @@ var baseClone = require('./_baseClone'), | ||
* @param {Object} source The object of property values to match. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new spec function. | ||
* @example | ||
@@ -20,0 +20,0 @@ * |
@@ -17,3 +17,3 @@ var baseClone = require('./_baseClone'), | ||
* @param {*} srcValue The value to match. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new spec function. | ||
* @example | ||
@@ -20,0 +20,0 @@ * |
@@ -25,3 +25,3 @@ var MapCache = require('./_MapCache'); | ||
* @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 | ||
@@ -28,0 +28,0 @@ * |
@@ -9,3 +9,3 @@ var baseMerge = require('./_baseMerge'), | ||
* 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 | ||
@@ -12,0 +12,0 @@ * sources overwrite property assignments of previous sources. |
@@ -14,3 +14,3 @@ var baseInvoke = require('./_baseInvoke'), | ||
* @param {...*} [args] The arguments to invoke the method with. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new invoker function. | ||
* @example | ||
@@ -17,0 +17,0 @@ * |
@@ -15,3 +15,3 @@ var baseInvoke = require('./_baseInvoke'), | ||
* @param {...*} [args] The arguments to invoke the method with. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new invoker function. | ||
* @example | ||
@@ -18,0 +18,0 @@ * |
@@ -14,3 +14,3 @@ /** Used as the `TypeError` message for "Functions" methods. */ | ||
* @param {Function} predicate The predicate to negate. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new negated function. | ||
* @example | ||
@@ -17,0 +17,0 @@ * |
@@ -5,4 +5,4 @@ var baseNth = require('./_baseNth'), | ||
/** | ||
* 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. | ||
* | ||
@@ -9,0 +9,0 @@ * @static |
@@ -6,3 +6,3 @@ var baseNth = require('./_baseNth'), | ||
/** | ||
* 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. | ||
@@ -15,3 +15,3 @@ * | ||
* @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 | ||
@@ -18,0 +18,0 @@ * |
{ | ||
"name": "lodash", | ||
"version": "4.11.2", | ||
"version": "4.12.0", | ||
"description": "Lodash modular utilities.", | ||
@@ -5,0 +5,0 @@ "keywords": "modules, stdlib, util", |
var createWrapper = require('./_createWrapper'), | ||
getPlaceholder = require('./_getPlaceholder'), | ||
getHolder = require('./_getHolder'), | ||
replaceHolders = require('./_replaceHolders'), | ||
@@ -43,3 +43,3 @@ rest = require('./rest'); | ||
var partial = rest(function(func, partials) { | ||
var holders = replaceHolders(partials, getPlaceholder(partial)); | ||
var holders = replaceHolders(partials, getHolder(partial)); | ||
return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders); | ||
@@ -46,0 +46,0 @@ }); |
var createWrapper = require('./_createWrapper'), | ||
getPlaceholder = require('./_getPlaceholder'), | ||
getHolder = require('./_getHolder'), | ||
replaceHolders = require('./_replaceHolders'), | ||
@@ -42,3 +42,3 @@ rest = require('./rest'); | ||
var partialRight = rest(function(func, partials) { | ||
var holders = replaceHolders(partials, getPlaceholder(partialRight)); | ||
var holders = replaceHolders(partials, getHolder(partialRight)); | ||
return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders); | ||
@@ -45,0 +45,0 @@ }); |
@@ -14,3 +14,3 @@ var baseProperty = require('./_baseProperty'), | ||
* @param {Array|string} path The path of the property to get. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new accessor function. | ||
* @example | ||
@@ -17,0 +17,0 @@ * |
@@ -12,3 +12,3 @@ var baseGet = require('./_baseGet'); | ||
* @param {Object} object The object to query. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new accessor function. | ||
* @example | ||
@@ -15,0 +15,0 @@ * |
@@ -19,3 +19,3 @@ var createRange = require('./_createRange'); | ||
* @param {number} [step=1] The value to increment or decrement by. | ||
* @returns {Array} Returns the new array of numbers. | ||
* @returns {Array} Returns the range of numbers. | ||
* @see _.inRange, _.rangeRight | ||
@@ -22,0 +22,0 @@ * @example |
@@ -14,3 +14,3 @@ var createRange = require('./_createRange'); | ||
* @param {number} [step=1] The value to increment or decrement by. | ||
* @returns {Array} Returns the new array of numbers. | ||
* @returns {Array} Returns the range of numbers. | ||
* @see _.inRange, _.range | ||
@@ -17,0 +17,0 @@ * @example |
@@ -31,3 +31,3 @@ var baseToString = require('./_baseToString'), | ||
* @param {number} [limit] The length to truncate results to. | ||
* @returns {Array} Returns the new array of string segments. | ||
* @returns {Array} Returns the string segments. | ||
* @example | ||
@@ -34,0 +34,0 @@ * |
@@ -94,8 +94,2 @@ var assignInDefaults = require('./_assignInDefaults'), | ||
* | ||
* // Use custom template delimiters. | ||
* _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; | ||
* var compiled = _.template('hello {{ user }}!'); | ||
* compiled({ 'user': 'mustache' }); | ||
* // => 'hello mustache!' | ||
* | ||
* // Use backslashes to treat delimiters as plain text. | ||
@@ -126,5 +120,11 @@ * var compiled = _.template('<%= "\\<%- value %\\>" %>'); | ||
* | ||
* // Use custom template delimiters. | ||
* _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; | ||
* var compiled = _.template('hello {{ user }}!'); | ||
* compiled({ 'user': 'mustache' }); | ||
* // => 'hello mustache!' | ||
* | ||
* // Use the `source` property to inline compiled templates for meaningful | ||
* // line numbers in error messages and stack traces. | ||
* fs.writeFileSync(path.join(cwd, 'jst.js'), '\ | ||
* fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ | ||
* var JST = {\ | ||
@@ -131,0 +131,0 @@ * "main": ' + _.template(mainText).source + '\ |
@@ -1,7 +0,3 @@ | ||
var toNumber = require('./toNumber'); | ||
var toFinite = require('./toFinite'); | ||
/** Used as references for various `Number` constants. */ | ||
var INFINITY = 1 / 0, | ||
MAX_INTEGER = 1.7976931348623157e+308; | ||
/** | ||
@@ -21,3 +17,3 @@ * Converts `value` to an integer. | ||
* | ||
* _.toInteger(3); | ||
* _.toInteger(3.2); | ||
* // => 3 | ||
@@ -31,18 +27,12 @@ * | ||
* | ||
* _.toInteger('3'); | ||
* _.toInteger('3.2'); | ||
* // => 3 | ||
*/ | ||
function toInteger(value) { | ||
if (!value) { | ||
return value === 0 ? value : 0; | ||
} | ||
value = toNumber(value); | ||
if (value === INFINITY || value === -INFINITY) { | ||
var sign = (value < 0 ? -1 : 1); | ||
return sign * MAX_INTEGER; | ||
} | ||
var remainder = value % 1; | ||
return value === value ? (remainder ? value - remainder : value) : 0; | ||
var result = toFinite(value), | ||
remainder = result % 1; | ||
return result === result ? (remainder ? result - remainder : result) : 0; | ||
} | ||
module.exports = toInteger; |
@@ -22,3 +22,3 @@ var baseClamp = require('./_baseClamp'), | ||
* | ||
* _.toLength(3); | ||
* _.toLength(3.2); | ||
* // => 3 | ||
@@ -32,3 +32,3 @@ * | ||
* | ||
* _.toLength('3'); | ||
* _.toLength('3.2'); | ||
* // => 3 | ||
@@ -35,0 +35,0 @@ */ |
@@ -34,4 +34,4 @@ var isFunction = require('./isFunction'), | ||
* | ||
* _.toNumber(3); | ||
* // => 3 | ||
* _.toNumber(3.2); | ||
* // => 3.2 | ||
* | ||
@@ -44,4 +44,4 @@ * _.toNumber(Number.MIN_VALUE); | ||
* | ||
* _.toNumber('3'); | ||
* // => 3 | ||
* _.toNumber('3.2'); | ||
* // => 3.2 | ||
*/ | ||
@@ -48,0 +48,0 @@ function toNumber(value) { |
@@ -1,2 +0,2 @@ | ||
var baseToPairs = require('./_baseToPairs'), | ||
var createToPairs = require('./_createToPairs'), | ||
keys = require('./keys'); | ||
@@ -6,3 +6,4 @@ | ||
* Creates an array of own enumerable string keyed-value pairs for `object` | ||
* which can be consumed by `_.fromPairs`. | ||
* which can be consumed by `_.fromPairs`. If `object` is a map or set, its | ||
* entries are returned. | ||
* | ||
@@ -15,3 +16,3 @@ * @static | ||
* @param {Object} object The object to query. | ||
* @returns {Array} Returns the new array of key-value pairs. | ||
* @returns {Array} Returns the key-value pairs. | ||
* @example | ||
@@ -29,6 +30,4 @@ * | ||
*/ | ||
function toPairs(object) { | ||
return baseToPairs(object, keys(object)); | ||
} | ||
var toPairs = createToPairs(keys); | ||
module.exports = toPairs; |
@@ -1,2 +0,2 @@ | ||
var baseToPairs = require('./_baseToPairs'), | ||
var createToPairs = require('./_createToPairs'), | ||
keysIn = require('./keysIn'); | ||
@@ -6,3 +6,4 @@ | ||
* Creates an array of own and inherited enumerable string keyed-value pairs | ||
* for `object` which can be consumed by `_.fromPairs`. | ||
* for `object` which can be consumed by `_.fromPairs`. If `object` is a map | ||
* or set, its entries are returned. | ||
* | ||
@@ -15,3 +16,3 @@ * @static | ||
* @param {Object} object The object to query. | ||
* @returns {Array} Returns the new array of key-value pairs. | ||
* @returns {Array} Returns the key-value pairs. | ||
* @example | ||
@@ -27,8 +28,6 @@ * | ||
* _.toPairsIn(new Foo); | ||
* // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed) | ||
* // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) | ||
*/ | ||
function toPairsIn(object) { | ||
return baseToPairs(object, keysIn(object)); | ||
} | ||
var toPairsIn = createToPairs(keysIn); | ||
module.exports = toPairsIn; |
@@ -19,3 +19,3 @@ var baseClamp = require('./_baseClamp'), | ||
* | ||
* _.toSafeInteger(3); | ||
* _.toSafeInteger(3.2); | ||
* // => 3 | ||
@@ -29,3 +29,3 @@ * | ||
* | ||
* _.toSafeInteger('3'); | ||
* _.toSafeInteger('3.2'); | ||
* // => 3 | ||
@@ -32,0 +32,0 @@ */ |
@@ -12,3 +12,3 @@ var ary = require('./ary'); | ||
* @param {Function} func The function to cap arguments for. | ||
* @returns {Function} Returns the new function. | ||
* @returns {Function} Returns the new capped function. | ||
* @example | ||
@@ -15,0 +15,0 @@ * |
@@ -14,3 +14,3 @@ var baseDifference = require('./_baseDifference'), | ||
* @category Array | ||
* @param {Array} array The array to filter. | ||
* @param {Array} array The array to inspect. | ||
* @param {...*} [values] The values to exclude. | ||
@@ -17,0 +17,0 @@ * @returns {Array} Returns the new array of filtered values. |
@@ -86,6 +86,6 @@ var LazyWrapper = require('./_LazyWrapper'), | ||
* `includes`, `indexOf`, `inRange`, `invoke`, `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`, | ||
* `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`, | ||
@@ -99,5 +99,5 @@ * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, | ||
* `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, | ||
* `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`, | ||
* `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`, | ||
* `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, | ||
* `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toFinite`, | ||
* `toInteger`, `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, | ||
* `toString`, `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, | ||
* `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words` | ||
@@ -104,0 +104,0 @@ * |
@@ -17,3 +17,3 @@ var arrayFilter = require('./_arrayFilter'), | ||
* @param {...Array} [arrays] The arrays to inspect. | ||
* @returns {Array} Returns the new array of values. | ||
* @returns {Array} Returns the new array of filtered values. | ||
* @see _.difference, _.without | ||
@@ -20,0 +20,0 @@ * @example |
@@ -21,3 +21,3 @@ var arrayFilter = require('./_arrayFilter'), | ||
* The iteratee invoked per element. | ||
* @returns {Array} Returns the new array of values. | ||
* @returns {Array} Returns the new array of filtered values. | ||
* @example | ||
@@ -24,0 +24,0 @@ * |
@@ -18,3 +18,3 @@ var arrayFilter = require('./_arrayFilter'), | ||
* @param {Function} [comparator] The comparator invoked per element. | ||
* @returns {Array} Returns the new array of values. | ||
* @returns {Array} Returns the new array of filtered values. | ||
* @example | ||
@@ -21,0 +21,0 @@ * |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
0
41
2
1326093
956
38690