Compare commits

..

1 Commits

Author SHA1 Message Date
John-David Dalton
6c2960211f Bump to v4.6.1. 2016-03-01 22:11:23 -08:00
10 changed files with 37 additions and 24 deletions

View File

@@ -1,4 +1,4 @@
# lodash-amd v4.6.0 # lodash-amd v4.6.1
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.6.0-amd) for more details. See the [package source](https://github.com/lodash/lodash/tree/4.6.1-amd) for more details.

View File

@@ -54,13 +54,14 @@ define(['./_Stack', './_arrayEach', './_assignValue', './_baseAssign', './_baseF
* @private * @private
* @param {*} value The value to clone. * @param {*} value The value to clone.
* @param {boolean} [isDeep] Specify a deep clone. * @param {boolean} [isDeep] Specify a deep clone.
* @param {boolean} [isFull] Specify a clone including symbols.
* @param {Function} [customizer] The function to customize cloning. * @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`. * @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`. * @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value. * @returns {*} Returns the cloned value.
*/ */
function baseClone(value, isDeep, customizer, key, object, stack) { function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
var result; var result;
if (customizer) { if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value); result = object ? customizer(value, key, object, stack) : customizer(value);
@@ -90,7 +91,8 @@ define(['./_Stack', './_arrayEach', './_assignValue', './_baseAssign', './_baseF
} }
result = initCloneObject(isFunc ? {} : value); result = initCloneObject(isFunc ? {} : value);
if (!isDeep) { if (!isDeep) {
return copySymbols(value, baseAssign(result, value)); result = baseAssign(result, value);
return isFull ? copySymbols(value, result) : result;
} }
} else { } else {
if (!cloneableTags[tag]) { if (!cloneableTags[tag]) {
@@ -109,9 +111,9 @@ define(['./_Stack', './_arrayEach', './_assignValue', './_baseAssign', './_baseF
// Recursively populate clone (susceptible to call stack limits). // Recursively populate clone (susceptible to call stack limits).
(isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
assignValue(result, key, baseClone(subValue, isDeep, customizer, key, value, stack)); assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
}); });
return isArr ? result : copySymbols(value, result); return (isFull && !isArr) ? copySymbols(value, result) : result;
} }
return baseClone; return baseClone;

View File

@@ -6,8 +6,11 @@ define(['./_assignValue', './_copyObject', './_createAssigner', './isArrayLike',
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
var nonEnumShadows = !({ 'valueOf': 1 }).propertyIsEnumerable('valueOf'); var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
/** /**
* Assigns own enumerable properties of source objects to the destination * Assigns own enumerable properties of source objects to the destination

View File

@@ -1,7 +1,13 @@
define(['./_assignValue', './_copyObject', './_createAssigner', './isArrayLike', './_isPrototype', './keysIn'], function(assignValue, copyObject, createAssigner, isArrayLike, isPrototype, keysIn) { define(['./_assignValue', './_copyObject', './_createAssigner', './isArrayLike', './_isPrototype', './keysIn'], function(assignValue, copyObject, createAssigner, isArrayLike, isPrototype, keysIn) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
var nonEnumShadows = !({ 'valueOf': 1 }).propertyIsEnumerable('valueOf'); var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
/** /**
* This method is like `_.assign` except that it iterates over own and * This method is like `_.assign` except that it iterates over own and

View File

@@ -25,7 +25,7 @@ define(['./_baseClone'], function(baseClone) {
* // => true * // => true
*/ */
function clone(value) { function clone(value) {
return baseClone(value); return baseClone(value, false, true);
} }
return clone; return clone;

View File

@@ -17,7 +17,7 @@ define(['./_baseClone'], function(baseClone) {
* // => false * // => false
*/ */
function cloneDeep(value) { function cloneDeep(value) {
return baseClone(value, true); return baseClone(value, true, true);
} }
return cloneDeep; return cloneDeep;

View File

@@ -27,7 +27,7 @@ define(['./_baseClone'], function(baseClone) {
* // => 20 * // => 20
*/ */
function cloneDeepWith(value, customizer) { function cloneDeepWith(value, customizer) {
return baseClone(value, true, customizer); return baseClone(value, true, true, customizer);
} }
return cloneDeepWith; return cloneDeepWith;

View File

@@ -30,7 +30,7 @@ define(['./_baseClone'], function(baseClone) {
* // => 0 * // => 0
*/ */
function cloneWith(value, customizer) { function cloneWith(value, customizer) {
return baseClone(value, false, customizer); return baseClone(value, false, true, customizer);
} }
return cloneWith; return cloneWith;

24
main.js
View File

@@ -1,6 +1,6 @@
/** /**
* @license * @license
* lodash 4.6.0 (Custom Build) <https://lodash.com/> * lodash 4.6.1 (Custom Build) <https://lodash.com/>
* Build: `lodash exports="amd" -d -o ./main.js` * Build: `lodash exports="amd" -d -o ./main.js`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@@ -13,7 +13,7 @@
var undefined; var undefined;
/** Used as the semantic version number. */ /** Used as the semantic version number. */
var VERSION = '4.6.0'; var VERSION = '4.6.1';
/** 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;
@@ -1394,7 +1394,7 @@
var metaMap = WeakMap && new WeakMap; var metaMap = WeakMap && new WeakMap;
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
var nonEnumShadows = !({ 'valueOf': 1 }).propertyIsEnumerable('valueOf'); var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
/** Used to lookup unminified function names. */ /** Used to lookup unminified function names. */
var realNames = {}; var realNames = {};
@@ -2328,13 +2328,14 @@
* @private * @private
* @param {*} value The value to clone. * @param {*} value The value to clone.
* @param {boolean} [isDeep] Specify a deep clone. * @param {boolean} [isDeep] Specify a deep clone.
* @param {boolean} [isFull] Specify a clone including symbols.
* @param {Function} [customizer] The function to customize cloning. * @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`. * @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`. * @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value. * @returns {*} Returns the cloned value.
*/ */
function baseClone(value, isDeep, customizer, key, object, stack) { function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
var result; var result;
if (customizer) { if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value); result = object ? customizer(value, key, object, stack) : customizer(value);
@@ -2364,7 +2365,8 @@
} }
result = initCloneObject(isFunc ? {} : value); result = initCloneObject(isFunc ? {} : value);
if (!isDeep) { if (!isDeep) {
return copySymbols(value, baseAssign(result, value)); result = baseAssign(result, value);
return isFull ? copySymbols(value, result) : result;
} }
} else { } else {
if (!cloneableTags[tag]) { if (!cloneableTags[tag]) {
@@ -2383,9 +2385,9 @@
// Recursively populate clone (susceptible to call stack limits). // Recursively populate clone (susceptible to call stack limits).
(isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
assignValue(result, key, baseClone(subValue, isDeep, customizer, key, value, stack)); assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
}); });
return isArr ? result : copySymbols(value, result); return (isFull && !isArr) ? copySymbols(value, result) : result;
} }
/** /**
@@ -9467,7 +9469,7 @@
* // => true * // => true
*/ */
function clone(value) { function clone(value) {
return baseClone(value); return baseClone(value, false, true);
} }
/** /**
@@ -9500,7 +9502,7 @@
* // => 0 * // => 0
*/ */
function cloneWith(value, customizer) { function cloneWith(value, customizer) {
return baseClone(value, false, customizer); return baseClone(value, false, true, customizer);
} }
/** /**
@@ -9520,7 +9522,7 @@
* // => false * // => false
*/ */
function cloneDeep(value) { function cloneDeep(value) {
return baseClone(value, true); return baseClone(value, true, true);
} }
/** /**
@@ -9550,7 +9552,7 @@
* // => 20 * // => 20
*/ */
function cloneDeepWith(value, customizer) { function cloneDeepWith(value, customizer) {
return baseClone(value, true, customizer); return baseClone(value, true, true, customizer);
} }
/** /**

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash-amd", "name": "lodash-amd",
"version": "4.6.0", "version": "4.6.1",
"description": "Lodash exported as AMD modules.", "description": "Lodash exported as AMD modules.",
"homepage": "https://lodash.com/custom-builds", "homepage": "https://lodash.com/custom-builds",
"license": "MIT", "license": "MIT",