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.5.0 to 4.5.1

_countHolders.js

3

_assignValue.js

@@ -21,4 +21,3 @@ import eq from './eq';

var objValue = object[key];
if ((!eq(objValue, value) ||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) ||
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {

@@ -25,0 +24,0 @@ object[key] = value;

@@ -12,11 +12,14 @@ /* Built-in method references for those with the same name as other `lodash` methods. */

* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgs(args, partials, holders) {
var holdersLength = holders.length,
argsIndex = -1,
argsLength = nativeMax(args.length - holdersLength, 0),
function composeArgs(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersLength = holders.length,
leftIndex = -1,
leftLength = partials.length,
result = Array(leftLength + argsLength);
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(leftLength + rangeLength),
isUncurried = !isCurried;

@@ -27,5 +30,7 @@ while (++leftIndex < leftLength) {

while (++argsIndex < holdersLength) {
result[holders[argsIndex]] = args[argsIndex];
if (isUncurried || argsIndex < argsLength) {
result[holders[argsIndex]] = args[argsIndex];
}
}
while (argsLength--) {
while (rangeLength--) {
result[leftIndex++] = args[argsIndex++];

@@ -32,0 +37,0 @@ }

@@ -12,14 +12,17 @@ /* Built-in method references for those with the same name as other `lodash` methods. */

* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgsRight(args, partials, holders) {
var holdersIndex = -1,
function composeArgsRight(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersIndex = -1,
holdersLength = holders.length,
argsIndex = -1,
argsLength = nativeMax(args.length - holdersLength, 0),
rightIndex = -1,
rightLength = partials.length,
result = Array(argsLength + rightLength);
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(rangeLength + rightLength),
isUncurried = !isCurried;
while (++argsIndex < argsLength) {
while (++argsIndex < rangeLength) {
result[argsIndex] = args[argsIndex];

@@ -32,3 +35,5 @@ }

while (++holdersIndex < holdersLength) {
result[offset + holders[holdersIndex]] = args[argsIndex++];
if (isUncurried || argsIndex < argsLength) {
result[offset + holders[holdersIndex]] = args[argsIndex++];
}
}

@@ -35,0 +40,0 @@ return result;

@@ -5,2 +5,3 @@ import apply from './_apply';

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

@@ -23,6 +24,5 @@ import root from './_root';

var length = arguments.length,
args = Array(length),
index = length,
args = Array(length),
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func,
placeholder = wrapper.placeholder;
placeholder = getPlaceholder(wrapper);

@@ -37,5 +37,9 @@ while (index--) {

length -= holders.length;
return length < arity
? createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, undefined, args, holders, undefined, undefined, arity - length)
: apply(fn, this, args);
if (length < arity) {
return createRecurryWrapper(
func, bitmask, createHybridWrapper, wrapper.placeholder, undefined,
args, holders, undefined, undefined, arity - length);
}
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return apply(fn, this, args);
}

@@ -42,0 +46,0 @@ return wrapper;

import composeArgs from './_composeArgs';
import composeArgsRight from './_composeArgsRight';
import countHolders from './_countHolders';
import createCtorWrapper from './_createCtorWrapper';
import createRecurryWrapper from './_createRecurryWrapper';
import getPlaceholder from './_getPlaceholder';
import reorder from './_reorder';

@@ -38,4 +40,3 @@ import replaceHolders from './_replaceHolders';

isBindKey = bitmask & BIND_KEY_FLAG,
isCurry = bitmask & CURRY_FLAG,
isCurryRight = bitmask & CURRY_RIGHT_FLAG,
isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG),
isFlip = bitmask & FLIP_FLAG,

@@ -52,19 +53,19 @@ Ctor = isBindKey ? undefined : createCtorWrapper(func);

}
if (isCurried) {
var placeholder = getPlaceholder(wrapper),
holdersCount = countHolders(args, placeholder);
}
if (partials) {
args = composeArgs(args, partials, holders);
args = composeArgs(args, partials, holders, isCurried);
}
if (partialsRight) {
args = composeArgsRight(args, partialsRight, holdersRight);
args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
}
if (isCurry || isCurryRight) {
var placeholder = wrapper.placeholder,
argsHolders = replaceHolders(args, placeholder);
length -= argsHolders.length;
if (length < arity) {
return createRecurryWrapper(
func, bitmask, createHybridWrapper, placeholder, thisArg, args,
argsHolders, argPos, ary, arity - length
);
}
length -= holdersCount;
if (isCurried && length < arity) {
var newHolders = replaceHolders(args, placeholder);
return createRecurryWrapper(
func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg,
args, newHolders, argPos, ary, arity - length
);
}

@@ -74,8 +75,9 @@ var thisBinding = isBind ? thisArg : this,

length = args.length;
if (argPos) {
args = reorder(args, argPos);
} else if (isFlip && args.length > 1) {
} else if (isFlip && length > 1) {
args.reverse();
}
if (isAry && ary < args.length) {
if (isAry && ary < length) {
args.length = ary;

@@ -82,0 +84,0 @@ }

@@ -20,3 +20,3 @@ import copyArray from './_copyArray';

* @param {Function} wrapFunc The function to create the `func` wrapper.
* @param {*} placeholder The placeholder to replace.
* @param {*} placeholder The placeholder value.
* @param {*} [thisArg] The `this` binding of `func`.

@@ -33,3 +33,3 @@ * @param {Array} [partials] The arguments to prepend to those provided to the new function.

newArgPos = argPos ? copyArray(argPos) : undefined,
newsHolders = isCurry ? holders : undefined,
newHolders = isCurry ? holders : undefined,
newHoldersRight = isCurry ? undefined : holders,

@@ -46,3 +46,3 @@ newPartials = isCurry ? partials : undefined,

var newData = [
func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight,
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
newHoldersRight, newArgPos, ary, arity

@@ -49,0 +49,0 @@ ];

@@ -5,2 +5,5 @@ import baseCreate from './_baseCreate';

/** Built-in value references. */
var getPrototypeOf = Object.getPrototypeOf;
/**

@@ -14,9 +17,7 @@ * Initializes an object clone.

function initCloneObject(object) {
if (isPrototype(object)) {
return {};
}
var Ctor = object.constructor;
return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
return (isFunction(object.constructor) && !isPrototype(object))
? baseCreate(getPrototypeOf(object))
: {};
}
export default initCloneObject;

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

import isFunction from './isFunction';
/** Used for built-in method references. */

@@ -13,3 +15,3 @@ var objectProto = Object.prototype;

var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
proto = (isFunction(Ctor) && Ctor.prototype) || objectProto;

@@ -16,0 +18,0 @@ return value === proto;

@@ -42,5 +42,5 @@ import composeArgs from './_composeArgs';

var isCombo =
(srcBitmask == ARY_FLAG && (bitmask == CURRY_FLAG)) ||
(srcBitmask == ARY_FLAG && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) ||
(srcBitmask == (ARY_FLAG | REARG_FLAG) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG));
((srcBitmask == ARY_FLAG) && (bitmask == CURRY_FLAG)) ||
((srcBitmask == ARY_FLAG) && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) ||
((srcBitmask == (ARY_FLAG | REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG));

@@ -55,3 +55,3 @@ // Exit early if metadata can't be merged.

// Set when currying a bound function.
newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG;
}

@@ -58,0 +58,0 @@ // Compose partial arguments.

@@ -20,3 +20,4 @@ /** Used as the internal argument placeholder. */

while (++index < length) {
if (array[index] === placeholder) {
var value = array[index];
if (value === placeholder || value === PLACEHOLDER) {
array[index] = PLACEHOLDER;

@@ -23,0 +24,0 @@ result[++resIndex] = index;

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

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

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

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

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

@@ -57,5 +58,3 @@ import rest from './rest';

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

@@ -62,0 +61,0 @@ }

@@ -36,7 +36,6 @@ import isObjectLike from './isObjectLike';

}
var Ctor = value.constructor;
return (objectToString.call(value) == errorTag) ||
(typeof Ctor == 'function' && objectToString.call(Ctor.prototype) == errorTag);
(typeof value.message == 'string' && typeof value.name == 'string');
}
export default isError;

@@ -57,6 +57,3 @@ import isHostObject from './_isHostObject';

}
var proto = objectProto;
if (typeof value.constructor == 'function') {
proto = getPrototypeOf(value);
}
var proto = getPrototypeOf(value);
if (proto === null) {

@@ -63,0 +60,0 @@ return true;

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

@@ -47,3 +47,3 @@ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>

/** Used as the semantic version number. */
var VERSION = '4.5.0';
var VERSION = '4.5.1';

@@ -50,0 +50,0 @@ /** Used to compose bitmasks for wrapper metadata. */

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

@@ -5,0 +5,0 @@ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>

@@ -7,3 +7,4 @@ import baseForOwn from './_baseForOwn';

* same values as `object` and keys generated by running each own enumerable
* property of `object` through `iteratee`.
* property of `object` through `iteratee`. The iteratee is invoked with
* three arguments: (value, key, object).
*

@@ -10,0 +11,0 @@ * @static

@@ -7,3 +7,3 @@ import baseForOwn from './_baseForOwn';

* running each own enumerable property of `object` through `iteratee`. The
* iteratee function is invoked with three arguments: (value, key, object).
* iteratee is invoked with three arguments: (value, key, object).
*

@@ -10,0 +10,0 @@ * @static

@@ -5,5 +5,6 @@ import baseIteratee from './_baseIteratee';

/**
* The opposite of `_.pickBy`; this method creates an object composed of the
* own and inherited enumerable properties of `object` that `predicate`
* doesn't return truthy for.
* The opposite of `_.pickBy`; this method creates an object composed of
* the own and inherited enumerable properties of `object` that `predicate`
* doesn't return truthy for. The predicate is invoked with two arguments:
* (value, key).
*

@@ -24,3 +25,3 @@ * @static

function omitBy(object, predicate) {
predicate = baseIteratee(predicate, 2);
predicate = baseIteratee(predicate);
return basePickBy(object, function(value, key) {

@@ -27,0 +28,0 @@ return !predicate(value, key);

{
"name": "lodash-es",
"version": "4.5.0",
"version": "4.5.1",
"description": "Lodash exported as ES modules.",

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

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

@@ -41,5 +42,3 @@ import rest from './rest';

var partial = rest(function(func, partials) {
var placeholder = partial.placeholder,
holders = replaceHolders(partials, placeholder);
var holders = replaceHolders(partials, getPlaceholder(partial));
return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders);

@@ -46,0 +45,0 @@ });

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

@@ -40,5 +41,3 @@ import rest from './rest';

var partialRight = rest(function(func, partials) {
var placeholder = partialRight.placeholder,
holders = replaceHolders(partials, placeholder);
var holders = replaceHolders(partials, getPlaceholder(partialRight));
return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);

@@ -45,0 +44,0 @@ });

@@ -22,5 +22,5 @@ import baseIteratee from './_baseIteratee';

function pickBy(object, predicate) {
return object == null ? {} : basePickBy(object, baseIteratee(predicate, 2));
return object == null ? {} : basePickBy(object, baseIteratee(predicate));
}
export default pickBy;

@@ -9,3 +9,4 @@ import pullAll from './pullAll';

*
* **Note:** Unlike `_.without`, this method mutates `array`.
* **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
* to remove elements from an array by predicate.
*

@@ -12,0 +13,0 @@ * @static

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

# lodash-es v4.5.0
# lodash-es v4.5.1

@@ -10,2 +10,2 @@ The [lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules.

See the [package source](https://github.com/lodash/lodash/tree/4.5.0-es) for more details.
See the [package source](https://github.com/lodash/lodash/tree/4.5.1-es) for more details.

@@ -6,6 +6,7 @@ import baseIteratee from './_baseIteratee';

* Removes all elements from `array` that `predicate` returns truthy for
* and returns an array of the removed elements. The predicate is invoked with
* three arguments: (value, index, array).
* and returns an array of the removed elements. The predicate is invoked
* with three arguments: (value, index, array).
*
* **Note:** Unlike `_.filter`, this method mutates `array`.
* **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
* to pull elements from an array by value.
*

@@ -12,0 +13,0 @@ * @static

@@ -15,4 +15,4 @@ import baseCastFunction from './_baseCastFunction';

/**
* Invokes the iteratee function `n` times, returning an array of the results
* of each invocation. The iteratee is invoked with one argument; (index).
* Invokes the iteratee `n` times, returning an array of the results of
* each invocation. The iteratee is invoked with one argument; (index).
*

@@ -19,0 +19,0 @@ * @static

@@ -10,2 +10,5 @@ import arrayEach from './_arrayEach';

/** Built-in value references. */
var getPrototypeOf = Object.getPrototypeOf;
/**

@@ -49,3 +52,3 @@ * An alternative to `_.reduce`; this method transforms `object` to a new

} else {
accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
accumulator = isFunction(Ctor) ? baseCreate(getPrototypeOf(object)) : {};
}

@@ -52,0 +55,0 @@ } else {

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