Socket
Socket
Sign inDemoInstall

lodash-compat

Package Overview
Dependencies
0
Maintainers
5
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.7.0 to 3.8.0

array/unzipWith.js

4

array.js

@@ -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'),
isArrayLike = require('../internal/isArrayLike'),
restParam = require('../function/restParam'),

@@ -29,4 +28,3 @@ toIterable = require('../internal/toIterable');

var at = restParam(function(collection, props) {
var length = collection ? getLength(collection) : 0;
if (isLength(length)) {
if (isArrayLike(collection)) {
collection = toIterable(collection);

@@ -33,0 +31,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];

@@ -25,7 +25,7 @@ var toObject = require('./toObject');

while (object != null && ++index < length) {
var result = object = toObject(object)[path[index]];
object = toObject(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'),

@@ -19,3 +18,3 @@ isString = require('../lang/isString'),

}
if (!isLength(getLength(value))) {
if (!isArrayLike(value)) {
return values(value);

@@ -22,0 +21,0 @@ }

@@ -1,2 +0,2 @@

var isLength = require('../internal/isLength'),
var isArrayLike = require('../internal/isArrayLike'),
isObjectLike = require('../internal/isObjectLike'),

@@ -40,4 +40,3 @@ support = require('../support');

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;
}

@@ -47,5 +46,4 @@ // Fallback for environments without a `toStringTag` for `arguments` objects.

isArguments = function(value) {
var length = isObjectLike(value) ? value.length : undefined;
return isLength(length) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee');
return isObjectLike(value) && isArrayLike(value) &&
hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
};

@@ -52,0 +50,0 @@ }

@@ -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;

@@ -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'),

@@ -38,8 +38,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' ? support.enumPrototypes : isLength(length))) {
(typeof object == 'function' ? support.enumPrototypes : isArrayLike(object))) {
return shimKeys(object);

@@ -46,0 +43,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-compat",
"version": "3.7.0",
"version": "3.8.0",
"description": "The compatibility build of lodash modular utilities.",

@@ -5,0 +5,0 @@ "homepage": "https://lodash.com/",

@@ -1,2 +0,2 @@

# lodash-compat v3.7.0
# lodash-compat v3.8.0

@@ -31,3 +31,3 @@ The [compatibility 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-compat/tree/3.7.0-npm) for more details.
See the [package source](https://github.com/lodash/lodash-compat/tree/3.8.0-npm) for more details.

@@ -34,0 +34,0 @@ **Note:**<br>

@@ -34,2 +34,3 @@ /** `Object#toString` result references. */

var Ctor = function() { this.x = x; },
args = arguments,
object = { '0': x, 'length': x },

@@ -48,3 +49,3 @@ props = [];

*/
support.argsTag = objToString.call(arguments) == argsTag;
support.argsTag = objToString.call(args) == argsTag;

@@ -178,3 +179,3 @@ /**

try {
support.nonEnumArgs = !propertyIsEnumerable.call(arguments, 1);
support.nonEnumArgs = !propertyIsEnumerable.call(args, 1);
} catch(e) {

@@ -181,0 +182,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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc