Socket
Socket
Sign inDemoInstall

lodash-es

Package Overview
Dependencies
Maintainers
3
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash-es - npm Package Compare versions

Comparing version 4.11.2 to 4.12.0

_createToPairs.js

2

_baseAt.js

@@ -9,3 +9,3 @@ import get from './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 @@ import keys from './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 @@ import arrayFilter from './_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 @@ import arrayPush from './_arrayPush';

var result = keysFunc(object);
return isArray(object)
? result
: arrayPush(result, symbolsFunc(object));
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
export default baseGetAllKeys;

@@ -10,3 +10,3 @@ import baseIsMatch from './_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 @@ import baseIsEqual from './_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 @@ import baseGet from './_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 @@ import arrayMap from './_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 @@

import isKeyable from './_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);
}
export default 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 @@ import isIterateeCall from './_isIterateeCall';

customizer = typeof customizer == 'function'
customizer = (assigner.length > 3 && typeof customizer == 'function')
? (length--, customizer)

@@ -21,0 +21,0 @@ : undefined;

@@ -11,3 +11,3 @@ import castSlice from './_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 @@ import apply from './_apply';

import createRecurryWrapper from './_createRecurryWrapper';
import getPlaceholder from './_getPlaceholder';
import getHolder from './_getHolder';
import replaceHolders from './_replaceHolders';

@@ -27,3 +27,3 @@ import root from './_root';

index = length,
placeholder = getPlaceholder(wrapper);
placeholder = getHolder(wrapper);

@@ -30,0 +30,0 @@ while (index--) {

@@ -6,3 +6,3 @@ import composeArgs from './_composeArgs';

import createRecurryWrapper from './_createRecurryWrapper';
import getPlaceholder from './_getPlaceholder';
import getHolder from './_getHolder';
import reorder from './_reorder';

@@ -50,4 +50,4 @@ import replaceHolders from './_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 @@ import apply from './_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 @@ import baseSetData from './_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.

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

import SetCache from './_SetCache';
import arraySome from './_arraySome';

@@ -22,5 +23,3 @@

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;

@@ -1,6 +0,7 @@

import nativeCreate from './_nativeCreate';
import hashClear from './_hashClear';
import hashDelete from './_hashDelete';
import hashGet from './_hashGet';
import hashHas from './_hashHas';
import hashSet from './_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;
export default Hash;

@@ -1,3 +0,1 @@

import hashHas from './_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];
}
export default hashDelete;

@@ -16,14 +16,16 @@ import nativeCreate from './_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;
}
export default hashGet;

@@ -13,10 +13,12 @@ import nativeCreate from './_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);
}
export default hashHas;

@@ -10,10 +10,14 @@ import nativeCreate from './_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;
}
export default hashSet;
import isArguments from './isArguments';
import isArray from './isArray';
import isArrayLikeObject from './isArrayLikeObject';

@@ -13,5 +12,5 @@ /**

function isFlattenable(value) {
return isArrayLikeObject(value) && (isArray(value) || isArguments(value));
return isArray(value) || isArguments(value);
}
export default isFlattenable;

@@ -1,6 +0,6 @@

import mapClear from './_mapClear';
import mapDelete from './_mapDelete';
import mapGet from './_mapGet';
import mapHas from './_mapHas';
import mapSet from './_mapSet';
import mapCacheClear from './_mapCacheClear';
import mapCacheDelete from './_mapCacheDelete';
import mapCacheGet from './_mapCacheGet';
import mapCacheHas from './_mapCacheHas';
import mapCacheSet from './_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;
export default 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) {

import MapCache from './_MapCache';
import cachePush from './_cachePush';
import setCacheAdd from './_setCacheAdd';
import setCacheHas from './_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;
export default 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) {

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

import ListCache from './_ListCache';
import stackClear from './_stackClear';

@@ -12,13 +13,6 @@ import stackDelete from './_stackDelete';

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

import ListCache from './_ListCache';
/**

@@ -9,5 +11,5 @@ * Removes all key-value entries from the stack.

function stackClear() {
this.__data__ = { 'array': [], 'map': null };
this.__data__ = new ListCache;
}
export default stackClear;

@@ -1,3 +0,1 @@

import assocDelete from './_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);
}
export default stackDelete;

@@ -1,3 +0,1 @@

import assocGet from './_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);
}
export default stackGet;

@@ -1,3 +0,1 @@

import assocHas from './_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);
}
export default stackHas;

@@ -0,3 +1,3 @@

import ListCache from './_ListCache';
import MapCache from './_MapCache';
import assocSet from './_assocSet';

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

@@ -14,2 +14,3 @@ import chunk from './chunk';

import findLastIndex from './findLastIndex';
import first from './first';
import flatten from './flatten';

@@ -70,13 +71,13 @@ import flattenDeep from './flattenDeep';

differenceWith, drop, dropRight, dropRightWhile, dropWhile,
fill, findIndex, findLastIndex, flatten, flattenDeep,
flattenDepth, fromPairs, head, indexOf, initial,
intersection, intersectionBy, intersectionWith, join, last,
lastIndexOf, nth, pull, pullAll, pullAllBy,
pullAllWith, pullAt, remove, reverse, slice,
sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy,
sortedLastIndexOf, sortedUniq, sortedUniqBy, tail, take,
takeRight, takeRightWhile, takeWhile, union, unionBy,
unionWith, uniq, uniqBy, uniqWith, unzip,
unzipWith, without, xor, xorBy, xorWith,
zip, zipObject, zipObjectDeep, zipWith
fill, findIndex, findLastIndex, first, flatten,
flattenDeep, flattenDepth, fromPairs, head, indexOf,
initial, intersection, intersectionBy, intersectionWith, join,
last, lastIndexOf, nth, pull, pullAll,
pullAllBy, pullAllWith, pullAt, remove, reverse,
slice, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex,
sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, tail,
take, takeRight, takeRightWhile, takeWhile, union,
unionBy, unionWith, uniq, uniqBy, uniqWith,
unzip, unzipWith, without, xor, xorBy,
xorWith, zip, zipObject, zipObjectDeep, zipWith
};

@@ -14,2 +14,3 @@ export { default as chunk } from './chunk';

export { default as findLastIndex } from './findLastIndex';
export { default as first } from './first';
export { default as flatten } from './flatten';

@@ -16,0 +17,0 @@ export { default as flattenDeep } from './flattenDeep';

@@ -17,3 +17,3 @@ import createWrapper from './_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 @@ import baseAt from './_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 @@ *

import createWrapper from './_createWrapper';
import getPlaceholder from './_getPlaceholder';
import getHolder from './_getHolder';
import replaceHolders from './_replaceHolders';

@@ -48,3 +48,3 @@ import rest from './rest';

if (partials.length) {
var holders = replaceHolders(partials, getPlaceholder(bind));
var holders = replaceHolders(partials, getHolder(bind));
bitmask |= PARTIAL_FLAG;

@@ -51,0 +51,0 @@ }

import createWrapper from './_createWrapper';
import getPlaceholder from './_getPlaceholder';
import getHolder from './_getHolder';
import replaceHolders from './_replaceHolders';

@@ -59,3 +59,3 @@ import rest from './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 @@ import baseSlice from './_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 @@

import arrayConcat from './_arrayConcat';
import arrayPush from './_arrayPush';
import baseFlatten from './_baseFlatten';
import castArray from './castArray';
import copyArray from './_copyArray';
import isArray from './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))
: [];
}
export default concat;

@@ -20,3 +20,3 @@ import apply from './_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 @@ import baseClone from './_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 @@ *

@@ -14,3 +14,3 @@ import createWrapper from './_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 @@ import createFlow from './_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 @@ import createFlow from './_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 @@ import arrayEach from './_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));
}
export default forEach;

@@ -27,7 +27,6 @@ import arrayEachRight from './_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));
}
export default forEachRight;

@@ -36,5 +36,5 @@ import baseFor from './_baseFor';

? object
: baseFor(object, baseIteratee(iteratee), keysIn);
: baseFor(object, baseIteratee(iteratee, 3), keysIn);
}
export default forIn;

@@ -34,5 +34,5 @@ import baseForRight from './_baseForRight';

? object
: baseForRight(object, baseIteratee(iteratee), keysIn);
: baseForRight(object, baseIteratee(iteratee, 3), keysIn);
}
export default forInRight;

@@ -33,5 +33,5 @@ import baseForOwn from './_baseForOwn';

function forOwn(object, iteratee) {
return object && baseForOwn(object, baseIteratee(iteratee));
return object && baseForOwn(object, baseIteratee(iteratee, 3));
}
export default forOwn;

@@ -31,5 +31,5 @@ import baseForOwnRight from './_baseForOwnRight';

function forOwnRight(object, iteratee) {
return object && baseForOwnRight(object, baseIteratee(iteratee));
return object && baseForOwnRight(object, baseIteratee(iteratee, 3));
}
export default forOwnRight;

@@ -13,3 +13,3 @@ import baseFunctions from './_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 @@ import baseFunctions from './_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 @@ import root from './_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) {

@@ -49,2 +49,3 @@ import castArray from './castArray';

import toArray from './toArray';
import toFinite from './toFinite';
import toInteger from './toInteger';

@@ -67,4 +68,4 @@ import toLength from './toLength';

isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet,
lt, lte, toArray, toInteger, toLength,
toNumber, toPlainObject, toSafeInteger, toString
lt, lte, toArray, toFinite, toInteger,
toLength, toNumber, toPlainObject, toSafeInteger, toString
};

@@ -49,2 +49,3 @@ export { default as castArray } from './castArray';

export { default as toArray } from './toArray';
export { default as toFinite } from './toFinite';
export { default as toInteger } from './toInteger';

@@ -51,0 +52,0 @@ export { default as toLength } from './toLength';

/**
* @license
* lodash 4.11.2 (Custom Build) <https://lodash.com/>
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="es" -o ./`

@@ -47,3 +47,3 @@ * Copyright jQuery Foundation and other contributors <https://jquery.org/>

/** Used as the semantic version number. */
var VERSION = '4.11.2';
var VERSION = '4.12.0';

@@ -377,2 +377,3 @@ /** Used to compose bitmasks for wrapper metadata. */

lodash.times = util.times;
lodash.toFinite = lang.toFinite;
lodash.toInteger = toInteger;

@@ -379,0 +380,0 @@ lodash.toLength = lang.toLength;

/**
* @license
* lodash 4.11.2 (Custom Build) <https://lodash.com/>
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="es" -o ./`

@@ -77,2 +77,3 @@ * Copyright jQuery Foundation and other contributors <https://jquery.org/>

export { default as findLastKey } from './findLastKey';
export { default as first } from './first';
export { default as flatMap } from './flatMap';

@@ -266,2 +267,3 @@ export { default as flatMapDeep } from './flatMapDeep';

export { default as toArray } from './toArray';
export { default as toFinite } from './toFinite';
export { default as toInteger } from './toInteger';

@@ -268,0 +270,0 @@ export { default as toIterator } from './toIterator';

@@ -17,3 +17,3 @@ import baseClone from './_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 @@ import baseClone from './_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 @@ import MapCache from './_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 @@ import baseMerge from './_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 @@ import baseInvoke from './_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 @@ import baseInvoke from './_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 @@ import baseNth from './_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 @@ import baseNth from './_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-es",
"version": "4.11.2",
"version": "4.12.0",
"description": "Lodash exported as ES modules.",

@@ -5,0 +5,0 @@ "keywords": "es6, modules, stdlib, util",

import createWrapper from './_createWrapper';
import getPlaceholder from './_getPlaceholder';
import getHolder from './_getHolder';
import replaceHolders from './_replaceHolders';

@@ -43,3 +43,3 @@ import rest from './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 @@ });

import createWrapper from './_createWrapper';
import getPlaceholder from './_getPlaceholder';
import getHolder from './_getHolder';
import replaceHolders from './_replaceHolders';

@@ -42,3 +42,3 @@ import rest from './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 @@ import baseProperty from './_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 @@ import baseGet from './_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 @@ import createRange from './_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 @@ import createRange from './_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 @@ import baseToString from './_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 @@ import assignInDefaults from './_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 @@

import toNumber from './toNumber';
import toFinite from './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;
}
export default toInteger;

@@ -22,3 +22,3 @@ import baseClamp from './_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 @@ import isFunction from './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 @@

import baseToPairs from './_baseToPairs';
import createToPairs from './_createToPairs';
import keys from './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);
export default toPairs;

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

import baseToPairs from './_baseToPairs';
import createToPairs from './_createToPairs';
import keysIn from './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);
export default toPairsIn;

@@ -19,3 +19,3 @@ import baseClamp from './_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 @@ import ary from './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 @@ import baseDifference from './_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 @@ import LazyWrapper from './_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 @@ import arrayFilter from './_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 @@ import arrayFilter from './_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 @@ import arrayFilter from './_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 @@ *

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc