From cbf5cb1162eb2642b8321743cd0ea89ef4ffad6d Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 7 Aug 2016 21:23:34 -0700 Subject: [PATCH] Bump to v4.14.2. --- README.md | 4 ++-- _Reflect.js | 6 ------ _arrayLikeKeys.js | 38 ++++++++++++++++++++++++++++++++++++++ _assignValue.js | 2 +- _baseConformsTo.js | 9 ++++----- _baseDelay.js | 2 +- _baseGetTag.js | 2 +- _baseHas.js | 9 +-------- _baseIsArrayBuffer.js | 2 +- _baseIsDate.js | 2 +- _baseIsNative.js | 2 +- _baseIsRegExp.js | 2 +- _baseIsTypedArray.js | 2 +- _baseKeys.js | 26 ++++++++++++++++++++------ _baseKeysIn.js | 31 ++++++++++++++----------------- _baseMerge.js | 4 ++-- _baseSet.js | 26 ++++++++++++++------------ _baseUnset.js | 9 +++++++-- _createCtor.js | 2 +- _equalByTag.js | 2 +- _equalObjects.js | 9 +++++++-- _getLength.js | 16 ---------------- _getPrototype.js | 13 ++----------- _getTag.js | 2 +- _indexKeys.js | 24 ------------------------ _nativeKeys.js | 6 ++++++ _nativeKeysIn.js | 20 ++++++++++++++++++++ _overArg.js | 2 +- assignIn.js | 20 +------------------- difference.js | 2 +- eq.js | 2 +- escapeRegExp.js | 2 +- every.js | 5 +++++ includes.js | 2 +- indexOf.js | 2 +- initial.js | 5 +++-- intersection.js | 2 +- isArguments.js | 2 +- isArrayLike.js | 3 +-- isBoolean.js | 2 +- isElement.js | 3 +-- isEmpty.js | 9 ++++++--- isEqual.js | 3 +-- isEqualWith.js | 3 +-- isError.js | 5 ++--- isFinite.js | 3 +-- isFunction.js | 2 +- isLength.js | 7 +++---- isMatch.js | 8 ++++++-- isNumber.js | 2 +- isObject.js | 2 +- isPlainObject.js | 5 ++--- isSafeInteger.js | 3 +-- isString.js | 2 +- isSymbol.js | 2 +- isWeakSet.js | 2 +- keys.js | 25 +++---------------------- keysIn.js | 29 +++-------------------------- lodash.default.js | 2 +- matches.js | 8 ++++++-- matchesProperty.js | 4 +++- memoize.js | 2 +- now.js | 8 +++++--- package.json | 2 +- pull.js | 2 +- size.js | 4 ++-- spread.js | 2 +- tail.js | 5 +++-- template.js | 2 +- toInteger.js | 2 +- toLength.js | 2 +- union.js | 2 +- uniq.js | 2 +- without.js | 2 +- 74 files changed, 233 insertions(+), 256 deletions(-) delete mode 100644 _Reflect.js create mode 100644 _arrayLikeKeys.js delete mode 100644 _getLength.js delete mode 100644 _indexKeys.js create mode 100644 _nativeKeys.js create mode 100644 _nativeKeysIn.js diff --git a/README.md b/README.md index fab253ddd..784098aed 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lodash-es v4.14.1 +# lodash-es v4.14.2 The [Lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules. @@ -7,4 +7,4 @@ Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli): $ lodash modularize exports=es -o ./ ``` -See the [package source](https://github.com/lodash/lodash/tree/4.14.1-es) for more details. +See the [package source](https://github.com/lodash/lodash/tree/4.14.2-es) for more details. diff --git a/_Reflect.js b/_Reflect.js deleted file mode 100644 index 43c499a4b..000000000 --- a/_Reflect.js +++ /dev/null @@ -1,6 +0,0 @@ -import root from './_root.js'; - -/** Built-in value references. */ -var Reflect = root.Reflect; - -export default Reflect; diff --git a/_arrayLikeKeys.js b/_arrayLikeKeys.js new file mode 100644 index 000000000..16759b205 --- /dev/null +++ b/_arrayLikeKeys.js @@ -0,0 +1,38 @@ +import baseTimes from './_baseTimes.js'; +import isArguments from './isArguments.js'; +import isArray from './isArray.js'; +import isIndex from './_isIndex.js'; +import isString from './isString.js'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var result = (isArray(value) || isString(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +export default arrayLikeKeys; diff --git a/_assignValue.js b/_assignValue.js index f5c2443f5..9c2110b37 100644 --- a/_assignValue.js +++ b/_assignValue.js @@ -8,7 +8,7 @@ var hasOwnProperty = objectProto.hasOwnProperty; /** * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private diff --git a/_baseConformsTo.js b/_baseConformsTo.js index 3dc05d01f..3406ec5df 100644 --- a/_baseConformsTo.js +++ b/_baseConformsTo.js @@ -11,14 +11,13 @@ function baseConformsTo(object, source, props) { if (object == null) { return !length; } - var index = length; - while (index--) { - var key = props[index], + object = Object(object); + while (length--) { + var key = props[length], predicate = source[key], value = object[key]; - if ((value === undefined && - !(key in Object(object))) || !predicate(value)) { + if ((value === undefined && !(key in object)) || !predicate(value)) { return false; } } diff --git a/_baseDelay.js b/_baseDelay.js index 489835411..12f2fea53 100644 --- a/_baseDelay.js +++ b/_baseDelay.js @@ -9,7 +9,7 @@ var FUNC_ERROR_TEXT = 'Expected a function'; * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {Array} args The arguments to provide to `func`. - * @returns {number} Returns the timer id. + * @returns {number|Object} Returns the timer id or timeout object. */ function baseDelay(func, wait, args) { if (typeof func != 'function') { diff --git a/_baseGetTag.js b/_baseGetTag.js index 70211645c..2ca148557 100644 --- a/_baseGetTag.js +++ b/_baseGetTag.js @@ -3,7 +3,7 @@ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; diff --git a/_baseHas.js b/_baseHas.js index b26c103cb..edbbe5feb 100644 --- a/_baseHas.js +++ b/_baseHas.js @@ -1,5 +1,3 @@ -import getPrototype from './_getPrototype.js'; - /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -15,12 +13,7 @@ var hasOwnProperty = objectProto.hasOwnProperty; * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { - // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, - // that are composed entirely of index properties, return `false` for - // `hasOwnProperty` checks of them. - return object != null && - (hasOwnProperty.call(object, key) || - (typeof object == 'object' && key in object && getPrototype(object) === null)); + return object != null && hasOwnProperty.call(object, key); } export default baseHas; diff --git a/_baseIsArrayBuffer.js b/_baseIsArrayBuffer.js index 3903613ec..b7a84f119 100644 --- a/_baseIsArrayBuffer.js +++ b/_baseIsArrayBuffer.js @@ -7,7 +7,7 @@ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; diff --git a/_baseIsDate.js b/_baseIsDate.js index 6483d0527..f58ea3cb6 100644 --- a/_baseIsDate.js +++ b/_baseIsDate.js @@ -8,7 +8,7 @@ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; diff --git a/_baseIsNative.js b/_baseIsNative.js index eececaa8a..d41a99c5b 100644 --- a/_baseIsNative.js +++ b/_baseIsNative.js @@ -6,7 +6,7 @@ import toSource from './_toSource.js'; /** * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; diff --git a/_baseIsRegExp.js b/_baseIsRegExp.js index 3ce35c8f5..45e6ad90c 100644 --- a/_baseIsRegExp.js +++ b/_baseIsRegExp.js @@ -8,7 +8,7 @@ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; diff --git a/_baseIsTypedArray.js b/_baseIsTypedArray.js index 913dcb9a7..37e8193f1 100644 --- a/_baseIsTypedArray.js +++ b/_baseIsTypedArray.js @@ -49,7 +49,7 @@ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; diff --git a/_baseKeys.js b/_baseKeys.js index 913a2ecfb..5a7622490 100644 --- a/_baseKeys.js +++ b/_baseKeys.js @@ -1,16 +1,30 @@ -import overArg from './_overArg.js'; +import isPrototype from './_isPrototype.js'; +import nativeKeys from './_nativeKeys.js'; -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = Object.keys; +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * The base implementation of `_.keys` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ -var baseKeys = overArg(nativeKeys, Object); +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} export default baseKeys; diff --git a/_baseKeysIn.js b/_baseKeysIn.js index b76d475f7..84c1395cf 100644 --- a/_baseKeysIn.js +++ b/_baseKeysIn.js @@ -1,36 +1,33 @@ -import Reflect from './_Reflect.js'; -import iteratorToArray from './_iteratorToArray.js'; +import isObject from './isObject.js'; +import isPrototype from './_isPrototype.js'; +import nativeKeysIn from './_nativeKeysIn.js'; /** Used for built-in method references. */ var objectProto = Object.prototype; -/** Built-in value references. */ -var enumerate = Reflect ? Reflect.enumerate : undefined, - propertyIsEnumerable = objectProto.propertyIsEnumerable; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * The base implementation of `_.keysIn` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { - object = object == null ? object : Object(object); + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; - var result = []; for (var key in object) { - result.push(key); + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } } return result; } -// Fallback for IE < 9 with es6-shim. -if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) { - baseKeysIn = function(object) { - return iteratorToArray(enumerate(object)); - }; -} - export default baseKeysIn; diff --git a/_baseMerge.js b/_baseMerge.js index 35d8efa1e..e306a6274 100644 --- a/_baseMerge.js +++ b/_baseMerge.js @@ -1,11 +1,11 @@ import Stack from './_Stack.js'; import arrayEach from './_arrayEach.js'; import assignMergeValue from './_assignMergeValue.js'; +import baseKeysIn from './_baseKeysIn.js'; import baseMergeDeep from './_baseMergeDeep.js'; import isArray from './isArray.js'; import isObject from './isObject.js'; import isTypedArray from './isTypedArray.js'; -import keysIn from './keysIn.js'; /** * The base implementation of `_.merge` without support for multiple sources. @@ -23,7 +23,7 @@ function baseMerge(object, source, srcIndex, customizer, stack) { return; } if (!(isArray(source) || isTypedArray(source))) { - var props = keysIn(source); + var props = baseKeysIn(source); } arrayEach(props || source, function(srcValue, key) { if (props) { diff --git a/_baseSet.js b/_baseSet.js index 7280d7f31..e19e989be 100644 --- a/_baseSet.js +++ b/_baseSet.js @@ -16,6 +16,9 @@ import toKey from './_toKey.js'; * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } path = isKey(path, object) ? [path] : castPath(path); var index = -1, @@ -24,20 +27,19 @@ function baseSet(object, path, value, customizer) { nested = object; while (nested != null && ++index < length) { - var key = toKey(path[index]); - if (isObject(nested)) { - var newValue = value; - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = objValue == null - ? (isIndex(path[index + 1]) ? [] : {}) - : objValue; - } + var key = toKey(path[index]), + newValue = value; + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); } - assignValue(nested, key, newValue); } + assignValue(nested, key, newValue); nested = nested[key]; } return object; diff --git a/_baseUnset.js b/_baseUnset.js index d004dac86..064fe3e20 100644 --- a/_baseUnset.js +++ b/_baseUnset.js @@ -1,10 +1,15 @@ -import baseHas from './_baseHas.js'; import castPath from './_castPath.js'; import isKey from './_isKey.js'; import last from './last.js'; import parent from './_parent.js'; import toKey from './_toKey.js'; +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + /** * The base implementation of `_.unset`. * @@ -18,7 +23,7 @@ function baseUnset(object, path) { object = parent(object, path); var key = toKey(last(path)); - return !(object != null && baseHas(object, key)) || delete object[key]; + return !(object != null && hasOwnProperty.call(object, key)) || delete object[key]; } export default baseUnset; diff --git a/_createCtor.js b/_createCtor.js index 14a123292..57f32b15d 100644 --- a/_createCtor.js +++ b/_createCtor.js @@ -12,7 +12,7 @@ import isObject from './isObject.js'; function createCtor(Ctor) { return function() { // Use a `switch` statement to work with class constructors. See - // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { diff --git a/_equalByTag.js b/_equalByTag.js index c12862dd0..ede1b61fe 100644 --- a/_equalByTag.js +++ b/_equalByTag.js @@ -75,7 +75,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. return object == (other + ''); diff --git a/_equalObjects.js b/_equalObjects.js index 77a365de3..55e5aef46 100644 --- a/_equalObjects.js +++ b/_equalObjects.js @@ -1,9 +1,14 @@ -import baseHas from './_baseHas.js'; import keys from './keys.js'; /** Used to compose bitmasks for comparison styles. */ var PARTIAL_COMPARE_FLAG = 2; +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + /** * A specialized version of `baseIsEqualDeep` for objects with support for * partial deep comparisons. @@ -31,7 +36,7 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { var index = objLength; while (index--) { var key = objProps[index]; - if (!(isPartial ? key in other : baseHas(other, key))) { + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } diff --git a/_getLength.js b/_getLength.js deleted file mode 100644 index e0534cafb..000000000 --- a/_getLength.js +++ /dev/null @@ -1,16 +0,0 @@ -import baseProperty from './_baseProperty.js'; - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a - * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects - * Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -export default getLength; diff --git a/_getPrototype.js b/_getPrototype.js index bdd536231..ce92d4885 100644 --- a/_getPrototype.js +++ b/_getPrototype.js @@ -1,15 +1,6 @@ import overArg from './_overArg.js'; -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetPrototype = Object.getPrototypeOf; - -/** - * Gets the `[[Prototype]]` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {null|Object} Returns the `[[Prototype]]`. - */ -var getPrototype = overArg(nativeGetPrototype, Object); +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); export default getPrototype; diff --git a/_getTag.js b/_getTag.js index c583966f7..3fdc421c5 100644 --- a/_getTag.js +++ b/_getTag.js @@ -20,7 +20,7 @@ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; diff --git a/_indexKeys.js b/_indexKeys.js deleted file mode 100644 index 243f81505..000000000 --- a/_indexKeys.js +++ /dev/null @@ -1,24 +0,0 @@ -import baseTimes from './_baseTimes.js'; -import isArguments from './isArguments.js'; -import isArray from './isArray.js'; -import isLength from './isLength.js'; -import isString from './isString.js'; - -/** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. - * - * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. - */ -function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && - (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); - } - return null; -} - -export default indexKeys; diff --git a/_nativeKeys.js b/_nativeKeys.js new file mode 100644 index 000000000..2ec8ec6b5 --- /dev/null +++ b/_nativeKeys.js @@ -0,0 +1,6 @@ +import overArg from './_overArg.js'; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +export default nativeKeys; diff --git a/_nativeKeysIn.js b/_nativeKeysIn.js new file mode 100644 index 000000000..94eda99e0 --- /dev/null +++ b/_nativeKeysIn.js @@ -0,0 +1,20 @@ +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +export default nativeKeysIn; diff --git a/_overArg.js b/_overArg.js index 637d06c82..93bafe395 100644 --- a/_overArg.js +++ b/_overArg.js @@ -1,5 +1,5 @@ /** - * Creates a function that invokes `func` with its first argument transformed. + * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. diff --git a/assignIn.js b/assignIn.js index 644107adf..8aab0e095 100644 --- a/assignIn.js +++ b/assignIn.js @@ -1,19 +1,7 @@ -import assignValue from './_assignValue.js'; import copyObject from './_copyObject.js'; import createAssigner from './_createAssigner.js'; -import isArrayLike from './isArrayLike.js'; -import isPrototype from './_isPrototype.js'; import keysIn from './keysIn.js'; -/** 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. */ -var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); - /** * This method is like `_.assign` except that it iterates over own and * inherited source properties. @@ -46,13 +34,7 @@ var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ var assignIn = createAssigner(function(object, source) { - if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { - copyObject(source, keysIn(source), object); - return; - } - for (var key in source) { - assignValue(object, key, source[key]); - } + copyObject(source, keysIn(source), object); }); export default assignIn; diff --git a/difference.js b/difference.js index eb7fd6954..ee6f80ee1 100644 --- a/difference.js +++ b/difference.js @@ -5,7 +5,7 @@ import isArrayLikeObject from './isArrayLikeObject.js'; /** * Creates an array of `array` values not included in the other given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order of result values is determined by the * order they occur in the first array. * diff --git a/eq.js b/eq.js index 002c991db..c3206c684 100644 --- a/eq.js +++ b/eq.js @@ -1,6 +1,6 @@ /** * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static diff --git a/escapeRegExp.js b/escapeRegExp.js index 9c26f2225..0b904ca48 100644 --- a/escapeRegExp.js +++ b/escapeRegExp.js @@ -2,7 +2,7 @@ import toString from './toString.js'; /** * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); diff --git a/every.js b/every.js index 3514a1d84..d953c56b3 100644 --- a/every.js +++ b/every.js @@ -9,6 +9,11 @@ import isIterateeCall from './_isIterateeCall.js'; * Iteration is stopped once `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index|key, collection). * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * * @static * @memberOf _ * @since 0.1.0 diff --git a/includes.js b/includes.js index d1b29cfa3..c438da7b4 100644 --- a/includes.js +++ b/includes.js @@ -10,7 +10,7 @@ var nativeMax = Math.max; /** * 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) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * diff --git a/indexOf.js b/indexOf.js index 7635d1526..6e3adf803 100644 --- a/indexOf.js +++ b/indexOf.js @@ -6,7 +6,7 @@ var nativeMax = Math.max; /** * 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) + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. If `fromIndex` is negative, it's used as the * offset from the end of `array`. * diff --git a/initial.js b/initial.js index b753abf61..d4d51a763 100644 --- a/initial.js +++ b/initial.js @@ -1,4 +1,4 @@ -import dropRight from './dropRight.js'; +import baseSlice from './_baseSlice.js'; /** * Gets all but the last element of `array`. @@ -15,7 +15,8 @@ import dropRight from './dropRight.js'; * // => [1, 2] */ function initial(array) { - return dropRight(array, 1); + var length = array ? array.length : 0; + return length ? baseSlice(array, 0, -1) : []; } export default initial; diff --git a/intersection.js b/intersection.js index acccbde2d..550f29418 100644 --- a/intersection.js +++ b/intersection.js @@ -5,7 +5,7 @@ import castArrayLikeObject from './_castArrayLikeObject.js'; /** * Creates an array of unique values that are included in all given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order of result values is determined by the * order they occur in the first array. * diff --git a/isArguments.js b/isArguments.js index 9460adbad..318ccb227 100644 --- a/isArguments.js +++ b/isArguments.js @@ -11,7 +11,7 @@ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; diff --git a/isArrayLike.js b/isArrayLike.js index f5a5c1034..f763abd34 100644 --- a/isArrayLike.js +++ b/isArrayLike.js @@ -1,4 +1,3 @@ -import getLength from './_getLength.js'; import isFunction from './isFunction.js'; import isLength from './isLength.js'; @@ -28,7 +27,7 @@ import isLength from './isLength.js'; * // => false */ function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + return value != null && isLength(value.length) && !isFunction(value); } export default isArrayLike; diff --git a/isBoolean.js b/isBoolean.js index ad18810c5..3171b2583 100644 --- a/isBoolean.js +++ b/isBoolean.js @@ -8,7 +8,7 @@ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; diff --git a/isElement.js b/isElement.js index 05c627f9b..57d27850c 100644 --- a/isElement.js +++ b/isElement.js @@ -9,8 +9,7 @@ import isPlainObject from './isPlainObject.js'; * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. * @example * * _.isElement(document.body); diff --git a/isEmpty.js b/isEmpty.js index 4d7c7afea..78f90a2d8 100644 --- a/isEmpty.js +++ b/isEmpty.js @@ -5,8 +5,9 @@ import isArrayLike from './isArrayLike.js'; import isBuffer from './isBuffer.js'; import isFunction from './isFunction.js'; import isObjectLike from './isObjectLike.js'; +import isPrototype from './_isPrototype.js'; import isString from './isString.js'; -import keys from './keys.js'; +import nativeKeys from './_nativeKeys.js'; /** `Object#toString` result references. */ var mapTag = '[object Map]', @@ -69,12 +70,14 @@ function isEmpty(value) { return !value.size; } } + var isProto = isPrototype(value); for (var key in value) { - if (hasOwnProperty.call(value, key)) { + if (hasOwnProperty.call(value, key) && + !(isProto && key == 'constructor')) { return false; } } - return !(nonEnumShadows && keys(value).length); + return !(nonEnumShadows && nativeKeys(value).length); } export default isEmpty; diff --git a/isEqual.js b/isEqual.js index 0eb776051..2494fa68e 100644 --- a/isEqual.js +++ b/isEqual.js @@ -16,8 +16,7 @@ import baseIsEqual from './_baseIsEqual.js'; * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, - * else `false`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; diff --git a/isEqualWith.js b/isEqualWith.js index 6276d62fb..74f607528 100644 --- a/isEqualWith.js +++ b/isEqualWith.js @@ -13,8 +13,7 @@ import baseIsEqual from './_baseIsEqual.js'; * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, - * else `false`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * function isGreeting(value) { diff --git a/isError.js b/isError.js index 3975a28c5..39c986f8c 100644 --- a/isError.js +++ b/isError.js @@ -8,7 +8,7 @@ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -22,8 +22,7 @@ var objectToString = objectProto.toString; * @since 3.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, - * else `false`. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. * @example * * _.isError(new Error); diff --git a/isFinite.js b/isFinite.js index b961829b5..1c6a50667 100644 --- a/isFinite.js +++ b/isFinite.js @@ -14,8 +14,7 @@ var nativeIsFinite = root.isFinite; * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. * @example * * _.isFinite(3); diff --git a/isFunction.js b/isFunction.js index 1a288bba4..49eaa8cf2 100644 --- a/isFunction.js +++ b/isFunction.js @@ -9,7 +9,7 @@ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; diff --git a/isLength.js b/isLength.js index 39d09201a..2acf24e84 100644 --- a/isLength.js +++ b/isLength.js @@ -4,16 +4,15 @@ var MAX_SAFE_INTEGER = 9007199254740991; /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); diff --git a/isMatch.js b/isMatch.js index de5028417..4872ebfc2 100644 --- a/isMatch.js +++ b/isMatch.js @@ -5,8 +5,12 @@ import getMatchData from './_getMatchData.js'; * Performs a partial deep comparison between `object` and `source` to * determine if `object` contains equivalent property values. * - * **Note:** This method supports comparing the same values as `_.isEqual` - * and is equivalent to `_.matches` when `source` is partially applied. + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. * * @static * @memberOf _ diff --git a/isNumber.js b/isNumber.js index 25b10e907..658fa6a52 100644 --- a/isNumber.js +++ b/isNumber.js @@ -8,7 +8,7 @@ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; diff --git a/isObject.js b/isObject.js index ccce8c3c6..4f1beaa9d 100644 --- a/isObject.js +++ b/isObject.js @@ -1,6 +1,6 @@ /** * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static diff --git a/isPlainObject.js b/isPlainObject.js index 804b380eb..6e561e213 100644 --- a/isPlainObject.js +++ b/isPlainObject.js @@ -19,7 +19,7 @@ var objectCtorString = funcToString.call(Object); /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -33,8 +33,7 @@ var objectToString = objectProto.toString; * @since 0.8.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { diff --git a/isSafeInteger.js b/isSafeInteger.js index a983c8146..beda91198 100644 --- a/isSafeInteger.js +++ b/isSafeInteger.js @@ -15,8 +15,7 @@ var MAX_SAFE_INTEGER = 9007199254740991; * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. * @example * * _.isSafeInteger(3); diff --git a/isString.js b/isString.js index 9b2b6ad08..1e8aac7e4 100644 --- a/isString.js +++ b/isString.js @@ -9,7 +9,7 @@ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; diff --git a/isSymbol.js b/isSymbol.js index 12b8b2621..66cac0520 100644 --- a/isSymbol.js +++ b/isSymbol.js @@ -8,7 +8,7 @@ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; diff --git a/isWeakSet.js b/isWeakSet.js index 47f100ce2..d89f2eea1 100644 --- a/isWeakSet.js +++ b/isWeakSet.js @@ -8,7 +8,7 @@ var objectProto = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; diff --git a/keys.js b/keys.js index 2af3acf8c..fd7089b4f 100644 --- a/keys.js +++ b/keys.js @@ -1,15 +1,12 @@ -import baseHas from './_baseHas.js'; +import arrayLikeKeys from './_arrayLikeKeys.js'; import baseKeys from './_baseKeys.js'; -import indexKeys from './_indexKeys.js'; import isArrayLike from './isArrayLike.js'; -import isIndex from './_isIndex.js'; -import isPrototype from './_isPrototype.js'; /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static @@ -34,23 +31,7 @@ import isPrototype from './_isPrototype.js'; * // => ['0', '1'] */ function keys(object) { - var isProto = isPrototype(object); - if (!(isProto || isArrayLike(object))) { - return baseKeys(object); - } - var indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - for (var key in object) { - if (baseHas(object, key) && - !(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(isProto && key == 'constructor')) { - result.push(key); - } - } - return result; + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } export default keys; diff --git a/keysIn.js b/keysIn.js index accdcd580..a77147a33 100644 --- a/keysIn.js +++ b/keysIn.js @@ -1,13 +1,6 @@ +import arrayLikeKeys from './_arrayLikeKeys.js'; import baseKeysIn from './_baseKeysIn.js'; -import indexKeys from './_indexKeys.js'; -import isIndex from './_isIndex.js'; -import isPrototype from './_isPrototype.js'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +import isArrayLike from './isArrayLike.js'; /** * Creates an array of the own and inherited enumerable property names of `object`. @@ -33,23 +26,7 @@ var hasOwnProperty = objectProto.hasOwnProperty; * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { - var index = -1, - isProto = isPrototype(object), - props = baseKeysIn(object), - propsLength = props.length, - indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - while (++index < propsLength) { - var key = props[index]; - if (!(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } export default keysIn; diff --git a/lodash.default.js b/lodash.default.js index 80eed9a06..f0a8c1c29 100644 --- a/lodash.default.js +++ b/lodash.default.js @@ -45,7 +45,7 @@ import toInteger from './toInteger.js'; import lodash from './wrapperLodash.js'; /** Used as the semantic version number. */ -var VERSION = '4.14.1'; +var VERSION = '4.14.2'; /** Used to compose bitmasks for function metadata. */ var BIND_KEY_FLAG = 2; diff --git a/matches.js b/matches.js index e4d2139c2..a929512c2 100644 --- a/matches.js +++ b/matches.js @@ -6,8 +6,12 @@ import baseMatches from './_baseMatches.js'; * object and `source`, returning `true` if the given object has equivalent * property values, else `false`. * - * **Note:** The created function supports comparing the same values as - * `_.isEqual` is equivalent to `_.isMatch` with `source` partially applied. + * **Note:** The created function is equivalent to `_.isMatch` with `source` + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. * * @static * @memberOf _ diff --git a/matchesProperty.js b/matchesProperty.js index f8ea0029a..089de7a15 100644 --- a/matchesProperty.js +++ b/matchesProperty.js @@ -6,7 +6,9 @@ import baseMatchesProperty from './_baseMatchesProperty.js'; * value at `path` of a given object to `srcValue`, returning `true` if the * object value is equivalent, else `false`. * - * **Note:** This method supports comparing the same values as `_.isEqual`. + * **Note:** Partial comparisons will match empty array and empty object + * `srcValue` values against any array or object value, respectively. See + * `_.isEqual` for a list of supported value comparisons. * * @static * @memberOf _ diff --git a/memoize.js b/memoize.js index 33ae047d9..cd88a4682 100644 --- a/memoize.js +++ b/memoize.js @@ -13,7 +13,7 @@ var FUNC_ERROR_TEXT = 'Expected a function'; * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `delete`, `get`, `has`, and `set`. * * @static diff --git a/now.js b/now.js index 74233124b..096807b0f 100644 --- a/now.js +++ b/now.js @@ -1,3 +1,5 @@ +import root from './_root.js'; + /** * Gets the timestamp of the number of milliseconds that have elapsed since * the Unix epoch (1 January 1970 00:00:00 UTC). @@ -14,8 +16,8 @@ * }, _.now()); * // => Logs the number of milliseconds it took for the deferred invocation. */ -function now() { - return Date.now(); -} +var now = function() { + return root.Date.now(); +}; export default now; diff --git a/package.json b/package.json index 43c2dff46..7645f7dad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lodash-es", - "version": "4.14.1", + "version": "4.14.2", "description": "Lodash exported as ES modules.", "keywords": "es6, modules, stdlib, util", "homepage": "https://lodash.com/custom-builds", diff --git a/pull.js b/pull.js index 5d73a2230..10872f254 100644 --- a/pull.js +++ b/pull.js @@ -3,7 +3,7 @@ import pullAll from './pullAll.js'; /** * Removes all given values from `array` using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` diff --git a/size.js b/size.js index 1ee6384e3..4ddd8c8c9 100644 --- a/size.js +++ b/size.js @@ -1,8 +1,8 @@ +import baseKeys from './_baseKeys.js'; import getTag from './_getTag.js'; import isArrayLike from './isArrayLike.js'; import isObjectLike from './isObjectLike.js'; import isString from './isString.js'; -import keys from './keys.js'; import stringSize from './_stringSize.js'; /** `Object#toString` result references. */ @@ -44,7 +44,7 @@ function size(collection) { return collection.size; } } - return keys(collection).length; + return baseKeys(collection).length; } export default size; diff --git a/spread.js b/spread.js index 819d8c8bd..28d90eb4d 100644 --- a/spread.js +++ b/spread.js @@ -13,7 +13,7 @@ var nativeMax = Math.max; /** * Creates a function that invokes `func` with the `this` binding of the * create function and an array of arguments much like - * [`Function#apply`](http://www.ecma-international.org/ecma-262/6.0/#sec-function.prototype.apply). + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). * * **Note:** This method is based on the * [spread operator](https://mdn.io/spread_operator). diff --git a/tail.js b/tail.js index 7d3f0d852..93c5f7dd3 100644 --- a/tail.js +++ b/tail.js @@ -1,4 +1,4 @@ -import drop from './drop.js'; +import baseSlice from './_baseSlice.js'; /** * Gets all but the first element of `array`. @@ -15,7 +15,8 @@ import drop from './drop.js'; * // => [2, 3] */ function tail(array) { - return drop(array, 1); + var length = array ? array.length : 0; + return length ? baseSlice(array, 1, length) : []; } export default tail; diff --git a/template.js b/template.js index 9810eaa63..bf290bb1b 100644 --- a/template.js +++ b/template.js @@ -17,7 +17,7 @@ var reEmptyStringLeading = /\b__p \+= '';/g, /** * Used to match - * [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). */ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; diff --git a/toInteger.js b/toInteger.js index b51a9d0ba..6d6118c92 100644 --- a/toInteger.js +++ b/toInteger.js @@ -4,7 +4,7 @@ import toFinite from './toFinite.js'; * Converts `value` to an integer. * * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ diff --git a/toLength.js b/toLength.js index b10b3b90f..711045562 100644 --- a/toLength.js +++ b/toLength.js @@ -9,7 +9,7 @@ var MAX_ARRAY_LENGTH = 4294967295; * array-like object. * * **Note:** This method is based on - * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ diff --git a/union.js b/union.js index 41d72e400..eb5979e92 100644 --- a/union.js +++ b/union.js @@ -5,7 +5,7 @@ import isArrayLikeObject from './isArrayLikeObject.js'; /** * Creates an array of unique values, in order, from all given arrays using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @static diff --git a/uniq.js b/uniq.js index 66e3de525..be15c980b 100644 --- a/uniq.js +++ b/uniq.js @@ -2,7 +2,7 @@ import baseUniq from './_baseUniq.js'; /** * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons, in which only the first occurrence of each * element is kept. * diff --git a/without.js b/without.js index 3d1e12c54..5d994231a 100644 --- a/without.js +++ b/without.js @@ -4,7 +4,7 @@ import isArrayLikeObject from './isArrayLikeObject.js'; /** * Creates an array excluding all given values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.pull`, this method returns a new array.