Compare commits

..

1 Commits

Author SHA1 Message Date
John-David Dalton
623a72a129 Bump to v4.14.1. 2016-07-28 23:38:46 -07:00
20 changed files with 113 additions and 81 deletions

View File

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

View File

@@ -120,9 +120,6 @@ define(['./_Stack', './_arrayEach', './_assignValue', './_baseAssign', './_clone
// Recursively populate clone (susceptible to call stack limits).
assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
});
if (!isFull) {
stack['delete'](value);
}
return result;
}

View File

@@ -1,4 +1,4 @@
define(['./_baseRange', './_isIterateeCall', './toNumber'], function(baseRange, isIterateeCall, toNumber) {
define(['./_baseRange', './_isIterateeCall', './toFinite'], function(baseRange, isIterateeCall, toFinite) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
@@ -16,15 +16,14 @@ define(['./_baseRange', './_isIterateeCall', './toNumber'], function(baseRange,
end = step = undefined;
}
// Ensure the sign of `-0` is preserved.
start = toNumber(start);
start = start === start ? start : 0;
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toNumber(end) || 0;
end = toFinite(end);
}
step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);
step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
return baseRange(start, end, step, fromRight);
};
}

View File

@@ -78,6 +78,7 @@ define(['./_SetCache', './_arraySome'], function(SetCache, arraySome) {
}
}
stack['delete'](array);
stack['delete'](other);
return result;
}

View File

@@ -80,6 +80,7 @@ define(['./_baseHas', './keys'], function(baseHas, keys) {
}
}
stack['delete'](object);
stack['delete'](other);
return result;
}

View File

@@ -1,4 +1,4 @@
define(['./_arrayPush', './_getPrototype', './_getSymbols'], function(arrayPush, getPrototype, getSymbols) {
define(['./_arrayPush', './_getPrototype', './_getSymbols', './stubArray'], function(arrayPush, getPrototype, getSymbols, stubArray) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
@@ -11,7 +11,7 @@ define(['./_arrayPush', './_getPrototype', './_getSymbols'], function(arrayPush,
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? getSymbols : function(object) {
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));

View File

@@ -15,7 +15,7 @@ define(['./_Symbol', './isArguments', './isArray'], function(Symbol, isArguments
*/
function isFlattenable(value) {
return isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol])
!!(spreadableSymbol && value && value[spreadableSymbol]);
}
return isFlattenable;

View File

@@ -1,10 +1,10 @@
define(['./_freeGlobal'], function(freeGlobal) {
/** Detect free variable `exports`. */
var freeExports = freeGlobal && typeof exports == 'object' && exports;
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module;
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

View File

@@ -1,7 +1,8 @@
define(['./memoize', './toString'], function(memoize, toString) {
/** Used to match property names within property paths. */
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g;
var reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
@@ -14,8 +15,13 @@ define(['./memoize', './toString'], function(memoize, toString) {
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoize(function(string) {
string = toString(string);
var result = [];
toString(string).replace(rePropName, function(match, number, quote, string) {
if (reLeadingDot.test(string)) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;

View File

@@ -5,6 +5,9 @@ define(['./_baseClone', './_baseConforms'], function(baseClone, baseConforms) {
* the corresponding property values of a given object, returning `true` if
* all predicates return truthy, else `false`.
*
* **Note:** The created function is equivalent to `_.conformsTo` with
* `source` partially applied.
*
* @static
* @memberOf _
* @since 4.0.0

View File

@@ -1,9 +1,11 @@
define(['./_baseConformsTo', './keys'], function(baseConformsTo, keys) {
/**
* Checks if `object` conforms to `source` by invoking the predicate properties
* of `source` with the corresponding property values of `object`. This method
* is equivalent to a `_.conforms` function when `source` is partially applied.
* Checks if `object` conforms to `source` by invoking the predicate
* properties of `source` with the corresponding property values of `object`.
*
* **Note:** This method is equivalent to `_.conforms` when `source` is
* partially applied.
*
* @static
* @memberOf _

View File

@@ -15,14 +15,18 @@ define(['./isObject', './now', './toNumber'], function(isObject, now, toNumber)
* milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide an options object to indicate whether `func` should be invoked on
* the leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent calls
* to the debounced function return the result of the last `func` invocation.
* Provide `options` to indicate whether `func` should be invoked on the
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent
* calls to the debounced function return the result of the last `func`
* invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the debounced function is
* invoked more than once during the `wait` timeout.
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the debounced function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.debounce` and `_.throttle`.

View File

@@ -1,4 +1,4 @@
define(['./_baseInRange', './toNumber'], function(baseInRange, toNumber) {
define(['./_baseInRange', './toFinite', './toNumber'], function(baseInRange, toFinite, toNumber) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
@@ -42,12 +42,12 @@ define(['./_baseInRange', './toNumber'], function(baseInRange, toNumber) {
* // => true
*/
function inRange(number, start, end) {
start = toNumber(start) || 0;
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toNumber(end) || 0;
end = toFinite(end);
}
number = toNumber(number);
return baseInRange(number, start, end);

View File

@@ -1,13 +1,13 @@
define(['./_freeGlobal', './_root', './stubFalse'], function(freeGlobal, root, stubFalse) {
define(['./_root', './stubFalse'], function(root, stubFalse) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
/** Detect free variable `exports`. */
var freeExports = freeGlobal && typeof exports == 'object' && exports;
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module;
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

View File

@@ -2,10 +2,10 @@ define(['./_baseIsMatch', './_getMatchData'], function(baseIsMatch, getMatchData
/**
* Performs a partial deep comparison between `object` and `source` to
* determine if `object` contains equivalent property values. This method is
* equivalent to a `_.matches` function when `source` is partially applied.
* determine if `object` contains equivalent property values.
*
* **Note:** This method supports comparing the same values as `_.isEqual`.
* **Note:** This method supports comparing the same values as `_.isEqual`
* and is equivalent to `_.matches` when `source` is partially applied.
*
* @static
* @memberOf _

88
main.js
View File

@@ -13,7 +13,7 @@
var undefined;
/** Used as the semantic version number. */
var VERSION = '4.14.0';
var VERSION = '4.14.1';
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
@@ -130,7 +130,8 @@
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g;
reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/**
* Used to match `RegExp`
@@ -371,10 +372,10 @@
var root = freeGlobal || freeSelf || Function('return this')();
/** Detect free variable `exports`. */
var freeExports = freeGlobal && typeof exports == 'object' && exports;
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module;
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
@@ -2415,9 +2416,6 @@
// Recursively populate clone (susceptible to call stack limits).
assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
});
if (!isFull) {
stack['delete'](value);
}
return result;
}
@@ -5009,15 +5007,14 @@
end = step = undefined;
}
// Ensure the sign of `-0` is preserved.
start = toNumber(start);
start = start === start ? start : 0;
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toNumber(end) || 0;
end = toFinite(end);
}
step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);
step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
return baseRange(start, end, step, fromRight);
};
}
@@ -5290,6 +5287,7 @@
}
}
stack['delete'](array);
stack['delete'](other);
return result;
}
@@ -5450,6 +5448,7 @@
}
}
stack['delete'](object);
stack['delete'](other);
return result;
}
@@ -5625,7 +5624,7 @@
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? getSymbols : function(object) {
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
@@ -5863,7 +5862,7 @@
*/
function isFlattenable(value) {
return isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol])
!!(spreadableSymbol && value && value[spreadableSymbol]);
}
/**
@@ -6216,8 +6215,13 @@
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoize(function(string) {
string = toString(string);
var result = [];
toString(string).replace(rePropName, function(match, number, quote, string) {
if (reLeadingDot.test(string)) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
@@ -9779,14 +9783,18 @@
* milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide an options object to indicate whether `func` should be invoked on
* the leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent calls
* to the debounced function return the result of the last `func` invocation.
* Provide `options` to indicate whether `func` should be invoked on the
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent
* calls to the debounced function return the result of the last `func`
* invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the debounced function is
* invoked more than once during the `wait` timeout.
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the debounced function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.debounce` and `_.throttle`.
@@ -10374,8 +10382,8 @@
* Creates a throttled function that only invokes `func` at most once per
* every `wait` milliseconds. The throttled function comes with a `cancel`
* method to cancel delayed `func` invocations and a `flush` method to
* immediately invoke them. Provide an options object to indicate whether
* `func` should be invoked on the leading and/or trailing edge of the `wait`
* immediately invoke them. Provide `options` to indicate whether `func`
* should be invoked on the leading and/or trailing edge of the `wait`
* timeout. The `func` is invoked with the last arguments provided to the
* throttled function. Subsequent calls to the throttled function return the
* result of the last `func` invocation.
@@ -10384,6 +10392,9 @@
* invoked on the trailing edge of the timeout only if the throttled function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.throttle` and `_.debounce`.
*
@@ -10638,9 +10649,11 @@
}
/**
* Checks if `object` conforms to `source` by invoking the predicate properties
* of `source` with the corresponding property values of `object`. This method
* is equivalent to a `_.conforms` function when `source` is partially applied.
* Checks if `object` conforms to `source` by invoking the predicate
* properties of `source` with the corresponding property values of `object`.
*
* **Note:** This method is equivalent to `_.conforms` when `source` is
* partially applied.
*
* @static
* @memberOf _
@@ -11308,10 +11321,10 @@
/**
* Performs a partial deep comparison between `object` and `source` to
* determine if `object` contains equivalent property values. This method is
* equivalent to a `_.matches` function when `source` is partially applied.
* determine if `object` contains equivalent property values.
*
* **Note:** This method supports comparing the same values as `_.isEqual`.
* **Note:** This method supports comparing the same values as `_.isEqual`
* and is equivalent to `_.matches` when `source` is partially applied.
*
* @static
* @memberOf _
@@ -13523,12 +13536,12 @@
* // => true
*/
function inRange(number, start, end) {
start = toNumber(start) || 0;
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toNumber(end) || 0;
end = toFinite(end);
}
number = toNumber(number);
return baseInRange(number, start, end);
@@ -13584,12 +13597,12 @@
upper = 1;
}
else {
lower = toNumber(lower) || 0;
lower = toFinite(lower);
if (upper === undefined) {
upper = lower;
lower = 0;
} else {
upper = toNumber(upper) || 0;
upper = toFinite(upper);
}
}
if (lower > upper) {
@@ -14836,6 +14849,9 @@
* the corresponding property values of a given object, returning `true` if
* all predicates return truthy, else `false`.
*
* **Note:** The created function is equivalent to `_.conformsTo` with
* `source` partially applied.
*
* @static
* @memberOf _
* @since 4.0.0
@@ -15021,10 +15037,10 @@
/**
* Creates a function that performs a partial deep comparison between a given
* object and `source`, returning `true` if the given object has equivalent
* property values, else `false`. The created function is equivalent to
* `_.isMatch` with a `source` partially applied.
* property values, else `false`.
*
* **Note:** This method supports comparing the same values as `_.isEqual`.
* **Note:** The created function supports comparing the same values as
* `_.isEqual` is equivalent to `_.isMatch` with `source` partially applied.
*
* @static
* @memberOf _

View File

@@ -3,10 +3,10 @@ define(['./_baseClone', './_baseMatches'], function(baseClone, baseMatches) {
/**
* Creates a function that performs a partial deep comparison between a given
* object and `source`, returning `true` if the given object has equivalent
* property values, else `false`. The created function is equivalent to
* `_.isMatch` with a `source` partially applied.
* property values, else `false`.
*
* **Note:** This method supports comparing the same values as `_.isEqual`.
* **Note:** The created function supports comparing the same values as
* `_.isEqual` is equivalent to `_.isMatch` with `source` partially applied.
*
* @static
* @memberOf _

View File

@@ -1,6 +1,6 @@
{
"name": "lodash-amd",
"version": "4.14.0",
"version": "4.14.1",
"description": "Lodash exported as AMD modules.",
"keywords": "amd, modules, stdlib, util",
"homepage": "https://lodash.com/custom-builds",

View File

@@ -1,4 +1,4 @@
define(['./_baseRandom', './_isIterateeCall', './toNumber'], function(baseRandom, isIterateeCall, toNumber) {
define(['./_baseRandom', './_isIterateeCall', './toFinite'], function(baseRandom, isIterateeCall, toFinite) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
@@ -60,12 +60,12 @@ define(['./_baseRandom', './_isIterateeCall', './toNumber'], function(baseRandom
upper = 1;
}
else {
lower = toNumber(lower) || 0;
lower = toFinite(lower);
if (upper === undefined) {
upper = lower;
lower = 0;
} else {
upper = toNumber(upper) || 0;
upper = toFinite(upper);
}
}
if (lower > upper) {

View File

@@ -7,8 +7,8 @@ define(['./debounce', './isObject'], function(debounce, isObject) {
* Creates a throttled function that only invokes `func` at most once per
* every `wait` milliseconds. The throttled function comes with a `cancel`
* method to cancel delayed `func` invocations and a `flush` method to
* immediately invoke them. Provide an options object to indicate whether
* `func` should be invoked on the leading and/or trailing edge of the `wait`
* immediately invoke them. Provide `options` to indicate whether `func`
* should be invoked on the leading and/or trailing edge of the `wait`
* timeout. The `func` is invoked with the last arguments provided to the
* throttled function. Subsequent calls to the throttled function return the
* result of the last `func` invocation.
@@ -17,6 +17,9 @@ define(['./debounce', './isObject'], function(debounce, isObject) {
* invoked on the trailing edge of the timeout only if the throttled function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.throttle` and `_.debounce`.
*