mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Compare commits
1 Commits
4.16.2-amd
...
4.16.3-amd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0961d6edde |
@@ -1,4 +1,4 @@
|
|||||||
# lodash-amd v4.16.2
|
# lodash-amd v4.16.3
|
||||||
|
|
||||||
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.16.2-amd) for more details.
|
See the [package source](https://github.com/lodash/lodash/tree/4.16.3-amd) for more details.
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ define(['./_baseAssignValue', './eq'], function(baseAssignValue, eq) {
|
|||||||
*/
|
*/
|
||||||
function assignMergeValue(object, key, value) {
|
function assignMergeValue(object, key, value) {
|
||||||
if ((value !== undefined && !eq(object[key], value)) ||
|
if ((value !== undefined && !eq(object[key], value)) ||
|
||||||
(typeof key == 'number' && value === undefined && !(key in object))) {
|
(value === undefined && !(key in object))) {
|
||||||
baseAssignValue(object, key, value);
|
baseAssignValue(object, key, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
define([], function() {
|
define(['./_defineProperty'], function(defineProperty) {
|
||||||
|
|
||||||
/** Built-in value references. */
|
|
||||||
var defineProperty = Object.defineProperty;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `assignValue` and `assignMergeValue` without
|
* The base implementation of `assignValue` and `assignMergeValue` without
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ define(['./isObject'], function(isObject) {
|
|||||||
if (objectCreate) {
|
if (objectCreate) {
|
||||||
return objectCreate(proto);
|
return objectCreate(proto);
|
||||||
}
|
}
|
||||||
object.prototype = prototype;
|
object.prototype = proto;
|
||||||
var result = new object;
|
var result = new object;
|
||||||
object.prototype = undefined;
|
object.prototype = undefined;
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./_Stack', './_equalArrays', './_equalByTag', './_equalObjects', './_getTag', './isArray', './isTypedArray'], function(Stack, equalArrays, equalByTag, equalObjects, getTag, isArray, isTypedArray) {
|
define(['./_Stack', './_equalArrays', './_equalByTag', './_equalObjects', './_getTag', './isArray', './isBuffer', './isTypedArray'], function(Stack, equalArrays, equalByTag, equalObjects, getTag, isArray, isBuffer, isTypedArray) {
|
||||||
|
|
||||||
/** Used to compose bitmasks for comparison styles. */
|
/** Used to compose bitmasks for comparison styles. */
|
||||||
var PARTIAL_COMPARE_FLAG = 2;
|
var PARTIAL_COMPARE_FLAG = 2;
|
||||||
@@ -47,6 +47,13 @@ define(['./_Stack', './_equalArrays', './_equalByTag', './_equalObjects', './_ge
|
|||||||
othIsObj = othTag == objectTag,
|
othIsObj = othTag == objectTag,
|
||||||
isSameTag = objTag == othTag;
|
isSameTag = objTag == othTag;
|
||||||
|
|
||||||
|
if (isSameTag && isBuffer(object)) {
|
||||||
|
if (!isBuffer(other)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
objIsArr = true;
|
||||||
|
objIsObj = false;
|
||||||
|
}
|
||||||
if (isSameTag && !objIsObj) {
|
if (isSameTag && !objIsObj) {
|
||||||
stack || (stack = new Stack);
|
stack || (stack = new Stack);
|
||||||
return (objIsArr || isTypedArray(object))
|
return (objIsArr || isTypedArray(object))
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./_assignMergeValue', './_baseClone', './_copyArray', './isArguments', './isArray', './isArrayLikeObject', './isFunction', './isObject', './isPlainObject', './isTypedArray', './toPlainObject'], function(assignMergeValue, baseClone, copyArray, isArguments, isArray, isArrayLikeObject, isFunction, isObject, isPlainObject, isTypedArray, toPlainObject) {
|
define(['./_assignMergeValue', './_cloneTypedArray', './_copyArray', './_initCloneObject', './isArguments', './isArray', './isArrayLikeObject', './isFunction', './isObject', './isPlainObject', './isTypedArray', './toPlainObject'], function(assignMergeValue, cloneTypedArray, copyArray, initCloneObject, isArguments, isArray, isArrayLikeObject, isFunction, isObject, isPlainObject, isTypedArray, toPlainObject) {
|
||||||
|
|
||||||
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
||||||
var undefined;
|
var undefined;
|
||||||
@@ -34,29 +34,32 @@ define(['./_assignMergeValue', './_baseClone', './_copyArray', './isArguments',
|
|||||||
var isCommon = newValue === undefined;
|
var isCommon = newValue === undefined;
|
||||||
|
|
||||||
if (isCommon) {
|
if (isCommon) {
|
||||||
|
var isArr = isArray(srcValue),
|
||||||
|
isTyped = !isArr && isTypedArray(srcValue);
|
||||||
|
|
||||||
newValue = srcValue;
|
newValue = srcValue;
|
||||||
if (isArray(srcValue) || isTypedArray(srcValue)) {
|
if (isArr || isTyped) {
|
||||||
if (isArray(objValue)) {
|
if (isArray(objValue)) {
|
||||||
newValue = objValue;
|
newValue = objValue;
|
||||||
}
|
}
|
||||||
else if (isArrayLikeObject(objValue)) {
|
else if (isArrayLikeObject(objValue)) {
|
||||||
newValue = copyArray(objValue);
|
newValue = copyArray(objValue);
|
||||||
}
|
}
|
||||||
else {
|
else if (isTyped) {
|
||||||
isCommon = false;
|
isCommon = false;
|
||||||
newValue = baseClone(srcValue, true);
|
newValue = cloneTypedArray(srcValue, true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
newValue = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
||||||
|
newValue = objValue;
|
||||||
if (isArguments(objValue)) {
|
if (isArguments(objValue)) {
|
||||||
newValue = toPlainObject(objValue);
|
newValue = toPlainObject(objValue);
|
||||||
}
|
}
|
||||||
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
|
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
|
||||||
isCommon = false;
|
newValue = initCloneObject(srcValue);
|
||||||
newValue = baseClone(srcValue, true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
newValue = objValue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
define(['./constant', './identity', './_nativeDefineProperty'], function(constant, identity, nativeDefineProperty) {
|
define(['./constant', './_defineProperty', './identity'], function(constant, defineProperty, identity) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `setToString` without support for hot loop shorting.
|
* The base implementation of `setToString` without support for hot loop shorting.
|
||||||
@@ -8,8 +8,8 @@ define(['./constant', './identity', './_nativeDefineProperty'], function(constan
|
|||||||
* @param {Function} string The `toString` result.
|
* @param {Function} string The `toString` result.
|
||||||
* @returns {Function} Returns `func`.
|
* @returns {Function} Returns `func`.
|
||||||
*/
|
*/
|
||||||
var baseSetToString = !nativeDefineProperty ? identity : function(func, string) {
|
var baseSetToString = !defineProperty ? identity : function(func, string) {
|
||||||
return nativeDefineProperty(func, 'toString', {
|
return defineProperty(func, 'toString', {
|
||||||
'configurable': true,
|
'configurable': true,
|
||||||
'enumerable': false,
|
'enumerable': false,
|
||||||
'value': constant(string),
|
'value': constant(string),
|
||||||
|
|||||||
12
_defineProperty.js
Normal file
12
_defineProperty.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
define(['./_getNative'], function(getNative) {
|
||||||
|
|
||||||
|
var defineProperty = (function() {
|
||||||
|
try {
|
||||||
|
var func = getNative(Object, 'defineProperty');
|
||||||
|
func({}, '', {});
|
||||||
|
return func;
|
||||||
|
} catch (e) {}
|
||||||
|
}());
|
||||||
|
|
||||||
|
return defineProperty;
|
||||||
|
});
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
define(['./_getNative'], function(getNative) {
|
|
||||||
|
|
||||||
/* Built-in method references that are verified to be native. */
|
|
||||||
var nativeDefineProperty = getNative(Object, 'defineProperty');
|
|
||||||
|
|
||||||
return nativeDefineProperty;
|
|
||||||
});
|
|
||||||
@@ -2,7 +2,8 @@ define(['./isObject'], function(isObject) {
|
|||||||
|
|
||||||
/** `Object#toString` result references. */
|
/** `Object#toString` result references. */
|
||||||
var funcTag = '[object Function]',
|
var funcTag = '[object Function]',
|
||||||
genTag = '[object GeneratorFunction]';
|
genTag = '[object GeneratorFunction]',
|
||||||
|
proxyTag = '[object Proxy]';
|
||||||
|
|
||||||
/** Used for built-in method references. */
|
/** Used for built-in method references. */
|
||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
@@ -35,7 +36,7 @@ define(['./isObject'], function(isObject) {
|
|||||||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||||||
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
||||||
var tag = isObject(value) ? objectToString.call(value) : '';
|
var tag = isObject(value) ? objectToString.call(value) : '';
|
||||||
return tag == funcTag || tag == genTag;
|
return tag == funcTag || tag == genTag || tag == proxyTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
return isFunction;
|
return isFunction;
|
||||||
|
|||||||
51
main.js
51
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.16.2';
|
var VERSION = '4.16.3';
|
||||||
|
|
||||||
/** 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;
|
||||||
@@ -96,6 +96,7 @@
|
|||||||
numberTag = '[object Number]',
|
numberTag = '[object Number]',
|
||||||
objectTag = '[object Object]',
|
objectTag = '[object Object]',
|
||||||
promiseTag = '[object Promise]',
|
promiseTag = '[object Promise]',
|
||||||
|
proxyTag = '[object Proxy]',
|
||||||
regexpTag = '[object RegExp]',
|
regexpTag = '[object RegExp]',
|
||||||
setTag = '[object Set]',
|
setTag = '[object Set]',
|
||||||
stringTag = '[object String]',
|
stringTag = '[object String]',
|
||||||
@@ -1470,7 +1471,6 @@
|
|||||||
Symbol = context.Symbol,
|
Symbol = context.Symbol,
|
||||||
Uint8Array = context.Uint8Array,
|
Uint8Array = context.Uint8Array,
|
||||||
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
|
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
|
||||||
defineProperty = Object.defineProperty,
|
|
||||||
getPrototype = overArg(Object.getPrototypeOf, Object),
|
getPrototype = overArg(Object.getPrototypeOf, Object),
|
||||||
iteratorSymbol = Symbol ? Symbol.iterator : undefined,
|
iteratorSymbol = Symbol ? Symbol.iterator : undefined,
|
||||||
objectCreate = Object.create,
|
objectCreate = Object.create,
|
||||||
@@ -1478,6 +1478,14 @@
|
|||||||
splice = arrayProto.splice,
|
splice = arrayProto.splice,
|
||||||
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
|
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
|
||||||
|
|
||||||
|
var defineProperty = (function() {
|
||||||
|
try {
|
||||||
|
var func = getNative(Object, 'defineProperty');
|
||||||
|
func({}, '', {});
|
||||||
|
return func;
|
||||||
|
} catch (e) {}
|
||||||
|
}());
|
||||||
|
|
||||||
/** Mocked built-ins. */
|
/** Mocked built-ins. */
|
||||||
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
|
||||||
ctxNow = Date && Date.now !== root.Date.now && Date.now,
|
ctxNow = Date && Date.now !== root.Date.now && Date.now,
|
||||||
@@ -1504,8 +1512,7 @@
|
|||||||
Promise = getNative(context, 'Promise'),
|
Promise = getNative(context, 'Promise'),
|
||||||
Set = getNative(context, 'Set'),
|
Set = getNative(context, 'Set'),
|
||||||
WeakMap = getNative(context, 'WeakMap'),
|
WeakMap = getNative(context, 'WeakMap'),
|
||||||
nativeCreate = getNative(Object, 'create'),
|
nativeCreate = getNative(Object, 'create');
|
||||||
nativeDefineProperty = getNative(Object, 'defineProperty');
|
|
||||||
|
|
||||||
/** Used to store function metadata. */
|
/** Used to store function metadata. */
|
||||||
var metaMap = WeakMap && new WeakMap;
|
var metaMap = WeakMap && new WeakMap;
|
||||||
@@ -1673,7 +1680,7 @@
|
|||||||
if (objectCreate) {
|
if (objectCreate) {
|
||||||
return objectCreate(proto);
|
return objectCreate(proto);
|
||||||
}
|
}
|
||||||
object.prototype = prototype;
|
object.prototype = proto;
|
||||||
var result = new object;
|
var result = new object;
|
||||||
object.prototype = undefined;
|
object.prototype = undefined;
|
||||||
return result;
|
return result;
|
||||||
@@ -2463,7 +2470,7 @@
|
|||||||
*/
|
*/
|
||||||
function assignMergeValue(object, key, value) {
|
function assignMergeValue(object, key, value) {
|
||||||
if ((value !== undefined && !eq(object[key], value)) ||
|
if ((value !== undefined && !eq(object[key], value)) ||
|
||||||
(typeof key == 'number' && value === undefined && !(key in object))) {
|
(value === undefined && !(key in object))) {
|
||||||
baseAssignValue(object, key, value);
|
baseAssignValue(object, key, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3272,6 +3279,13 @@
|
|||||||
othIsObj = othTag == objectTag,
|
othIsObj = othTag == objectTag,
|
||||||
isSameTag = objTag == othTag;
|
isSameTag = objTag == othTag;
|
||||||
|
|
||||||
|
if (isSameTag && isBuffer(object)) {
|
||||||
|
if (!isBuffer(other)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
objIsArr = true;
|
||||||
|
objIsObj = false;
|
||||||
|
}
|
||||||
if (isSameTag && !objIsObj) {
|
if (isSameTag && !objIsObj) {
|
||||||
stack || (stack = new Stack);
|
stack || (stack = new Stack);
|
||||||
return (objIsArr || isTypedArray(object))
|
return (objIsArr || isTypedArray(object))
|
||||||
@@ -3617,29 +3631,32 @@
|
|||||||
var isCommon = newValue === undefined;
|
var isCommon = newValue === undefined;
|
||||||
|
|
||||||
if (isCommon) {
|
if (isCommon) {
|
||||||
|
var isArr = isArray(srcValue),
|
||||||
|
isTyped = !isArr && isTypedArray(srcValue);
|
||||||
|
|
||||||
newValue = srcValue;
|
newValue = srcValue;
|
||||||
if (isArray(srcValue) || isTypedArray(srcValue)) {
|
if (isArr || isTyped) {
|
||||||
if (isArray(objValue)) {
|
if (isArray(objValue)) {
|
||||||
newValue = objValue;
|
newValue = objValue;
|
||||||
}
|
}
|
||||||
else if (isArrayLikeObject(objValue)) {
|
else if (isArrayLikeObject(objValue)) {
|
||||||
newValue = copyArray(objValue);
|
newValue = copyArray(objValue);
|
||||||
}
|
}
|
||||||
else {
|
else if (isTyped) {
|
||||||
isCommon = false;
|
isCommon = false;
|
||||||
newValue = baseClone(srcValue, true);
|
newValue = cloneTypedArray(srcValue, true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
newValue = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
||||||
|
newValue = objValue;
|
||||||
if (isArguments(objValue)) {
|
if (isArguments(objValue)) {
|
||||||
newValue = toPlainObject(objValue);
|
newValue = toPlainObject(objValue);
|
||||||
}
|
}
|
||||||
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
|
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
|
||||||
isCommon = false;
|
newValue = initCloneObject(srcValue);
|
||||||
newValue = baseClone(srcValue, true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
newValue = objValue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -3985,8 +4002,8 @@
|
|||||||
* @param {Function} string The `toString` result.
|
* @param {Function} string The `toString` result.
|
||||||
* @returns {Function} Returns `func`.
|
* @returns {Function} Returns `func`.
|
||||||
*/
|
*/
|
||||||
var baseSetToString = !nativeDefineProperty ? identity : function(func, string) {
|
var baseSetToString = !defineProperty ? identity : function(func, string) {
|
||||||
return nativeDefineProperty(func, 'toString', {
|
return defineProperty(func, 'toString', {
|
||||||
'configurable': true,
|
'configurable': true,
|
||||||
'enumerable': false,
|
'enumerable': false,
|
||||||
'value': constant(string),
|
'value': constant(string),
|
||||||
@@ -11556,7 +11573,7 @@
|
|||||||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||||||
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
||||||
var tag = isObject(value) ? objectToString.call(value) : '';
|
var tag = isObject(value) ? objectToString.call(value) : '';
|
||||||
return tag == funcTag || tag == genTag;
|
return tag == funcTag || tag == genTag || tag == proxyTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash-amd",
|
"name": "lodash-amd",
|
||||||
"version": "4.16.2",
|
"version": "4.16.3",
|
||||||
"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",
|
||||||
|
|||||||
Reference in New Issue
Block a user