Comparing version 3.7.0 to 3.8.0
@@ -38,6 +38,8 @@ module.exports = { | ||
'unzip': require('./array/unzip'), | ||
'unzipWith': require('./array/unzipWith'), | ||
'without': require('./array/without'), | ||
'xor': require('./array/xor'), | ||
'zip': require('./array/zip'), | ||
'zipObject': require('./array/zipObject') | ||
'zipObject': require('./array/zipObject'), | ||
'zipWith': require('./array/zipWith') | ||
}; |
var baseDifference = require('../internal/baseDifference'), | ||
baseFlatten = require('../internal/baseFlatten'), | ||
isArguments = require('../lang/isArguments'), | ||
isArray = require('../lang/isArray'), | ||
isArrayLike = require('../internal/isArrayLike'), | ||
restParam = require('../function/restParam'); | ||
@@ -9,8 +8,5 @@ | ||
* Creates an array excluding all values of the provided arrays using | ||
* `SameValueZero` for equality comparisons. | ||
* [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* for equality comparisons. | ||
* | ||
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* comparisons are like strict equality comparisons, e.g. `===`, except that | ||
* `NaN` matches `NaN`. | ||
* | ||
* @static | ||
@@ -28,3 +24,3 @@ * @memberOf _ | ||
var difference = restParam(function(array, values) { | ||
return (isArray(array) || isArguments(array)) | ||
return isArrayLike(array) | ||
? baseDifference(array, baseFlatten(values, false, true)) | ||
@@ -31,0 +27,0 @@ : []; |
@@ -9,10 +9,7 @@ var baseIndexOf = require('../internal/baseIndexOf'), | ||
* Gets the index at which the first occurrence of `value` is found in `array` | ||
* using `SameValueZero` for equality comparisons. If `fromIndex` is negative, | ||
* it is used as the offset from the end of `array`. If `array` is sorted | ||
* providing `true` for `fromIndex` performs a faster binary search. | ||
* using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* for equality comparisons. If `fromIndex` is negative, it is used as the offset | ||
* from the end of `array`. If `array` is sorted providing `true` for `fromIndex` | ||
* performs a faster binary search. | ||
* | ||
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* comparisons are like strict equality comparisons, e.g. `===`, except that | ||
* `NaN` matches `NaN`. | ||
* | ||
* @static | ||
@@ -19,0 +16,0 @@ * @memberOf _ |
var baseIndexOf = require('../internal/baseIndexOf'), | ||
cacheIndexOf = require('../internal/cacheIndexOf'), | ||
createCache = require('../internal/createCache'), | ||
isArguments = require('../lang/isArguments'), | ||
isArray = require('../lang/isArray'); | ||
isArrayLike = require('../internal/isArrayLike'); | ||
/** | ||
* Creates an array of unique values in all provided arrays using `SameValueZero` | ||
* Creates an array of unique values in all provided arrays using | ||
* [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* for equality comparisons. | ||
* | ||
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* comparisons are like strict equality comparisons, e.g. `===`, except that | ||
* `NaN` matches `NaN`. | ||
* | ||
* @static | ||
@@ -35,3 +31,3 @@ * @memberOf _ | ||
var value = arguments[argsIndex]; | ||
if (isArray(value) || isArguments(value)) { | ||
if (isArrayLike(value)) { | ||
args.push(value); | ||
@@ -38,0 +34,0 @@ caches.push((isCommon && value.length >= 120) ? createCache(argsIndex && value) : null); |
@@ -10,10 +10,7 @@ var baseIndexOf = require('../internal/baseIndexOf'); | ||
/** | ||
* Removes all provided values from `array` using `SameValueZero` for equality | ||
* comparisons. | ||
* Removes all provided values from `array` using | ||
* [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* for equality comparisons. | ||
* | ||
* **Notes:** | ||
* - Unlike `_.without`, this method mutates `array` | ||
* - [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* comparisons are like strict equality comparisons, e.g. `===`, except | ||
* that `NaN` matches `NaN` | ||
* **Note:** Unlike `_.without`, this method mutates `array`. | ||
* | ||
@@ -20,0 +17,0 @@ * @static |
@@ -33,3 +33,2 @@ var baseAt = require('../internal/baseAt'), | ||
var pullAt = restParam(function(array, indexes) { | ||
array || (array = []); | ||
indexes = baseFlatten(indexes); | ||
@@ -36,0 +35,0 @@ |
@@ -7,8 +7,5 @@ var baseFlatten = require('../internal/baseFlatten'), | ||
* Creates an array of unique values, in order, of the provided arrays using | ||
* `SameValueZero` for equality comparisons. | ||
* [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* for equality comparisons. | ||
* | ||
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* comparisons are like strict equality comparisons, e.g. `===`, except that | ||
* `NaN` matches `NaN`. | ||
* | ||
* @static | ||
@@ -15,0 +12,0 @@ * @memberOf _ |
@@ -7,4 +7,5 @@ var baseCallback = require('../internal/baseCallback'), | ||
/** | ||
* Creates a duplicate-free version of an array, using `SameValueZero` for | ||
* equality comparisons, in which only the first occurence of each element | ||
* Creates a duplicate-free version of an array, using | ||
* [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* for equality comparisons, in which only the first occurence of each element | ||
* is kept. Providing `true` for `isSorted` performs a faster search algorithm | ||
@@ -27,6 +28,2 @@ * for sorted arrays. If an iteratee function is provided it is invoked for | ||
* | ||
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* comparisons are like strict equality comparisons, e.g. `===`, except that | ||
* `NaN` matches `NaN`. | ||
* | ||
* @static | ||
@@ -33,0 +30,0 @@ * @memberOf _ |
@@ -1,9 +0,12 @@ | ||
var arrayMap = require('../internal/arrayMap'), | ||
arrayMax = require('../internal/arrayMax'), | ||
var arrayFilter = require('../internal/arrayFilter'), | ||
arrayMap = require('../internal/arrayMap'), | ||
baseProperty = require('../internal/baseProperty'), | ||
getLength = require('../internal/getLength'); | ||
isArrayLike = require('../internal/isArrayLike'); | ||
/* Native method references for those with the same name as other `lodash` methods. */ | ||
var nativeMax = Math.max; | ||
/** | ||
* This method is like `_.zip` except that it accepts an array of grouped | ||
* elements and creates an array regrouping the elements to their pre-`_.zip` | ||
* elements and creates an array regrouping the elements to their pre-zip | ||
* configuration. | ||
@@ -25,6 +28,15 @@ * | ||
function unzip(array) { | ||
if (!(array && array.length)) { | ||
return []; | ||
} | ||
var index = -1, | ||
length = (array && array.length && arrayMax(arrayMap(array, getLength))) >>> 0, | ||
result = Array(length); | ||
length = 0; | ||
array = arrayFilter(array, function(group) { | ||
if (isArrayLike(group)) { | ||
length = nativeMax(group.length, length); | ||
return true; | ||
} | ||
}); | ||
var result = Array(length); | ||
while (++index < length) { | ||
@@ -31,0 +43,0 @@ result[index] = arrayMap(array, baseProperty(index)); |
var baseDifference = require('../internal/baseDifference'), | ||
isArguments = require('../lang/isArguments'), | ||
isArray = require('../lang/isArray'), | ||
isArrayLike = require('../internal/isArrayLike'), | ||
restParam = require('../function/restParam'); | ||
/** | ||
* Creates an array excluding all provided values using `SameValueZero` for | ||
* equality comparisons. | ||
* Creates an array excluding all provided values using | ||
* [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* for equality comparisons. | ||
* | ||
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* comparisons are like strict equality comparisons, e.g. `===`, except that | ||
* `NaN` matches `NaN`. | ||
* | ||
* @static | ||
@@ -26,3 +22,3 @@ * @memberOf _ | ||
var without = restParam(function(array, values) { | ||
return (isArray(array) || isArguments(array)) | ||
return isArrayLike(array) | ||
? baseDifference(array, values) | ||
@@ -29,0 +25,0 @@ : []; |
var baseDifference = require('../internal/baseDifference'), | ||
baseUniq = require('../internal/baseUniq'), | ||
isArguments = require('../lang/isArguments'), | ||
isArray = require('../lang/isArray'); | ||
isArrayLike = require('../internal/isArrayLike'); | ||
@@ -26,3 +25,3 @@ /** | ||
var array = arguments[index]; | ||
if (isArray(array) || isArguments(array)) { | ||
if (isArrayLike(array)) { | ||
var result = result | ||
@@ -29,0 +28,0 @@ ? baseDifference(result, array).concat(baseDifference(array, result)) |
var baseAt = require('../internal/baseAt'), | ||
baseFlatten = require('../internal/baseFlatten'), | ||
getLength = require('../internal/getLength'), | ||
isLength = require('../internal/isLength'), | ||
restParam = require('../function/restParam'), | ||
toIterable = require('../internal/toIterable'); | ||
restParam = require('../function/restParam'); | ||
@@ -29,6 +26,2 @@ /** | ||
var at = restParam(function(collection, props) { | ||
var length = collection ? getLength(collection) : 0; | ||
if (isLength(length)) { | ||
collection = toIterable(collection); | ||
} | ||
return baseAt(collection, baseFlatten(props)); | ||
@@ -35,0 +28,0 @@ }); |
@@ -13,10 +13,7 @@ var baseIndexOf = require('../internal/baseIndexOf'), | ||
/** | ||
* Checks if `value` is in `collection` using `SameValueZero` for equality | ||
* comparisons. If `fromIndex` is negative, it is used as the offset from | ||
* the end of `collection`. | ||
* Checks if `value` is in `collection` using | ||
* [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* for equality comparisons. If `fromIndex` is negative, it is used as the offset | ||
* from the end of `collection`. | ||
* | ||
* **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) | ||
* comparisons are like strict equality comparisons, e.g. `===`, except that | ||
* `NaN` matches `NaN`. | ||
* | ||
* @static | ||
@@ -23,0 +20,0 @@ * @memberOf _ |
var baseEach = require('../internal/baseEach'), | ||
getLength = require('../internal/getLength'), | ||
invokePath = require('../internal/invokePath'), | ||
isArrayLike = require('../internal/isArrayLike'), | ||
isKey = require('../internal/isKey'), | ||
isLength = require('../internal/isLength'), | ||
restParam = require('../function/restParam'); | ||
@@ -34,4 +33,3 @@ | ||
isProp = isKey(path), | ||
length = getLength(collection), | ||
result = isLength(length) ? Array(length) : []; | ||
result = isArrayLike(collection) ? Array(collection.length) : []; | ||
@@ -38,0 +36,0 @@ baseEach(collection, function(value) { |
@@ -26,6 +26,7 @@ var arrayMap = require('../internal/arrayMap'), | ||
* The guarded methods are: | ||
* `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`, `drop`, | ||
* `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`, `parseInt`, | ||
* `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimLeft`, | ||
* `trimRight`, `trunc`, `random`, `range`, `sample`, `some`, `uniq`, and `words` | ||
* `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`, | ||
* `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`, | ||
* `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`, | ||
* `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`, | ||
* `sum`, `uniq`, and `words` | ||
* | ||
@@ -32,0 +33,0 @@ * @static |
@@ -27,4 +27,4 @@ var arrayReduceRight = require('../internal/arrayReduceRight'), | ||
*/ | ||
var reduceRight = createReduce(arrayReduceRight, baseEachRight); | ||
var reduceRight = createReduce(arrayReduceRight, baseEachRight); | ||
module.exports = reduceRight; |
@@ -10,13 +10,2 @@ var arrayFilter = require('../internal/arrayFilter'), | ||
* | ||
* If a property name is provided for `predicate` the created `_.property` | ||
* style callback returns the property value of the given element. | ||
* | ||
* If a value is also provided for `thisArg` the created `_.matchesProperty` | ||
* style callback returns `true` for elements that have a matching property | ||
* value, else `false`. | ||
* | ||
* If an object is provided for `predicate` the created `_.matches` style | ||
* callback returns `true` for elements that have the properties of the given | ||
* object, else `false`. | ||
* | ||
* @static | ||
@@ -23,0 +12,0 @@ * @memberOf _ |
@@ -7,3 +7,3 @@ var baseCopy = require('./baseCopy'), | ||
/** Native method references. */ | ||
var preventExtensions = isNative(Object.preventExtensions = Object.preventExtensions) && preventExtensions; | ||
var preventExtensions = isNative(preventExtensions = Object.preventExtensions) && preventExtensions; | ||
@@ -18,8 +18,15 @@ /** Used as `baseAssign`. */ | ||
// `Object('x')` because Chrome and IE fail to throw an error when attempting | ||
// to assign values to readonly indexes of strings in strict mode. | ||
var object = { '1': 0 }, | ||
func = preventExtensions && isNative(func = Object.assign) && func; | ||
try { func(preventExtensions(object), 'xo'); } catch(e) {} | ||
return !object[1] && func; | ||
// to assign values to readonly indexes of strings. | ||
var func = preventExtensions && isNative(func = Object.assign) && func; | ||
try { | ||
if (func) { | ||
var object = preventExtensions({ '1': 0 }); | ||
object[0] = 1; | ||
} | ||
} catch(e) { | ||
// Only attempt in strict mode. | ||
try { func(object, 'xo'); } catch(e) {} | ||
return !object[1] && func; | ||
} | ||
return false; | ||
}()); | ||
@@ -26,0 +33,0 @@ |
@@ -1,3 +0,3 @@ | ||
var isIndex = require('./isIndex'), | ||
isLength = require('./isLength'); | ||
var isArrayLike = require('./isArrayLike'), | ||
isIndex = require('./isIndex'); | ||
@@ -15,4 +15,5 @@ /** | ||
var index = -1, | ||
length = collection.length, | ||
isArr = isLength(length), | ||
isNil = collection == null, | ||
isArr = !isNil && isArrayLike(collection), | ||
length = isArr && collection.length, | ||
propsLength = props.length, | ||
@@ -26,3 +27,3 @@ result = Array(propsLength); | ||
} else { | ||
result[index] = collection[key]; | ||
result[index] = isNil ? undefined : collection[key]; | ||
} | ||
@@ -29,0 +30,0 @@ } |
var isArguments = require('../lang/isArguments'), | ||
isArray = require('../lang/isArray'), | ||
isLength = require('./isLength'), | ||
isArrayLike = require('./isArrayLike'), | ||
isObjectLike = require('./isObjectLike'); | ||
@@ -12,4 +12,4 @@ | ||
* @param {Array} array The array to flatten. | ||
* @param {boolean} isDeep Specify a deep flatten. | ||
* @param {boolean} isStrict Restrict flattening to arrays and `arguments` objects. | ||
* @param {boolean} [isDeep] Specify a deep flatten. | ||
* @param {boolean} [isStrict] Restrict flattening to arrays-like objects. | ||
* @returns {Array} Returns the new flattened array. | ||
@@ -25,4 +25,4 @@ */ | ||
var value = array[index]; | ||
if (isObjectLike(value) && isLength(value.length) && (isArray(value) || isArguments(value))) { | ||
if (isObjectLike(value) && isArrayLike(value) && | ||
(isStrict || isArray(value) || isArguments(value))) { | ||
if (isDeep) { | ||
@@ -35,3 +35,2 @@ // Recursively flatten arrays (susceptible to call stack limits). | ||
result.length += valLength; | ||
while (++valIndex < valLength) { | ||
@@ -38,0 +37,0 @@ result[++resIndex] = value[valIndex]; |
@@ -24,7 +24,7 @@ var toObject = require('./toObject'); | ||
while (object != null && ++index < length) { | ||
var result = object = object[path[index]]; | ||
object = object[path[index]]; | ||
} | ||
return result; | ||
return (index && index == length) ? object : undefined; | ||
} | ||
module.exports = baseGet; |
@@ -19,4 +19,3 @@ var baseIsEqualDeep = require('./baseIsEqualDeep'); | ||
if (value === other) { | ||
// Treat `+0` vs. `-0` as not equal. | ||
return value !== 0 || (1 / value == 1 / other); | ||
return true; | ||
} | ||
@@ -23,0 +22,0 @@ var valType = typeof value, |
var baseEach = require('./baseEach'), | ||
getLength = require('./getLength'), | ||
isLength = require('./isLength'); | ||
isArrayLike = require('./isArrayLike'); | ||
@@ -16,4 +15,3 @@ /** | ||
var index = -1, | ||
length = getLength(collection), | ||
result = isLength(length) ? Array(length) : []; | ||
result = isArrayLike(collection) ? Array(collection.length) : []; | ||
@@ -20,0 +18,0 @@ baseEach(collection, function(value, key, collection) { |
@@ -5,3 +5,3 @@ var arrayEach = require('./arrayEach'), | ||
isArray = require('../lang/isArray'), | ||
isLength = require('./isLength'), | ||
isArrayLike = require('./isArrayLike'), | ||
isObject = require('../lang/isObject'), | ||
@@ -34,3 +34,3 @@ isObjectLike = require('./isObjectLike'), | ||
} | ||
var isSrcArr = isLength(source.length) && (isArray(source) || isTypedArray(source)); | ||
var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)); | ||
if (!isSrcArr) { | ||
@@ -37,0 +37,0 @@ var props = keys(source); |
var arrayCopy = require('./arrayCopy'), | ||
getLength = require('./getLength'), | ||
isArguments = require('../lang/isArguments'), | ||
isArray = require('../lang/isArray'), | ||
isLength = require('./isLength'), | ||
isArrayLike = require('./isArrayLike'), | ||
isPlainObject = require('../lang/isPlainObject'), | ||
@@ -41,6 +40,6 @@ isTypedArray = require('../lang/isTypedArray'), | ||
result = srcValue; | ||
if (isLength(srcValue.length) && (isArray(srcValue) || isTypedArray(srcValue))) { | ||
if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) { | ||
result = isArray(value) | ||
? value | ||
: (getLength(value) ? arrayCopy(value) : []); | ||
: (isArrayLike(value) ? arrayCopy(value) : []); | ||
} | ||
@@ -47,0 +46,0 @@ else if (isPlainObject(srcValue) || isArguments(srcValue)) { |
@@ -19,3 +19,3 @@ var isIndex = require('./isIndex'); | ||
function basePullAt(array, indexes) { | ||
var length = indexes.length; | ||
var length = array ? indexes.length : 0; | ||
while (length--) { | ||
@@ -22,0 +22,0 @@ var index = parseFloat(indexes[length]); |
@@ -9,3 +9,3 @@ /** Native method references. */ | ||
var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1, | ||
MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1; | ||
MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1; | ||
@@ -12,0 +12,0 @@ /** |
@@ -26,8 +26,8 @@ /* Native method references for those with the same name as other `lodash` methods. */ | ||
} | ||
var pad = argsIndex; | ||
var offset = argsIndex; | ||
while (++rightIndex < rightLength) { | ||
result[pad + rightIndex] = partials[rightIndex]; | ||
result[offset + rightIndex] = partials[rightIndex]; | ||
} | ||
while (++holdersIndex < holdersLength) { | ||
result[pad + holders[holdersIndex]] = args[argsIndex++]; | ||
result[offset + holders[holdersIndex]] = args[argsIndex++]; | ||
} | ||
@@ -34,0 +34,0 @@ return result; |
@@ -22,5 +22,5 @@ var baseCallback = require('./baseCallback'), | ||
return baseFind(collection, predicate, eachFunc); | ||
} | ||
}; | ||
} | ||
module.exports = createFind; |
@@ -7,2 +7,8 @@ var LodashWrapper = require('./LodashWrapper'), | ||
/** Used to compose bitmasks for wrapper metadata. */ | ||
var CURRY_FLAG = 8, | ||
PARTIAL_FLAG = 32, | ||
ARY_FLAG = 128, | ||
REARG_FLAG = 256; | ||
/** Used as the `TypeError` message for "Functions" methods. */ | ||
@@ -43,3 +49,3 @@ var FUNC_ERROR_TEXT = 'Expected a function'; | ||
var data = funcName == 'wrapper' ? getData(func) : null; | ||
if (data && isLaziable(data[0])) { | ||
if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) { | ||
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); | ||
@@ -46,0 +52,0 @@ } else { |
@@ -14,3 +14,3 @@ var baseToString = require('./baseToString'), | ||
string = baseToString(string); | ||
return string && ((fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string)); | ||
return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string); | ||
}; | ||
@@ -17,0 +17,0 @@ } |
@@ -37,4 +37,3 @@ /** `Object#toString` result references. */ | ||
? other != +other | ||
// But, treat `-0` vs. `+0` as not equal. | ||
: (object == 0 ? ((1 / object) == (1 / other)) : object == +other); | ||
: object == +other; | ||
@@ -41,0 +40,0 @@ case regexpTag: |
@@ -7,3 +7,3 @@ var baseProperty = require('./baseProperty'); | ||
* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) | ||
* in Safari on iOS 8.1 ARM64. | ||
* that affects Safari on at least iOS 8.1-8.3 ARM64. | ||
* | ||
@@ -10,0 +10,0 @@ * @private |
@@ -1,4 +0,3 @@ | ||
var getLength = require('./getLength'), | ||
var isArrayLike = require('./isArrayLike'), | ||
isIndex = require('./isIndex'), | ||
isLength = require('./isLength'), | ||
isObject = require('../lang/isObject'); | ||
@@ -20,9 +19,5 @@ | ||
var type = typeof index; | ||
if (type == 'number') { | ||
var length = getLength(object), | ||
prereq = isLength(length) && isIndex(index, length); | ||
} else { | ||
prereq = type == 'string' && index in object; | ||
} | ||
if (prereq) { | ||
if (type == 'number' | ||
? (isArrayLike(object) && isIndex(index, object.length)) | ||
: (type == 'string' && index in object)) { | ||
var other = object[index]; | ||
@@ -29,0 +24,0 @@ return value === value ? (value === other) : (other !== other); |
@@ -5,3 +5,3 @@ var isArray = require('../lang/isArray'), | ||
/** Used to match property names within property paths. */ | ||
var reIsDeepProp = /\.|\[(?:[^[\]]+|(["'])(?:(?!\1)[^\n\\]|\\.)*?)\1\]/, | ||
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, | ||
reIsPlainProp = /^\w*$/; | ||
@@ -8,0 +8,0 @@ |
@@ -12,5 +12,5 @@ var isObject = require('../lang/isObject'); | ||
function isStrictComparable(value) { | ||
return value === value && (value === 0 ? ((1 / value) > 0) : !isObject(value)); | ||
return value === value && !isObject(value); | ||
} | ||
module.exports = isStrictComparable; |
var toObject = require('./toObject'); | ||
/** | ||
* A specialized version of `_.pick` that picks `object` properties specified | ||
* A specialized version of `_.pick` which picks `object` properties specified | ||
* by `props`. | ||
@@ -6,0 +6,0 @@ * |
var baseForIn = require('./baseForIn'); | ||
/** | ||
* A specialized version of `_.pick` that picks `object` properties `predicate` | ||
* A specialized version of `_.pick` which picks `object` properties `predicate` | ||
* returns truthy for. | ||
@@ -6,0 +6,0 @@ * |
@@ -1,3 +0,2 @@ | ||
var getLength = require('./getLength'), | ||
isLength = require('./isLength'), | ||
var isArrayLike = require('./isArrayLike'), | ||
isObject = require('../lang/isObject'), | ||
@@ -17,3 +16,3 @@ values = require('../object/values'); | ||
} | ||
if (!isLength(getLength(value))) { | ||
if (!isArrayLike(value)) { | ||
return values(value); | ||
@@ -20,0 +19,0 @@ } |
@@ -1,2 +0,2 @@ | ||
var isLength = require('../internal/isLength'), | ||
var isArrayLike = require('../internal/isArrayLike'), | ||
isObjectLike = require('../internal/isObjectLike'); | ||
@@ -33,6 +33,5 @@ | ||
function isArguments(value) { | ||
var length = isObjectLike(value) ? value.length : undefined; | ||
return isLength(length) && objToString.call(value) == argsTag; | ||
return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag; | ||
} | ||
module.exports = isArguments; |
@@ -1,6 +0,5 @@ | ||
var getLength = require('../internal/getLength'), | ||
isArguments = require('./isArguments'), | ||
var isArguments = require('./isArguments'), | ||
isArray = require('./isArray'), | ||
isArrayLike = require('../internal/isArrayLike'), | ||
isFunction = require('./isFunction'), | ||
isLength = require('../internal/isLength'), | ||
isObjectLike = require('../internal/isObjectLike'), | ||
@@ -41,6 +40,5 @@ isString = require('./isString'), | ||
} | ||
var length = getLength(value); | ||
if (isLength(length) && (isArray(value) || isString(value) || isArguments(value) || | ||
if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) || | ||
(isObjectLike(value) && isFunction(value.splice)))) { | ||
return !length; | ||
return !value.length; | ||
} | ||
@@ -47,0 +45,0 @@ return !keys(value).length; |
@@ -32,5 +32,5 @@ var isObjectLike = require('../internal/isObjectLike'); | ||
function isRegExp(value) { | ||
return (isObjectLike(value) && objToString.call(value) == regexpTag) || false; | ||
return isObjectLike(value) && objToString.call(value) == regexpTag; | ||
} | ||
module.exports = isRegExp; |
@@ -18,2 +18,3 @@ module.exports = { | ||
'keysIn': require('./object/keysIn'), | ||
'mapKeys': require('./object/mapKeys'), | ||
'mapValues': require('./object/mapValues'), | ||
@@ -20,0 +21,0 @@ 'merge': require('./object/merge'), |
@@ -15,3 +15,2 @@ var assignWith = require('../internal/assignWith'), | ||
* | ||
* | ||
* @static | ||
@@ -18,0 +17,0 @@ * @memberOf _ |
@@ -1,2 +0,2 @@ | ||
var isLength = require('../internal/isLength'), | ||
var isArrayLike = require('../internal/isArrayLike'), | ||
isNative = require('../lang/isNative'), | ||
@@ -37,8 +37,5 @@ isObject = require('../lang/isObject'), | ||
var keys = !nativeKeys ? shimKeys : function(object) { | ||
if (object) { | ||
var Ctor = object.constructor, | ||
length = object.length; | ||
} | ||
var Ctor = object != null && object.constructor; | ||
if ((typeof Ctor == 'function' && Ctor.prototype === object) || | ||
(typeof object != 'function' && isLength(length))) { | ||
(typeof object != 'function' && isArrayLike(object))) { | ||
return shimKeys(object); | ||
@@ -45,0 +42,0 @@ } |
@@ -1,3 +0,2 @@ | ||
var baseCallback = require('../internal/baseCallback'), | ||
baseForOwn = require('../internal/baseForOwn'); | ||
var createObjectMapper = require('../internal/createObjectMapper'); | ||
@@ -45,12 +44,4 @@ /** | ||
*/ | ||
function mapValues(object, iteratee, thisArg) { | ||
var result = {}; | ||
iteratee = baseCallback(iteratee, thisArg, 3); | ||
var mapValues = createObjectMapper(); | ||
baseForOwn(object, function(value, key, object) { | ||
result[key] = iteratee(value, key, object); | ||
}); | ||
return result; | ||
} | ||
module.exports = mapValues; |
@@ -13,7 +13,2 @@ var arrayMap = require('../internal/arrayMap'), | ||
* own and inherited enumerable properties of `object` that are not omitted. | ||
* Property names may be specified as individual arguments or as arrays of | ||
* property names. If `predicate` is provided it is invoked for each property | ||
* of `object` omitting the properties `predicate` returns truthy for. The | ||
* predicate is bound to `thisArg` and invoked with three arguments: | ||
* (value, key, object). | ||
* | ||
@@ -20,0 +15,0 @@ * @static |
{ | ||
"name": "lodash", | ||
"version": "3.7.0", | ||
"version": "3.8.0", | ||
"description": "The modern build of lodash modular utilities.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://lodash.com/", |
@@ -1,2 +0,2 @@ | ||
# lodash v3.7.0 | ||
# lodash v3.8.0 | ||
@@ -31,3 +31,3 @@ The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) modules. | ||
See the [package source](https://github.com/lodash/lodash/tree/3.7.0-npm) for more details. | ||
See the [package source](https://github.com/lodash/lodash/tree/3.8.0-npm) for more details. | ||
@@ -43,4 +43,4 @@ **Note:**<br> | ||
* npm packages for [modern](https://www.npmjs.com/package/lodash), [compatibility](https://www.npmjs.com/package/lodash-compat), & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) builds | ||
* AMD modules for [modern](https://github.com/lodash/lodash/tree/3.7.0-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.7.0-amd) builds | ||
* ES modules for the [modern](https://github.com/lodash/lodash/tree/3.7.0-es) build | ||
* AMD modules for [modern](https://github.com/lodash/lodash/tree/3.8.0-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.8.0-amd) builds | ||
* ES modules for the [modern](https://github.com/lodash/lodash/tree/3.8.0-es) build | ||
@@ -71,3 +71,2 @@ ## Further Reading | ||
* [_.cloneDeep](https://lodash.com/docs#cloneDeep) for deep cloning arrays & objects | ||
* [_.create](https://lodash.com/docs#create) for easier object inheritance | ||
* [_.curry](https://lodash.com/docs#curry) & [_.curryRight](https://lodash.com/docs#curryRight) for creating [curried](http://hughfdjackson.com/javascript/why-curry-helps/) functions | ||
@@ -86,2 +85,3 @@ * [_.debounce](https://lodash.com/docs#debounce) & [_.throttle](https://lodash.com/docs#throttle) are cancelable & accept options for more control | ||
* [_.isTypedArray](https://lodash.com/docs#isTypedArray) to check for typed arrays | ||
* [_.mapKeys](https://lodash.com/docs#mapKeys) for mapping keys to an object | ||
* [_.matches](https://lodash.com/docs#matches) supports deep object comparisons | ||
@@ -102,2 +102,3 @@ * [_.matchesProperty](https://lodash.com/docs#matchesProperty) to complement [_.matches](https://lodash.com/docs#matches) & [_.property](https://lodash.com/docs#property) | ||
* [_.transform](https://lodash.com/docs#transform) as a powerful alternative to [_.reduce](https://lodash.com/docs#reduce) for transforming objects | ||
* [_.unzipWith](https://lodash.com/docs#unzipWith) & [_.zipWith](https://lodash.com/docs#zipWith) to specify how grouped values should be combined | ||
* [_.xor](https://lodash.com/docs#xor) to complement [_.difference](https://lodash.com/docs#difference), [_.intersection](https://lodash.com/docs#intersection), & [_.union](https://lodash.com/docs#union) | ||
@@ -110,9 +111,9 @@ * [_.valuesIn](https://lodash.com/docs#valuesIn) for getting values of all enumerable properties | ||
* [_.clone](https://lodash.com/docs#clone), [_.isEqual](https://lodash.com/docs#isEqual), & | ||
[more](https://lodash.com/docs "_.assign, _.cloneDeep, _.merge") accept callbacks | ||
[more](https://lodash.com/docs "_.assign, _.cloneDeep, _.merge") accept customizer callbacks | ||
* [_.dropWhile](https://lodash.com/docs#dropWhile), [_.takeWhile](https://lodash.com/docs#takeWhile), & | ||
[more](https://lodash.com/docs "_.drop, _.dropRightWhile, _.take, _.takeRightWhile") to complement [_.first](https://lodash.com/docs#first), [_.initial](https://lodash.com/docs#initial), [_.last](https://lodash.com/docs#last), & [_.rest](https://lodash.com/docs#rest) | ||
[more](https://lodash.com/docs "_.drop, _.dropRight, _.dropRightWhile, _.take, _.takeRight, _.takeRightWhile") to complement [_.first](https://lodash.com/docs#first), [_.initial](https://lodash.com/docs#initial), [_.last](https://lodash.com/docs#last), & [_.rest](https://lodash.com/docs#rest) | ||
* [_.findLast](https://lodash.com/docs#findLast), [_.findLastKey](https://lodash.com/docs#findLastKey), & | ||
[more](https://lodash.com/docs "_.flowRight, _.forEachRight, _.forInRight, _.forOwnRight, _.partialRight") right-associative methods | ||
[more](https://lodash.com/docs "_.curryRight, _.dropRight, _.dropRightWhile, _.flowRight, _.forEachRight, _.forInRight, _.forOwnRight, _.padRight, partialRight, _.takeRight, _.trimRight, _.takeRightWhile") right-associative methods | ||
* [_.includes](https://lodash.com/docs#includes), [_.toArray](https://lodash.com/docs#toArray), & | ||
[more](https://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.findLast, _.forEach, _.forEachRight, _.groupBy, _.indexBy, _.invoke, _.map, _.max, _.min, _.partition, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy") accept strings | ||
[more](https://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.findLast, _.findWhere, _.forEach, _.forEachRight, _.groupBy, _.indexBy, _.invoke, _.map, _.max, _.min, _.partition, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.sortByAll, _.sortByOrder, _.sum, _.where") accept strings | ||
* [_#commit](https://lodash.com/docs#prototype-commit) & [_#plant](https://lodash.com/docs#prototype-plant) for working with chain sequences | ||
@@ -123,3 +124,3 @@ * [_#thru](https://lodash.com/docs#thru) to pass values thru a chain sequence | ||
Tested in Chrome 41-42, Firefox 36-37, IE 6-11, Opera 27-28, Safari 5-8, io.js 1.7.1, Node.js 0.8.28, 0.10.38, & 0.12.2, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7RC5. | ||
Tested in Chrome 41-42, Firefox 36-37, IE 6-11, MS Edge, Opera 27-28, Safari 5-8, io.js 1.8.1, Node.js 0.8.28, 0.10.38, & 0.12.2, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7RC5. | ||
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing. |
@@ -21,2 +21,3 @@ /** Used for native method references. */ | ||
var Ctor = function() { this.x = x; }, | ||
args = arguments, | ||
object = { '0': x, 'length': x }, | ||
@@ -71,3 +72,3 @@ props = []; | ||
try { | ||
support.nonEnumArgs = !propertyIsEnumerable.call(arguments, 1); | ||
support.nonEnumArgs = !propertyIsEnumerable.call(args, 1); | ||
} catch(e) { | ||
@@ -74,0 +75,0 @@ support.nonEnumArgs = true; |
var baseCallback = require('../internal/baseCallback'), | ||
isIterateeCall = require('../internal/isIterateeCall'); | ||
isIterateeCall = require('../internal/isIterateeCall'), | ||
isObjectLike = require('../internal/isObjectLike'), | ||
matches = require('./matches'); | ||
@@ -46,5 +48,7 @@ /** | ||
} | ||
return baseCallback(func, thisArg); | ||
return isObjectLike(func) | ||
? matches(func) | ||
: baseCallback(func, thisArg); | ||
} | ||
module.exports = callback; |
@@ -28,5 +28,5 @@ var invokePath = require('../internal/invokePath'), | ||
return invokePath(object, path, args); | ||
} | ||
}; | ||
}); | ||
module.exports = method; |
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
833880
405
24122
120