mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Compare commits
1 Commits
4.17.1-amd
...
4.17.2-amd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c27706e89 |
@@ -1,4 +1,4 @@
|
|||||||
# lodash-amd v4.17.1
|
# lodash-amd v4.17.2
|
||||||
|
|
||||||
The [Lodash](https://lodash.com/) library exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
|
The [Lodash](https://lodash.com/) library exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
|
||||||
|
|
||||||
@@ -27,4 +27,4 @@ require({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [package source](https://github.com/lodash/lodash/tree/4.17.1-amd) for more details.
|
See the [package source](https://github.com/lodash/lodash/tree/4.17.2-amd) for more details.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./_baseGet', './_baseSet'], function(baseGet, baseSet) {
|
define(['./_baseGet', './_baseSet', './_castPath'], function(baseGet, baseSet, castPath) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.pickBy` without support for iteratee shorthands.
|
* The base implementation of `_.pickBy` without support for iteratee shorthands.
|
||||||
@@ -19,7 +19,7 @@ define(['./_baseGet', './_baseSet'], function(baseGet, baseSet) {
|
|||||||
value = baseGet(object, path);
|
value = baseGet(object, path);
|
||||||
|
|
||||||
if (predicate(value, path)) {
|
if (predicate(value, path)) {
|
||||||
baseSet(result, path, value);
|
baseSet(result, castPath(path, object), value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./_castPath', './_isIndex', './last', './_parent', './_toKey'], function(castPath, isIndex, last, parent, toKey) {
|
define(['./_baseUnset', './_isIndex'], function(baseUnset, isIndex) {
|
||||||
|
|
||||||
/** Used for built-in method references. */
|
/** Used for built-in method references. */
|
||||||
var arrayProto = Array.prototype;
|
var arrayProto = Array.prototype;
|
||||||
@@ -25,14 +25,8 @@ define(['./_castPath', './_isIndex', './last', './_parent', './_toKey'], functio
|
|||||||
var previous = index;
|
var previous = index;
|
||||||
if (isIndex(index)) {
|
if (isIndex(index)) {
|
||||||
splice.call(array, index, 1);
|
splice.call(array, index, 1);
|
||||||
}
|
} else {
|
||||||
else {
|
baseUnset(array, index);
|
||||||
var path = castPath(index, array),
|
|
||||||
object = parent(array, path);
|
|
||||||
|
|
||||||
if (object != null) {
|
|
||||||
delete object[toKey(last(path))];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
define(['./_castPath', './last', './_parent', './_toKey'], function(castPath, last, parent, toKey) {
|
define(['./_castPath', './last', './_parent', './_toKey'], function(castPath, last, parent, toKey) {
|
||||||
|
|
||||||
/** Used for built-in method references. */
|
|
||||||
var objectProto = Object.prototype;
|
|
||||||
|
|
||||||
/** Used to check objects for own properties. */
|
|
||||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.unset`.
|
* The base implementation of `_.unset`.
|
||||||
*
|
*
|
||||||
@@ -17,8 +11,7 @@ define(['./_castPath', './last', './_parent', './_toKey'], function(castPath, la
|
|||||||
function baseUnset(object, path) {
|
function baseUnset(object, path) {
|
||||||
path = castPath(path, object);
|
path = castPath(path, object);
|
||||||
object = parent(object, path);
|
object = parent(object, path);
|
||||||
var key = toKey(last(path));
|
return object == null || delete object[toKey(last(path))];
|
||||||
return !(object != null && hasOwnProperty.call(object, key)) || delete object[key];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return baseUnset;
|
return baseUnset;
|
||||||
|
|||||||
33
main.js
33
main.js
@@ -13,7 +13,7 @@
|
|||||||
var undefined;
|
var undefined;
|
||||||
|
|
||||||
/** Used as the semantic version number. */
|
/** Used as the semantic version number. */
|
||||||
var VERSION = '4.17.1';
|
var VERSION = '4.17.2';
|
||||||
|
|
||||||
/** Used as the size to enable large array optimizations. */
|
/** Used as the size to enable large array optimizations. */
|
||||||
var LARGE_ARRAY_SIZE = 200;
|
var LARGE_ARRAY_SIZE = 200;
|
||||||
@@ -3806,7 +3806,7 @@
|
|||||||
value = baseGet(object, path);
|
value = baseGet(object, path);
|
||||||
|
|
||||||
if (predicate(value, path)) {
|
if (predicate(value, path)) {
|
||||||
baseSet(result, path, value);
|
baseSet(result, castPath(path, object), value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -3882,14 +3882,8 @@
|
|||||||
var previous = index;
|
var previous = index;
|
||||||
if (isIndex(index)) {
|
if (isIndex(index)) {
|
||||||
splice.call(array, index, 1);
|
splice.call(array, index, 1);
|
||||||
}
|
} else {
|
||||||
else {
|
baseUnset(array, index);
|
||||||
var path = castPath(index, array),
|
|
||||||
object = parent(array, path);
|
|
||||||
|
|
||||||
if (object != null) {
|
|
||||||
delete object[toKey(last(path))];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4353,8 +4347,7 @@
|
|||||||
function baseUnset(object, path) {
|
function baseUnset(object, path) {
|
||||||
path = castPath(path, object);
|
path = castPath(path, object);
|
||||||
object = parent(object, path);
|
object = parent(object, path);
|
||||||
var key = toKey(last(path));
|
return object == null || delete object[toKey(last(path))];
|
||||||
return !(object != null && hasOwnProperty.call(object, key)) || delete object[key];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10848,15 +10841,11 @@
|
|||||||
start = start === undefined ? 0 : nativeMax(toInteger(start), 0);
|
start = start === undefined ? 0 : nativeMax(toInteger(start), 0);
|
||||||
return baseRest(function(args) {
|
return baseRest(function(args) {
|
||||||
var array = args[start],
|
var array = args[start],
|
||||||
lastIndex = args.length - 1,
|
|
||||||
otherArgs = castSlice(args, 0, start);
|
otherArgs = castSlice(args, 0, start);
|
||||||
|
|
||||||
if (array) {
|
if (array) {
|
||||||
arrayPush(otherArgs, array);
|
arrayPush(otherArgs, array);
|
||||||
}
|
}
|
||||||
if (start != lastIndex) {
|
|
||||||
arrayPush(otherArgs, castSlice(args, start + 1));
|
|
||||||
}
|
|
||||||
return apply(func, this, otherArgs);
|
return apply(func, this, otherArgs);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -13471,16 +13460,16 @@
|
|||||||
if (object == null) {
|
if (object == null) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
var bitmask = CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG;
|
var isDeep = false;
|
||||||
paths = arrayMap(paths, function(path) {
|
paths = arrayMap(paths, function(path) {
|
||||||
path = castPath(path, object);
|
path = castPath(path, object);
|
||||||
bitmask |= (path.length > 1 ? CLONE_DEEP_FLAG : 0);
|
isDeep || (isDeep = path.length > 1);
|
||||||
return path;
|
return path;
|
||||||
});
|
});
|
||||||
|
|
||||||
copyObject(object, getAllKeysIn(object), result);
|
copyObject(object, getAllKeysIn(object), result);
|
||||||
result = baseClone(result, bitmask);
|
if (isDeep) {
|
||||||
|
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG);
|
||||||
|
}
|
||||||
var length = paths.length;
|
var length = paths.length;
|
||||||
while (length--) {
|
while (length--) {
|
||||||
baseUnset(result, paths[length]);
|
baseUnset(result, paths[length]);
|
||||||
@@ -13601,8 +13590,8 @@
|
|||||||
|
|
||||||
// Ensure the loop is entered when path is empty.
|
// Ensure the loop is entered when path is empty.
|
||||||
if (!length) {
|
if (!length) {
|
||||||
object = undefined;
|
|
||||||
length = 1;
|
length = 1;
|
||||||
|
object = undefined;
|
||||||
}
|
}
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
var value = object == null ? undefined : object[toKey(path[index])];
|
var value = object == null ? undefined : object[toKey(path[index])];
|
||||||
|
|||||||
10
omit.js
10
omit.js
@@ -30,16 +30,16 @@ define(['./_arrayMap', './_baseClone', './_baseUnset', './_castPath', './_copyOb
|
|||||||
if (object == null) {
|
if (object == null) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
var bitmask = CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG;
|
var isDeep = false;
|
||||||
paths = arrayMap(paths, function(path) {
|
paths = arrayMap(paths, function(path) {
|
||||||
path = castPath(path, object);
|
path = castPath(path, object);
|
||||||
bitmask |= (path.length > 1 ? CLONE_DEEP_FLAG : 0);
|
isDeep || (isDeep = path.length > 1);
|
||||||
return path;
|
return path;
|
||||||
});
|
});
|
||||||
|
|
||||||
copyObject(object, getAllKeysIn(object), result);
|
copyObject(object, getAllKeysIn(object), result);
|
||||||
result = baseClone(result, bitmask);
|
if (isDeep) {
|
||||||
|
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG);
|
||||||
|
}
|
||||||
var length = paths.length;
|
var length = paths.length;
|
||||||
while (length--) {
|
while (length--) {
|
||||||
baseUnset(result, paths[length]);
|
baseUnset(result, paths[length]);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash-amd",
|
"name": "lodash-amd",
|
||||||
"version": "4.17.1",
|
"version": "4.17.2",
|
||||||
"description": "Lodash exported as AMD modules.",
|
"description": "Lodash exported as AMD modules.",
|
||||||
"keywords": "amd, modules, stdlib, util",
|
"keywords": "amd, modules, stdlib, util",
|
||||||
"homepage": "https://lodash.com/custom-builds",
|
"homepage": "https://lodash.com/custom-builds",
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ define(['./_castPath', './isFunction', './_toKey'], function(castPath, isFunctio
|
|||||||
|
|
||||||
// Ensure the loop is entered when path is empty.
|
// Ensure the loop is entered when path is empty.
|
||||||
if (!length) {
|
if (!length) {
|
||||||
object = undefined;
|
|
||||||
length = 1;
|
length = 1;
|
||||||
|
object = undefined;
|
||||||
}
|
}
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
var value = object == null ? undefined : object[toKey(path[index])];
|
var value = object == null ? undefined : object[toKey(path[index])];
|
||||||
|
|||||||
@@ -50,15 +50,11 @@ define(['./_apply', './_arrayPush', './_baseRest', './_castSlice', './toInteger'
|
|||||||
start = start === undefined ? 0 : nativeMax(toInteger(start), 0);
|
start = start === undefined ? 0 : nativeMax(toInteger(start), 0);
|
||||||
return baseRest(function(args) {
|
return baseRest(function(args) {
|
||||||
var array = args[start],
|
var array = args[start],
|
||||||
lastIndex = args.length - 1,
|
|
||||||
otherArgs = castSlice(args, 0, start);
|
otherArgs = castSlice(args, 0, start);
|
||||||
|
|
||||||
if (array) {
|
if (array) {
|
||||||
arrayPush(otherArgs, array);
|
arrayPush(otherArgs, array);
|
||||||
}
|
}
|
||||||
if (start != lastIndex) {
|
|
||||||
arrayPush(otherArgs, castSlice(args, start + 1));
|
|
||||||
}
|
|
||||||
return apply(func, this, otherArgs);
|
return apply(func, this, otherArgs);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user