diff --git a/README.md b/README.md index dab4a6fe6..372d2e0f0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lodash-amd v4.8.2 +# lodash-amd v4.9.0 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.8.2-amd) for more details. +See the [package source](https://github.com/lodash/lodash/tree/4.9.0-amd) for more details. diff --git a/_Hash.js b/_Hash.js index b773cb614..09075f2f2 100644 --- a/_Hash.js +++ b/_Hash.js @@ -4,7 +4,7 @@ define(['./_nativeCreate'], function(nativeCreate) { var objectProto = Object.prototype; /** - * Creates an hash object. + * Creates a hash object. * * @private * @constructor diff --git a/_baseFlatten.js b/_baseFlatten.js index 8488c552a..77a83378d 100644 --- a/_baseFlatten.js +++ b/_baseFlatten.js @@ -1,4 +1,4 @@ -define(['./_arrayPush', './isArguments', './isArray', './isArrayLikeObject'], function(arrayPush, isArguments, isArray, isArrayLikeObject) { +define(['./_arrayPush', './_isFlattenable'], function(arrayPush, isFlattenable) { /** * The base implementation of `_.flatten` with support for restricting flattening. @@ -6,23 +6,24 @@ define(['./_arrayPush', './isArguments', './isArray', './isArrayLikeObject'], fu * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. - * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ - function baseFlatten(array, depth, isStrict, result) { - result || (result = []); - + function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; + predicate || (predicate = isFlattenable); + result || (result = []); + while (++index < length) { var value = array[index]; - if (depth > 0 && isArrayLikeObject(value) && - (isStrict || isArray(value) || isArguments(value))) { + if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, isStrict, result); + baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } diff --git a/_createOver.js b/_createOver.js index ca834ba30..1b817838d 100644 --- a/_createOver.js +++ b/_createOver.js @@ -1,4 +1,4 @@ -define(['./_apply', './_arrayMap', './_baseFlatten', './_baseIteratee', './rest'], function(apply, arrayMap, baseFlatten, baseIteratee, rest) { +define(['./_apply', './_arrayMap', './_baseFlatten', './_baseIteratee', './_isFlattenableIteratee', './rest'], function(apply, arrayMap, baseFlatten, baseIteratee, isFlattenableIteratee, rest) { /** * Creates a function like `_.over`. @@ -9,7 +9,7 @@ define(['./_apply', './_arrayMap', './_baseFlatten', './_baseIteratee', './rest' */ function createOver(arrayFunc) { return rest(function(iteratees) { - iteratees = arrayMap(baseFlatten(iteratees, 1), baseIteratee); + iteratees = arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), baseIteratee); return rest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee) { diff --git a/_getTag.js b/_getTag.js index 4ba142f0a..872e4f8ea 100644 --- a/_getTag.js +++ b/_getTag.js @@ -1,5 +1,8 @@ define(['./_DataView', './_Map', './_Promise', './_Set', './_WeakMap', './_toSource'], function(DataView, Map, Promise, Set, WeakMap, toSource) { + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + /** `Object#toString` result references. */ var mapTag = '[object Map]', objectTag = '[object Object]', @@ -46,8 +49,8 @@ define(['./_DataView', './_Map', './_Promise', './_Set', './_WeakMap', './_toSou (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : null, - ctorString = toSource(Ctor); + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; if (ctorString) { switch (ctorString) { diff --git a/_isFlattenable.js b/_isFlattenable.js new file mode 100644 index 000000000..e04aeb6f0 --- /dev/null +++ b/_isFlattenable.js @@ -0,0 +1,15 @@ +define(['./isArguments', './isArray', './isArrayLikeObject'], function(isArguments, isArray, isArrayLikeObject) { + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArrayLikeObject(value) && (isArray(value) || isArguments(value)); + } + + return isFlattenable; +}); diff --git a/_isFlattenableIteratee.js b/_isFlattenableIteratee.js new file mode 100644 index 000000000..7390271f3 --- /dev/null +++ b/_isFlattenableIteratee.js @@ -0,0 +1,16 @@ +define(['./isArray', './isFunction'], function(isArray, isFunction) { + + /** + * Checks if `value` is a flattenable array and not a `_.matchesProperty` + * iteratee shorthand. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenableIteratee(value) { + return isArray(value) && !(value.length == 2 && !isFunction(value[0])); + } + + return isFlattenableIteratee; +}); diff --git a/_toSource.js b/_toSource.js index a7c389282..1560ba83d 100644 --- a/_toSource.js +++ b/_toSource.js @@ -1,4 +1,4 @@ -define(['./isFunction', './toString'], function(isFunction, toString) { +define([], function() { /** Used to resolve the decompiled source of functions. */ var funcToString = Function.prototype.toString; @@ -11,12 +11,15 @@ define(['./isFunction', './toString'], function(isFunction, toString) { * @returns {string} Returns the source code. */ function toSource(func) { - if (isFunction(func)) { + if (func != null) { try { return funcToString.call(func); } catch (e) {} + try { + return (func + ''); + } catch (e) {} } - return toString(func); + return ''; } return toSource; diff --git a/assignInWith.js b/assignInWith.js index 7ad9d0c0d..0ff470621 100644 --- a/assignInWith.js +++ b/assignInWith.js @@ -3,7 +3,7 @@ define(['./_copyObjectWith', './_createAssigner', './keysIn'], function(copyObje /** * This method is like `_.assignIn` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns - * `undefined` assignment is handled by the method instead. The `customizer` + * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. diff --git a/assignWith.js b/assignWith.js index 8cf2170a1..5cb9fa092 100644 --- a/assignWith.js +++ b/assignWith.js @@ -3,7 +3,7 @@ define(['./_copyObjectWith', './_createAssigner', './keys'], function(copyObject /** * This method is like `_.assign` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns - * `undefined` assignment is handled by the method instead. The `customizer` + * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. diff --git a/cloneWith.js b/cloneWith.js index 512869e85..f84f1a35a 100644 --- a/cloneWith.js +++ b/cloneWith.js @@ -2,7 +2,7 @@ define(['./_baseClone'], function(baseClone) { /** * This method is like `_.clone` except that it accepts `customizer` which - * is invoked to produce the cloned value. If `customizer` returns `undefined` + * is invoked to produce the cloned value. If `customizer` returns `undefined`, * cloning is handled by the method instead. The `customizer` is invoked with * up to four arguments; (value [, index|key, object, stack]). * diff --git a/create.js b/create.js index bc2abec36..c51eeef74 100644 --- a/create.js +++ b/create.js @@ -2,7 +2,7 @@ define(['./_baseAssign', './_baseCreate'], function(baseAssign, baseCreate) { /** * Creates an object that inherits from the `prototype` object. If a - * `properties` object is given its own enumerable string keyed properties + * `properties` object is given, its own enumerable string keyed properties * are assigned to the created object. * * @static diff --git a/debounce.js b/debounce.js index f250113f5..3bafaeb82 100644 --- a/debounce.js +++ b/debounce.js @@ -24,7 +24,7 @@ define(['./isObject', './now', './toNumber'], function(isObject, now, toNumber) * on the trailing edge of the timeout only if the debounced function is * invoked more than once during the `wait` timeout. * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.debounce` and `_.throttle`. * * @static diff --git a/difference.js b/difference.js index 0f9298fd7..90e09c7cb 100644 --- a/difference.js +++ b/difference.js @@ -20,7 +20,7 @@ define(['./_baseDifference', './_baseFlatten', './isArrayLikeObject', './rest'], */ var difference = rest(function(array, values) { return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, true)) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; }); diff --git a/differenceBy.js b/differenceBy.js index 96d8efab4..9b0e9f4d6 100644 --- a/differenceBy.js +++ b/differenceBy.js @@ -33,7 +33,7 @@ define(['./_baseDifference', './_baseFlatten', './_baseIteratee', './isArrayLike iteratee = undefined; } return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, true), baseIteratee(iteratee)) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee)) : []; }); diff --git a/differenceWith.js b/differenceWith.js index ba68aa3c0..6ce42902e 100644 --- a/differenceWith.js +++ b/differenceWith.js @@ -30,7 +30,7 @@ define(['./_baseDifference', './_baseFlatten', './isArrayLikeObject', './last', comparator = undefined; } return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, true), undefined, comparator) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : []; }); diff --git a/get.js b/get.js index cb3c64c73..18dd1cc43 100644 --- a/get.js +++ b/get.js @@ -5,7 +5,7 @@ define(['./_baseGet'], function(baseGet) { /** * Gets the value at `path` of `object`. If the resolved value is - * `undefined` the `defaultValue` is used in its place. + * `undefined`, the `defaultValue` is used in its place. * * @static * @memberOf _ diff --git a/groupBy.js b/groupBy.js index a8b08256c..ea76ce3f2 100644 --- a/groupBy.js +++ b/groupBy.js @@ -8,9 +8,10 @@ define(['./_createAggregator'], function(createAggregator) { /** * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is an array of elements responsible for generating the key. The - * iteratee is invoked with one argument: (value). + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ diff --git a/has.js b/has.js index 5575cf8cf..7855e7253 100644 --- a/has.js +++ b/has.js @@ -12,16 +12,16 @@ define(['./_baseHas', './_hasPath'], function(baseHas, hasPath) { * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * - * _.has(object, 'a.b.c'); + * _.has(object, 'a.b'); * // => true * - * _.has(object, ['a', 'b', 'c']); + * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); diff --git a/hasIn.js b/hasIn.js index 90b6952d6..b46ba2a2e 100644 --- a/hasIn.js +++ b/hasIn.js @@ -12,15 +12,15 @@ define(['./_baseHasIn', './_hasPath'], function(baseHasIn, hasPath) { * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * - * _.hasIn(object, 'a.b.c'); + * _.hasIn(object, 'a.b'); * // => true * - * _.hasIn(object, ['a', 'b', 'c']); + * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); diff --git a/inRange.js b/inRange.js index cb4ddf280..be6c625c2 100644 --- a/inRange.js +++ b/inRange.js @@ -5,7 +5,7 @@ define(['./_baseInRange', './toNumber'], function(baseInRange, toNumber) { /** * Checks if `n` is between `start` and up to but not including, `end`. If - * `end` is not specified it's set to `start` with `start` then set to `0`. + * `end` is not specified, it's set to `start` with `start` then set to `0`. * If `start` is greater than `end` the params are swapped to support * negative ranges. * diff --git a/includes.js b/includes.js index 2af31fbd8..4beac82e6 100644 --- a/includes.js +++ b/includes.js @@ -4,7 +4,7 @@ define(['./_baseIndexOf', './isArrayLike', './isString', './toInteger', './value var nativeMax = Math.max; /** - * Checks if `value` is in `collection`. If `collection` is a string it's + * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as diff --git a/indexOf.js b/indexOf.js index 349faf175..2da5031b9 100644 --- a/indexOf.js +++ b/indexOf.js @@ -6,8 +6,8 @@ define(['./_baseIndexOf', './toInteger'], function(baseIndexOf, toInteger) { /** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. * * @static * @memberOf _ diff --git a/invokeMap.js b/invokeMap.js index 69aecab21..5cc83c8f3 100644 --- a/invokeMap.js +++ b/invokeMap.js @@ -6,8 +6,8 @@ define(['./_apply', './_baseEach', './_baseInvoke', './isArrayLike', './_isKey', /** * Invokes the method at `path` of each element in `collection`, returning * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function it's - * invoked for, and `this` bound to, each element in `collection`. + * are provided to each invoked method. If `methodName` is a function, it's + * invoked for and `this` bound to, each element in `collection`. * * @static * @memberOf _ diff --git a/isEqualWith.js b/isEqualWith.js index 1e55e2f32..c4c3a07de 100644 --- a/isEqualWith.js +++ b/isEqualWith.js @@ -5,7 +5,7 @@ define(['./_baseIsEqual'], function(baseIsEqual) { /** * This method is like `_.isEqual` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons + * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with up to * six arguments: (objValue, othValue [, index|key, object, other, stack]). * diff --git a/isMatchWith.js b/isMatchWith.js index 8a9a6480e..48849f450 100644 --- a/isMatchWith.js +++ b/isMatchWith.js @@ -5,7 +5,7 @@ define(['./_baseIsMatch', './_getMatchData'], function(baseIsMatch, getMatchData /** * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons + * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with five * arguments: (objValue, srcValue, index|key, object, source). * diff --git a/iteratee.js b/iteratee.js index b3a8b3d26..1acae35b3 100644 --- a/iteratee.js +++ b/iteratee.js @@ -2,8 +2,8 @@ define(['./_baseClone', './_baseIteratee'], function(baseClone, baseIteratee) { /** * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created function returns the - * property value for a given element. If `func` is an array or object the + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the * created function returns `true` for elements that contain the equivalent * source properties, otherwise it returns `false`. * diff --git a/main.js b/main.js index 62f381b0c..faae1d357 100644 --- a/main.js +++ b/main.js @@ -1,6 +1,6 @@ /** * @license - * lodash 4.8.2 (Custom Build) + * lodash 4.9.0 (Custom Build) * Build: `lodash exports="amd" -d -o ./main.js` * Copyright jQuery Foundation and other contributors * Released under MIT license @@ -13,7 +13,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.8.2'; + var VERSION = '4.9.0'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; @@ -1488,9 +1488,9 @@ * Shortcut fusion is an optimization to merge iteratee calls; this avoids * the creation of intermediate arrays and can greatly reduce the number of * iteratee executions. Sections of a chain sequence qualify for shortcut - * fusion if the section is applied to an array of at least two hundred - * elements and any iteratees accept only one argument. The heuristic for - * whether a section qualifies for shortcut fusion is subject to change. + * fusion if the section is applied to an array of at least `200` elements + * and any iteratees accept only one argument. The heuristic for whether a + * section qualifies for shortcut fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build. @@ -1812,7 +1812,7 @@ /*------------------------------------------------------------------------*/ /** - * Creates an hash object. + * Creates a hash object. * * @private * @constructor @@ -2701,23 +2701,24 @@ * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. - * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ - function baseFlatten(array, depth, isStrict, result) { - result || (result = []); - + function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; + predicate || (predicate = isFlattenable); + result || (result = []); + while (++index < length) { var value = array[index]; - if (depth > 0 && isArrayLikeObject(value) && - (isStrict || isArray(value) || isArguments(value))) { + if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, isStrict, result); + baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } @@ -4609,7 +4610,7 @@ */ function createOver(arrayFunc) { return rest(function(iteratees) { - iteratees = arrayMap(baseFlatten(iteratees, 1), getIteratee()); + iteratees = arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), getIteratee()); return rest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee) { @@ -5152,10 +5153,10 @@ } /** - * Gets the appropriate "iteratee" function. If the `_.iteratee` method is - * customized this function returns the custom method, otherwise it returns - * `baseIteratee`. If arguments are provided, the chosen function is invoked - * with them and its result is returned. + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. * * @private * @param {*} [value] The value to convert to an iteratee. @@ -5291,8 +5292,8 @@ (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : null, - ctorString = toSource(Ctor); + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; if (ctorString) { switch (ctorString) { @@ -5464,6 +5465,29 @@ return null; } + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArrayLikeObject(value) && (isArray(value) || isArguments(value)); + } + + /** + * Checks if `value` is a flattenable array and not a `_.matchesProperty` + * iteratee shorthand. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenableIteratee(value) { + return isArray(value) && !(value.length == 2 && !isFunction(value[0])); + } + /** * Checks if the given arguments are from an iteratee call. * @@ -5768,12 +5792,15 @@ * @returns {string} Returns the source code. */ function toSource(func) { - if (isFunction(func)) { + if (func != null) { try { return funcToString.call(func); } catch (e) {} + try { + return (func + ''); + } catch (e) {} } - return toString(func); + return ''; } /** @@ -5923,7 +5950,7 @@ */ var difference = rest(function(array, values) { return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, true)) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; }); @@ -5957,7 +5984,7 @@ iteratee = undefined; } return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, true), getIteratee(iteratee)) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee)) : []; }); @@ -5988,7 +6015,7 @@ comparator = undefined; } return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, true), undefined, comparator) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : []; }); @@ -6387,8 +6414,8 @@ /** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. * * @static * @memberOf _ @@ -7254,7 +7281,7 @@ * // => [2, 1, 4] */ var union = rest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, true)); + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); /** @@ -7285,7 +7312,7 @@ if (isArrayLikeObject(iteratee)) { iteratee = undefined; } - return baseUniq(baseFlatten(arrays, 1, true), getIteratee(iteratee)); + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee)); }); /** @@ -7313,7 +7340,7 @@ if (isArrayLikeObject(comparator)) { comparator = undefined; } - return baseUniq(baseFlatten(arrays, 1, true), undefined, comparator); + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); }); /** @@ -8326,9 +8353,10 @@ /** * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is an array of elements responsible for generating the key. The - * iteratee is invoked with one argument: (value). + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ @@ -8356,7 +8384,7 @@ }); /** - * Checks if `value` is in `collection`. If `collection` is a string it's + * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as @@ -8401,8 +8429,8 @@ /** * Invokes the method at `path` of each element in `collection`, returning * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function it's - * invoked for, and `this` bound to, each element in `collection`. + * are provided to each invoked method. If `methodName` is a function, it's + * invoked for and `this` bound to, each element in `collection`. * * @static * @memberOf _ @@ -8603,7 +8631,7 @@ * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` - * is not given the first element of `collection` is used as the initial + * is not given, the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * @@ -9246,7 +9274,7 @@ * on the trailing edge of the timeout only if the debounced function is * invoked more than once during the `wait` timeout. * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.debounce` and `_.throttle`. * * @static @@ -9468,7 +9496,7 @@ /** * Creates a function that memoizes the result of `func`. If `resolver` is - * provided it determines the cache key for storing the result based on the + * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. @@ -9617,8 +9645,7 @@ * // => [100, 10] */ var overArgs = rest(function(func, transforms) { - transforms = arrayMap(baseFlatten(transforms, 1), getIteratee()); - + transforms = arrayMap(baseFlatten(transforms, 1, isFlattenableIteratee), getIteratee()); var funcsLength = transforms.length; return rest(function(args) { var index = -1, @@ -9851,7 +9878,7 @@ * invoked on the trailing edge of the timeout only if the throttled function * is invoked more than once during the `wait` timeout. * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.throttle` and `_.debounce`. * * @static @@ -10016,7 +10043,7 @@ /** * This method is like `_.clone` except that it accepts `customizer` which - * is invoked to produce the cloned value. If `customizer` returns `undefined` + * is invoked to produce the cloned value. If `customizer` returns `undefined`, * cloning is handled by the method instead. The `customizer` is invoked with * up to four arguments; (value [, index|key, object, stack]). * @@ -10495,7 +10522,7 @@ /** * This method is like `_.isEqual` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons + * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with up to * six arguments: (objValue, othValue [, index|key, object, other, stack]). * @@ -10788,7 +10815,7 @@ /** * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons + * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with five * arguments: (objValue, srcValue, index|key, object, source). * @@ -11599,7 +11626,7 @@ /** * This method is like `_.assignIn` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns - * `undefined` assignment is handled by the method instead. The `customizer` + * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. @@ -11631,7 +11658,7 @@ /** * This method is like `_.assign` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns - * `undefined` assignment is handled by the method instead. The `customizer` + * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. @@ -11686,7 +11713,7 @@ /** * Creates an object that inherits from the `prototype` object. If a - * `properties` object is given its own enumerable string keyed properties + * `properties` object is given, its own enumerable string keyed properties * are assigned to the created object. * * @static @@ -12030,7 +12057,7 @@ /** * Gets the value at `path` of `object`. If the resolved value is - * `undefined` the `defaultValue` is used in its place. + * `undefined`, the `defaultValue` is used in its place. * * @static * @memberOf _ @@ -12070,16 +12097,16 @@ * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * - * _.has(object, 'a.b.c'); + * _.has(object, 'a.b'); * // => true * - * _.has(object, ['a', 'b', 'c']); + * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); @@ -12101,15 +12128,15 @@ * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * - * _.hasIn(object, 'a.b.c'); + * _.hasIn(object, 'a.b'); * // => true * - * _.hasIn(object, ['a', 'b', 'c']); + * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); @@ -12394,7 +12421,7 @@ /** * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the + * properties. If `customizer` returns `undefined`, merging is handled by the * method instead. The `customizer` is invoked with seven arguments: * (objValue, srcValue, key, object, source, stack). * @@ -12586,7 +12613,7 @@ } /** - * Sets the value at `path` of `object`. If a portion of `path` doesn't exist + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, * it's created. Arrays are created for missing index properties while objects * are created for all other missing properties. Use `_.setWith` to customize * `path` creation. @@ -12939,7 +12966,7 @@ /** * Checks if `n` is between `start` and up to but not including, `end`. If - * `end` is not specified it's set to `start` with `start` then set to `0`. + * `end` is not specified, it's set to `start` with `start` then set to `0`. * If `start` is greater than `end` the params are swapped to support * negative ranges. * @@ -13534,7 +13561,18 @@ * // => ['a', 'b'] */ function split(string, separator, limit) { - return toString(string).split(separator, limit); + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator += ''; + if (separator == '' && reHasComplexSymbol.test(string)) { + var strSymbols = stringToArray(string); + return limit === undefined ? strSymbols : strSymbols.slice(0, limit < 0 ? 0 : limit); + } + } + return string.split(separator, limit); } /** @@ -13596,7 +13634,7 @@ * in "interpolate" delimiters, HTML-escape interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * properties may be accessed as free variables in the template. If a setting - * object is given it takes precedence over `_.templateSettings` values. + * object is given, it takes precedence over `_.templateSettings` values. * * **Note:** In the development build `_.template` utilizes * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) @@ -14391,8 +14429,8 @@ /** * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created function returns the - * property value for a given element. If `func` is an array or object the + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the * created function returns `true` for elements that contain the equivalent * source properties, otherwise it returns `false`. * @@ -14505,14 +14543,14 @@ * @example * * var objects = [ - * { 'a': { 'b': { 'c': _.constant(2) } } }, - * { 'a': { 'b': { 'c': _.constant(1) } } } + * { 'a': { 'b': _.constant(2) } }, + * { 'a': { 'b': _.constant(1) } } * ]; * - * _.map(objects, _.method('a.b.c')); + * _.map(objects, _.method('a.b')); * // => [2, 1] * - * _.map(objects, _.method(['a', 'b', 'c'])); + * _.map(objects, _.method(['a', 'b'])); * // => [2, 1] */ var method = rest(function(path, args) { @@ -14552,7 +14590,7 @@ /** * Adds all own enumerable string keyed function properties of a source - * object to the destination object. If `object` is a function then methods + * object to the destination object. If `object` is a function, then methods * are added to its prototype as well. * * **Note:** Use `_.runInContext` to create a pristine `lodash` function to @@ -14765,14 +14803,14 @@ * @example * * var objects = [ - * { 'a': { 'b': { 'c': 2 } } }, - * { 'a': { 'b': { 'c': 1 } } } + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } * ]; * - * _.map(objects, _.property('a.b.c')); + * _.map(objects, _.property('a.b')); * // => [2, 1] * - * _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); * // => [1, 2] */ function property(path) { @@ -14809,7 +14847,7 @@ /** * Creates an array of numbers (positive and/or negative) progressing from * `start` up to, but not including, `end`. A step of `-1` is used if a negative - * `start` is specified without an `end` or `step`. If `end` is not specified + * `start` is specified without an `end` or `step`. If `end` is not specified, * it's set to `start` with `start` then set to `0`. * * **Note:** JavaScript follows the IEEE-754 standard for resolving @@ -14956,7 +14994,7 @@ } /** - * Generates a unique ID. If `prefix` is given the ID is appended to it. + * Generates a unique ID. If `prefix` is given, the ID is appended to it. * * @static * @since 0.1.0 @@ -15064,7 +15102,7 @@ var floor = createRound('floor'); /** - * Computes the maximum value of `array`. If `array` is empty or falsey + * Computes the maximum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static @@ -15164,7 +15202,7 @@ } /** - * Computes the minimum value of `array`. If `array` is empty or falsey + * Computes the minimum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static diff --git a/max.js b/max.js index 06c792c37..f0d7579db 100644 --- a/max.js +++ b/max.js @@ -4,7 +4,7 @@ define(['./_baseExtremum', './gt', './identity'], function(baseExtremum, gt, ide var undefined; /** - * Computes the maximum value of `array`. If `array` is empty or falsey + * Computes the maximum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static diff --git a/memoize.js b/memoize.js index b21a9757d..299354007 100644 --- a/memoize.js +++ b/memoize.js @@ -5,7 +5,7 @@ define(['./_MapCache'], function(MapCache) { /** * Creates a function that memoizes the result of `func`. If `resolver` is - * provided it determines the cache key for storing the result based on the + * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. diff --git a/mergeWith.js b/mergeWith.js index df7b6a3d5..5c3470fd8 100644 --- a/mergeWith.js +++ b/mergeWith.js @@ -3,7 +3,7 @@ define(['./_baseMerge', './_createAssigner'], function(baseMerge, createAssigner /** * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the + * properties. If `customizer` returns `undefined`, merging is handled by the * method instead. The `customizer` is invoked with seven arguments: * (objValue, srcValue, key, object, source, stack). * diff --git a/method.js b/method.js index 84a87e506..79bac64a9 100644 --- a/method.js +++ b/method.js @@ -14,14 +14,14 @@ define(['./_baseInvoke', './rest'], function(baseInvoke, rest) { * @example * * var objects = [ - * { 'a': { 'b': { 'c': _.constant(2) } } }, - * { 'a': { 'b': { 'c': _.constant(1) } } } + * { 'a': { 'b': _.constant(2) } }, + * { 'a': { 'b': _.constant(1) } } * ]; * - * _.map(objects, _.method('a.b.c')); + * _.map(objects, _.method('a.b')); * // => [2, 1] * - * _.map(objects, _.method(['a', 'b', 'c'])); + * _.map(objects, _.method(['a', 'b'])); * // => [2, 1] */ var method = rest(function(path, args) { diff --git a/min.js b/min.js index 6f30e4cb4..f6722baed 100644 --- a/min.js +++ b/min.js @@ -4,7 +4,7 @@ define(['./_baseExtremum', './identity', './lt'], function(baseExtremum, identit var undefined; /** - * Computes the minimum value of `array`. If `array` is empty or falsey + * Computes the minimum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static diff --git a/mixin.js b/mixin.js index c1903aa91..7e54a7ff6 100644 --- a/mixin.js +++ b/mixin.js @@ -2,7 +2,7 @@ define(['./_arrayEach', './_arrayPush', './_baseFunctions', './_copyArray', './i /** * Adds all own enumerable string keyed function properties of a source - * object to the destination object. If `object` is a function then methods + * object to the destination object. If `object` is a function, then methods * are added to its prototype as well. * * **Note:** Use `_.runInContext` to create a pristine `lodash` function to diff --git a/overArgs.js b/overArgs.js index 308998de5..14f6e7d77 100644 --- a/overArgs.js +++ b/overArgs.js @@ -1,4 +1,4 @@ -define(['./_apply', './_arrayMap', './_baseFlatten', './_baseIteratee', './rest'], function(apply, arrayMap, baseFlatten, baseIteratee, rest) { +define(['./_apply', './_arrayMap', './_baseFlatten', './_baseIteratee', './_isFlattenableIteratee', './rest'], function(apply, arrayMap, baseFlatten, baseIteratee, isFlattenableIteratee, rest) { /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMin = Math.min; @@ -36,8 +36,7 @@ define(['./_apply', './_arrayMap', './_baseFlatten', './_baseIteratee', './rest' * // => [100, 10] */ var overArgs = rest(function(func, transforms) { - transforms = arrayMap(baseFlatten(transforms, 1), baseIteratee); - + transforms = arrayMap(baseFlatten(transforms, 1, isFlattenableIteratee), baseIteratee); var funcsLength = transforms.length; return rest(function(args) { var index = -1, diff --git a/package.json b/package.json index 93c03682a..6d2c90ccd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lodash-amd", - "version": "4.8.2", + "version": "4.9.0", "description": "Lodash exported as AMD modules.", "homepage": "https://lodash.com/custom-builds", "license": "MIT", diff --git a/property.js b/property.js index 0e7f36744..7a433dad8 100644 --- a/property.js +++ b/property.js @@ -12,14 +12,14 @@ define(['./_baseProperty', './_basePropertyDeep', './_isKey'], function(baseProp * @example * * var objects = [ - * { 'a': { 'b': { 'c': 2 } } }, - * { 'a': { 'b': { 'c': 1 } } } + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } * ]; * - * _.map(objects, _.property('a.b.c')); + * _.map(objects, _.property('a.b')); * // => [2, 1] * - * _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); * // => [1, 2] */ function property(path) { diff --git a/range.js b/range.js index d2957bbcf..1637f2ea2 100644 --- a/range.js +++ b/range.js @@ -3,7 +3,7 @@ define(['./_createRange'], function(createRange) { /** * Creates an array of numbers (positive and/or negative) progressing from * `start` up to, but not including, `end`. A step of `-1` is used if a negative - * `start` is specified without an `end` or `step`. If `end` is not specified + * `start` is specified without an `end` or `step`. If `end` is not specified, * it's set to `start` with `start` then set to `0`. * * **Note:** JavaScript follows the IEEE-754 standard for resolving diff --git a/reduce.js b/reduce.js index 072a7c834..f4b00e35a 100644 --- a/reduce.js +++ b/reduce.js @@ -4,7 +4,7 @@ define(['./_arrayReduce', './_baseEach', './_baseIteratee', './_baseReduce', './ * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` - * is not given the first element of `collection` is used as the initial + * is not given, the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * diff --git a/set.js b/set.js index 35bc6dc3b..f1c1ca53f 100644 --- a/set.js +++ b/set.js @@ -1,7 +1,7 @@ define(['./_baseSet'], function(baseSet) { /** - * Sets the value at `path` of `object`. If a portion of `path` doesn't exist + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, * it's created. Arrays are created for missing index properties while objects * are created for all other missing properties. Use `_.setWith` to customize * `path` creation. diff --git a/split.js b/split.js index d831fe06d..59cd3f172 100644 --- a/split.js +++ b/split.js @@ -1,4 +1,19 @@ -define(['./toString'], function(toString) { +define(['./isRegExp', './_stringToArray', './toString'], function(isRegExp, stringToArray, toString) { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsVarRange = '\\ufe0e\\ufe0f'; + + /** Used to compose unicode capture groups. */ + var rsZWJ = '\\u200d'; + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); /** * Splits `string` by `separator`. @@ -20,7 +35,18 @@ define(['./toString'], function(toString) { * // => ['a', 'b'] */ function split(string, separator, limit) { - return toString(string).split(separator, limit); + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator += ''; + if (separator == '' && reHasComplexSymbol.test(string)) { + var strSymbols = stringToArray(string); + return limit === undefined ? strSymbols : strSymbols.slice(0, limit < 0 ? 0 : limit); + } + } + return string.split(separator, limit); } return split; diff --git a/template.js b/template.js index 65591f90c..0ca5d3bfd 100644 --- a/template.js +++ b/template.js @@ -25,7 +25,7 @@ define(['./_assignInDefaults', './assignInWith', './attempt', './_baseValues', ' * in "interpolate" delimiters, HTML-escape interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * properties may be accessed as free variables in the template. If a setting - * object is given it takes precedence over `_.templateSettings` values. + * object is given, it takes precedence over `_.templateSettings` values. * * **Note:** In the development build `_.template` utilizes * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) diff --git a/throttle.js b/throttle.js index a63e41b9f..d49e00016 100644 --- a/throttle.js +++ b/throttle.js @@ -17,7 +17,7 @@ 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. * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.throttle` and `_.debounce`. * * @static diff --git a/union.js b/union.js index db26f604b..bcaa37782 100644 --- a/union.js +++ b/union.js @@ -1,4 +1,4 @@ -define(['./_baseFlatten', './_baseUniq', './rest'], function(baseFlatten, baseUniq, rest) { +define(['./_baseFlatten', './_baseUniq', './isArrayLikeObject', './rest'], function(baseFlatten, baseUniq, isArrayLikeObject, rest) { /** * Creates an array of unique values, in order, from all given arrays using @@ -17,7 +17,7 @@ define(['./_baseFlatten', './_baseUniq', './rest'], function(baseFlatten, baseUn * // => [2, 1, 4] */ var union = rest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, true)); + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); return union; diff --git a/unionBy.js b/unionBy.js index 71eeafd29..180fad6b1 100644 --- a/unionBy.js +++ b/unionBy.js @@ -31,7 +31,7 @@ define(['./_baseFlatten', './_baseIteratee', './_baseUniq', './isArrayLikeObject if (isArrayLikeObject(iteratee)) { iteratee = undefined; } - return baseUniq(baseFlatten(arrays, 1, true), baseIteratee(iteratee)); + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), baseIteratee(iteratee)); }); return unionBy; diff --git a/unionWith.js b/unionWith.js index 76cf0e445..b40c85577 100644 --- a/unionWith.js +++ b/unionWith.js @@ -28,7 +28,7 @@ define(['./_baseFlatten', './_baseUniq', './isArrayLikeObject', './last', './res if (isArrayLikeObject(comparator)) { comparator = undefined; } - return baseUniq(baseFlatten(arrays, 1, true), undefined, comparator); + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); }); return unionWith; diff --git a/uniqueId.js b/uniqueId.js index e26abf6b9..c2950c739 100644 --- a/uniqueId.js +++ b/uniqueId.js @@ -4,7 +4,7 @@ define(['./toString'], function(toString) { var idCounter = 0; /** - * Generates a unique ID. If `prefix` is given the ID is appended to it. + * Generates a unique ID. If `prefix` is given, the ID is appended to it. * * @static * @since 0.1.0 diff --git a/wrapperLodash.js b/wrapperLodash.js index e4dda7814..31b3e9585 100644 --- a/wrapperLodash.js +++ b/wrapperLodash.js @@ -24,9 +24,9 @@ define(['./_LazyWrapper', './_LodashWrapper', './_baseLodash', './isArray', './i * Shortcut fusion is an optimization to merge iteratee calls; this avoids * the creation of intermediate arrays and can greatly reduce the number of * iteratee executions. Sections of a chain sequence qualify for shortcut - * fusion if the section is applied to an array of at least two hundred - * elements and any iteratees accept only one argument. The heuristic for - * whether a section qualifies for shortcut fusion is subject to change. + * fusion if the section is applied to an array of at least `200` elements + * and any iteratees accept only one argument. The heuristic for whether a + * section qualifies for shortcut fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build.