Socket
Socket
Sign inDemoInstall

lodash-es

Package Overview
Dependencies
Maintainers
5
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 3.4.0 to 3.5.0

5

array/indexOf.js

@@ -50,3 +50,6 @@ import baseIndexOf from '../internal/baseIndexOf';

return (value === value ? value === other : other !== other) ? index : -1;
if (value === value ? (value === other) : (other !== other)) {
return index;
}
return -1;
}

@@ -53,0 +56,0 @@ return baseIndexOf(array, value, fromIndex || 0);

@@ -44,3 +44,6 @@ import binaryIndex from '../internal/binaryIndex';

var other = array[index];
return (value === value ? value === other : other !== other) ? index : -1;
if (value === value ? (value === other) : (other !== other)) {
return index;
}
return -1;
}

@@ -47,0 +50,0 @@ if (value !== value) {

11

chain/lodash.js

@@ -30,6 +30,11 @@ import LazyWrapper from '../internal/LazyWrapper';

*
* In addition to lodash methods, wrappers also have the following `Array` methods:
* `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`,
* and `unshift`
* In addition to lodash methods, wrappers have `Array` and `String` methods.
*
* The wrapper `Array` methods are:
* `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,
* `splice`, and `unshift`
*
* The wrapper `String` methods are:
* `replace` and `split`
*
* The wrapper methods that support shortcut fusion are:

@@ -36,0 +41,0 @@ * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,

@@ -17,2 +17,3 @@ import baseSortByOrder from '../internal/baseSortByOrder';

* @param {boolean[]} orders The sort orders of `props`.
* @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
* @returns {Array} Returns the new sorted array.

@@ -22,5 +23,5 @@ * @example

* var users = [
* { 'user': 'barney', 'age': 26 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'barney', 'age': 26 },
* { 'user': 'fred', 'age': 30 }

@@ -27,0 +28,0 @@ * ];

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

if ((result === result ? result !== value : value === value) ||
if ((result === result ? (result !== value) : (value === value)) ||
(typeof value == 'undefined' && !(key in object))) {

@@ -30,0 +30,0 @@ object[key] = result;

@@ -22,3 +22,3 @@ /**

}
length = start > end ? 0 : end >>> 0;
length = start > end ? 0 : (end >>> 0);
start >>>= 0;

@@ -25,0 +25,0 @@

@@ -41,3 +41,3 @@ import arrayEach from './arrayEach';

if ((isSrcArr || typeof result != 'undefined') &&
(isCommon || (result === result ? result !== value : value === value))) {
(isCommon || (result === result ? (result !== value) : (value === value)))) {
object[key] = result;

@@ -44,0 +44,0 @@ }

@@ -62,3 +62,3 @@ import arrayCopy from './arrayCopy';

object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
} else if (result === result ? result !== value : value === value) {
} else if (result === result ? (result !== value) : (value === value)) {
object[key] = result;

@@ -65,0 +65,0 @@ }

@@ -22,3 +22,3 @@ /**

}
length = start > end ? 0 : (end - start) >>> 0;
length = start > end ? 0 : ((end - start) >>> 0);
start >>>= 0;

@@ -25,0 +25,0 @@

@@ -29,5 +29,4 @@ import baseCompareAscending from './baseCompareAscending';

return result;
} else {
return orders[index] ? result : result * -1;
}
return result * (orders[index] ? 1 : -1);
}

@@ -34,0 +33,0 @@ }

import createCtorWrapper from './createCtorWrapper';
import root from './root';

@@ -16,3 +17,4 @@ /**

function wrapper() {
return (this instanceof wrapper ? Ctor : func).apply(thisArg, arguments);
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return fn.apply(thisArg, arguments);
}

@@ -19,0 +21,0 @@ return wrapper;

@@ -15,3 +15,3 @@ /** Used as the `TypeError` message for "Functions" methods. */

index = length,
fromIndex = fromRight ? length - 1 : 0;
fromIndex = fromRight ? (length - 1) : 0;

@@ -18,0 +18,0 @@ if (!length) {

@@ -7,2 +7,3 @@ import arrayCopy from './arrayCopy';

import replaceHolders from './replaceHolders';
import root from './root';

@@ -100,3 +101,4 @@ /** Used to compose bitmasks for wrapper metadata. */

}
return (this instanceof wrapper ? (Ctor || createCtorWrapper(func)) : func).apply(thisBinding, args);
var fn = (this && this !== root && this instanceof wrapper) ? (Ctor || createCtorWrapper(func)) : func;
return fn.apply(thisBinding, args);
}

@@ -103,0 +105,0 @@ return wrapper;

import createCtorWrapper from './createCtorWrapper';
import root from './root';

@@ -37,3 +38,4 @@ /** Used to compose bitmasks for wrapper metadata. */

}
return (this instanceof wrapper ? Ctor : func).apply(isBind ? thisArg : this, args);
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return fn.apply(isBind ? thisArg : this, args);
}

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

@@ -64,4 +64,6 @@ import keys from '../object/keys';

// Non `Object` object instances with different constructors are not equal.
if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
return false;

@@ -68,0 +70,0 @@ }

@@ -26,3 +26,4 @@ import baseEach from './baseEach';

var current = iteratee(value, index, collection);
if ((isMin ? current < computed : current > computed) || (current === exValue && current === result)) {
if ((isMin ? (current < computed) : (current > computed)) ||
(current === exValue && current === result)) {
computed = current;

@@ -29,0 +30,0 @@ result = value;

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

var other = object[index];
return value === value ? value === other : other !== other;
return value === value ? (value === other) : (other !== other);
}

@@ -30,0 +30,0 @@ return false;

@@ -20,3 +20,2 @@ import LazyWrapper from './LazyWrapper';

result.__dir__ = this.__dir__;
result.__dropCount__ = this.__dropCount__;
result.__filtered__ = this.__filtered__;

@@ -23,0 +22,0 @@ result.__iteratees__ = iteratees ? arrayCopy(iteratees) : null;

@@ -7,4 +7,4 @@ import baseWrapperValue from './baseWrapperValue';

var LAZY_DROP_WHILE_FLAG = 0,
LAZY_MAP_FLAG = 2,
LAZY_TAKE_WHILE_FLAG = 3;
LAZY_FILTER_FLAG = 1,
LAZY_MAP_FLAG = 2;

@@ -33,5 +33,4 @@ /* Native method references for those with the same name as other `lodash` methods. */

length = end - start,
dropCount = this.__dropCount__,
index = isRight ? end : (start - 1),
takeCount = nativeMin(length, this.__takeCount__),
index = isRight ? end : start - 1,
iteratees = this.__iteratees__,

@@ -54,24 +53,28 @@ iterLength = iteratees ? iteratees.length : 0,

if (type != LAZY_DROP_WHILE_FLAG) {
var computed = iteratee(value);
} else {
data.done = data.done && (isRight ? index < data.index : index > data.index);
if (type == LAZY_DROP_WHILE_FLAG) {
if (data.done && (isRight ? (index > data.index) : (index < data.index))) {
data.count = 0;
data.done = false;
}
data.index = index;
computed = data.done || (data.done = !iteratee(value));
}
if (type == LAZY_MAP_FLAG) {
value = computed;
} else if (!computed) {
if (type == LAZY_TAKE_WHILE_FLAG) {
break outer;
} else {
continue outer;
if (!data.done) {
var limit = data.limit;
if (!(data.done = limit > -1 ? (data.count++ >= limit) : !iteratee(value))) {
continue outer;
}
}
} else {
var computed = iteratee(value);
if (type == LAZY_MAP_FLAG) {
value = computed;
} else if (!computed) {
if (type == LAZY_FILTER_FLAG) {
continue outer;
} else {
break outer;
}
}
}
}
if (dropCount) {
dropCount--;
} else {
result[resIndex++] = value;
}
result[resIndex++] = value;
}

@@ -78,0 +81,0 @@ return result;

@@ -33,3 +33,3 @@ import isObjectLike from '../internal/isObjectLike';

return (value && value.nodeType === 1 && isObjectLike(value) &&
objToString.call(value).indexOf('Element') > -1) || false;
(objToString.call(value).indexOf('Element') > -1)) || false;
}

@@ -36,0 +36,0 @@ // Fallback for environments without DOM support.

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

@@ -33,2 +33,3 @@ * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>

import keys from './object/keys';
import last from './array/last';
import lazyClone from './internal/lazyClone';

@@ -43,3 +44,3 @@ import lazyReverse from './internal/lazyReverse';

/** Used as the semantic version number. */
var VERSION = '3.4.0';
var VERSION = '3.5.0';

@@ -51,3 +52,4 @@ /** Used to indicate the type of lazy iteratees. */

/** Used for native method references. */
var arrayProto = Array.prototype;
var arrayProto = Array.prototype,
stringProto = String.prototype;

@@ -246,3 +248,3 @@ /** Native method references. */

lodash.kebabCase = string.kebabCase;
lodash.last = array.last;
lodash.last = last;
lodash.lastIndexOf = array.lastIndexOf;

@@ -339,4 +341,12 @@ lodash.max = math.max;

iteratees.push({
'done': false,
'count': 0,
'index': 0,
'iteratee': baseCallback(iteratee, thisArg, 1),
'limit': -1,
'type': type
});
result.__filtered__ = filtered || isFilter;
iteratees.push({ 'done': false, 'index': 0, 'iteratee': baseCallback(iteratee, thisArg, 1), 'type': type });
return result;

@@ -348,12 +358,15 @@ };

arrayEach(['drop', 'take'], function(methodName, index) {
var countName = '__' + methodName + 'Count__',
whileName = methodName + 'While';
var whileName = methodName + 'While';
LazyWrapper.prototype[methodName] = function(n) {
var filtered = this.__filtered__,
result = (filtered && !index) ? this.dropWhile() : this.clone();
n = n == null ? 1 : nativeMax(floor(n) || 0, 0);
var result = this.clone();
if (result.__filtered__) {
var value = result[countName];
result[countName] = index ? nativeMin(value, n) : (value + n);
if (filtered) {
if (index) {
result.__takeCount__ = nativeMin(result.__takeCount__, n);
} else {
last(result.__iteratees__).limit = n;
}
} else {

@@ -474,7 +487,7 @@ var views = result.__views__ || (result.__views__ = []);

// Add `Array.prototype` functions to `lodash.prototype`.
arrayEach(['concat', 'join', 'pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
var func = arrayProto[methodName],
// Add `Array` and `String` methods to `lodash.prototype`.
arrayEach(['concat', 'join', 'pop', 'push', 'replace', 'shift', 'sort', 'splice', 'split', 'unshift'], function(methodName) {
var func = (/^(?:replace|split)$/.test(methodName) ? stringProto : arrayProto)[methodName],
chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
retUnwrapped = /^(?:join|pop|shift)$/.test(methodName);
retUnwrapped = /^(?:join|pop|replace|shift)$/.test(methodName);

@@ -481,0 +494,0 @@ lodash.prototype[methodName] = function() {

@@ -42,3 +42,3 @@ import isLength from '../internal/isLength';

if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
(typeof object != 'function' && (length && isLength(length)))) {
(typeof object != 'function' && (length && isLength(length)))) {
return shimKeys(object);

@@ -45,0 +45,0 @@ }

{
"name": "lodash-es",
"version": "3.4.0",
"version": "3.5.0",
"description": "The modern build of lodash exported as ES modules.",

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

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

# lodash-es v3.4.0
# lodash-es v3.5.0

@@ -10,2 +10,2 @@ The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [ES](https://people.mozilla.org/~jorendorff/es6-draft.html) modules.

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

@@ -32,3 +32,7 @@ import baseToString from '../internal/baseToString';

var length = string.length;
position = (typeof position == 'undefined' ? length : nativeMin(position < 0 ? 0 : (+position || 0), length)) - target.length;
position = typeof position == 'undefined'
? length
: nativeMin(position < 0 ? 0 : (+position || 0), length);
position -= target.length;
return position >= 0 && string.indexOf(target, position) == position;

@@ -35,0 +39,0 @@ }

@@ -29,3 +29,6 @@ import baseToString from '../internal/baseToString';

string = baseToString(string);
position = position == null ? 0 : nativeMin(position < 0 ? 0 : (+position || 0), string.length);
position = position == null
? 0
: nativeMin(position < 0 ? 0 : (+position || 0), string.length);
return string.lastIndexOf(target, position) == position;

@@ -32,0 +35,0 @@ }

@@ -63,3 +63,3 @@ import baseToString from '../internal/baseToString';

var separator = 'separator' in options ? options.separator : separator;
length = 'length' in options ? +options.length || 0 : length;
length = 'length' in options ? (+options.length || 0) : length;
omission = 'omission' in options ? baseToString(options.omission) : omission;

@@ -66,0 +66,0 @@ } else {

@@ -26,3 +26,3 @@ import isError from '../lang/isError';

length = arguments.length,
args = Array(length ? length - 1 : 0);
args = Array(length ? (length - 1) : 0);

@@ -29,0 +29,0 @@ while (--length > 0) {

@@ -73,3 +73,7 @@ import arrayCopy from '../internal/arrayCopy';

var result = object(this.__wrapped__);
(result.__actions__ = arrayCopy(this.__actions__)).push({ 'func': func, 'args': arguments, 'thisArg': object });
(result.__actions__ = arrayCopy(this.__actions__)).push({
'func': func,
'args': arguments,
'thisArg': object
});
result.__chain__ = chainAll;

@@ -76,0 +80,0 @@ return result;

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc