diff --git a/README.md b/README.md index f5f1e8819..0a894923f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lodash-es v4.12.0 +# lodash-es v4.13.0 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.12.0-es) for more details. +See the [package source](https://github.com/lodash/lodash/tree/4.13.0-es) for more details. diff --git a/_DataView.js b/_DataView.js index 5c99e3f73..1bbaaa190 100644 --- a/_DataView.js +++ b/_DataView.js @@ -1,5 +1,5 @@ -import getNative from './_getNative'; -import root from './_root'; +import getNative from './_getNative.js'; +import root from './_root.js'; /* Built-in method references that are verified to be native. */ var DataView = getNative(root, 'DataView'); diff --git a/_Hash.js b/_Hash.js index 8c1371d8d..494e9a7b8 100644 --- a/_Hash.js +++ b/_Hash.js @@ -1,8 +1,8 @@ -import hashClear from './_hashClear'; -import hashDelete from './_hashDelete'; -import hashGet from './_hashGet'; -import hashHas from './_hashHas'; -import hashSet from './_hashSet'; +import hashClear from './_hashClear.js'; +import hashDelete from './_hashDelete.js'; +import hashGet from './_hashGet.js'; +import hashHas from './_hashHas.js'; +import hashSet from './_hashSet.js'; /** * Creates a hash object. diff --git a/_LazyWrapper.js b/_LazyWrapper.js index 79e509fc9..be64bf797 100644 --- a/_LazyWrapper.js +++ b/_LazyWrapper.js @@ -1,5 +1,5 @@ -import baseCreate from './_baseCreate'; -import baseLodash from './_baseLodash'; +import baseCreate from './_baseCreate.js'; +import baseLodash from './_baseLodash.js'; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295; diff --git a/_ListCache.js b/_ListCache.js index ee966baa3..08aaca649 100644 --- a/_ListCache.js +++ b/_ListCache.js @@ -1,8 +1,8 @@ -import listCacheClear from './_listCacheClear'; -import listCacheDelete from './_listCacheDelete'; -import listCacheGet from './_listCacheGet'; -import listCacheHas from './_listCacheHas'; -import listCacheSet from './_listCacheSet'; +import listCacheClear from './_listCacheClear.js'; +import listCacheDelete from './_listCacheDelete.js'; +import listCacheGet from './_listCacheGet.js'; +import listCacheHas from './_listCacheHas.js'; +import listCacheSet from './_listCacheSet.js'; /** * Creates an list cache object. diff --git a/_LodashWrapper.js b/_LodashWrapper.js index 068b8e727..3f10ef00f 100644 --- a/_LodashWrapper.js +++ b/_LodashWrapper.js @@ -1,5 +1,5 @@ -import baseCreate from './_baseCreate'; -import baseLodash from './_baseLodash'; +import baseCreate from './_baseCreate.js'; +import baseLodash from './_baseLodash.js'; /** * The base constructor for creating `lodash` wrapper objects. diff --git a/_Map.js b/_Map.js index 89649e1e6..205585046 100644 --- a/_Map.js +++ b/_Map.js @@ -1,5 +1,5 @@ -import getNative from './_getNative'; -import root from './_root'; +import getNative from './_getNative.js'; +import root from './_root.js'; /* Built-in method references that are verified to be native. */ var Map = getNative(root, 'Map'); diff --git a/_MapCache.js b/_MapCache.js index ba137e972..e37c21d85 100644 --- a/_MapCache.js +++ b/_MapCache.js @@ -1,8 +1,8 @@ -import mapCacheClear from './_mapCacheClear'; -import mapCacheDelete from './_mapCacheDelete'; -import mapCacheGet from './_mapCacheGet'; -import mapCacheHas from './_mapCacheHas'; -import mapCacheSet from './_mapCacheSet'; +import mapCacheClear from './_mapCacheClear.js'; +import mapCacheDelete from './_mapCacheDelete.js'; +import mapCacheGet from './_mapCacheGet.js'; +import mapCacheHas from './_mapCacheHas.js'; +import mapCacheSet from './_mapCacheSet.js'; /** * Creates a map cache object to store key-value pairs. diff --git a/_Promise.js b/_Promise.js index e56a9fdd9..ce54b5815 100644 --- a/_Promise.js +++ b/_Promise.js @@ -1,5 +1,5 @@ -import getNative from './_getNative'; -import root from './_root'; +import getNative from './_getNative.js'; +import root from './_root.js'; /* Built-in method references that are verified to be native. */ var Promise = getNative(root, 'Promise'); diff --git a/_Reflect.js b/_Reflect.js index 13b569802..43c499a4b 100644 --- a/_Reflect.js +++ b/_Reflect.js @@ -1,4 +1,4 @@ -import root from './_root'; +import root from './_root.js'; /** Built-in value references. */ var Reflect = root.Reflect; diff --git a/_Set.js b/_Set.js index e80a6fa3e..2f952099a 100644 --- a/_Set.js +++ b/_Set.js @@ -1,5 +1,5 @@ -import getNative from './_getNative'; -import root from './_root'; +import getNative from './_getNative.js'; +import root from './_root.js'; /* Built-in method references that are verified to be native. */ var Set = getNative(root, 'Set'); diff --git a/_SetCache.js b/_SetCache.js index 419774778..c5e8d8a9a 100644 --- a/_SetCache.js +++ b/_SetCache.js @@ -1,6 +1,6 @@ -import MapCache from './_MapCache'; -import setCacheAdd from './_setCacheAdd'; -import setCacheHas from './_setCacheHas'; +import MapCache from './_MapCache.js'; +import setCacheAdd from './_setCacheAdd.js'; +import setCacheHas from './_setCacheHas.js'; /** * diff --git a/_Stack.js b/_Stack.js index 9578b3f2b..c9bc171d2 100644 --- a/_Stack.js +++ b/_Stack.js @@ -1,9 +1,9 @@ -import ListCache from './_ListCache'; -import stackClear from './_stackClear'; -import stackDelete from './_stackDelete'; -import stackGet from './_stackGet'; -import stackHas from './_stackHas'; -import stackSet from './_stackSet'; +import ListCache from './_ListCache.js'; +import stackClear from './_stackClear.js'; +import stackDelete from './_stackDelete.js'; +import stackGet from './_stackGet.js'; +import stackHas from './_stackHas.js'; +import stackSet from './_stackSet.js'; /** * Creates a stack cache object to store key-value pairs. diff --git a/_Symbol.js b/_Symbol.js index 9dedac06f..2b9341c33 100644 --- a/_Symbol.js +++ b/_Symbol.js @@ -1,4 +1,4 @@ -import root from './_root'; +import root from './_root.js'; /** Built-in value references. */ var Symbol = root.Symbol; diff --git a/_Uint8Array.js b/_Uint8Array.js index c39fd9f17..f463674d2 100644 --- a/_Uint8Array.js +++ b/_Uint8Array.js @@ -1,4 +1,4 @@ -import root from './_root'; +import root from './_root.js'; /** Built-in value references. */ var Uint8Array = root.Uint8Array; diff --git a/_WeakMap.js b/_WeakMap.js index 4a9e9630a..6f97de58c 100644 --- a/_WeakMap.js +++ b/_WeakMap.js @@ -1,5 +1,5 @@ -import getNative from './_getNative'; -import root from './_root'; +import getNative from './_getNative.js'; +import root from './_root.js'; /* Built-in method references that are verified to be native. */ var WeakMap = getNative(root, 'WeakMap'); diff --git a/_arrayAggregator.js b/_arrayAggregator.js index 34ee1293c..55cb5c061 100644 --- a/_arrayAggregator.js +++ b/_arrayAggregator.js @@ -2,7 +2,7 @@ * A specialized version of `baseAggregator` for arrays. * * @private - * @param {Array} array The array to iterate over. + * @param {Array} [array] The array to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. @@ -10,7 +10,7 @@ */ function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, - length = array.length; + length = array ? array.length : 0; while (++index < length) { var value = array[index]; diff --git a/_arrayEach.js b/_arrayEach.js index 142993ecd..abe06e1f5 100644 --- a/_arrayEach.js +++ b/_arrayEach.js @@ -3,13 +3,13 @@ * iteratee shorthands. * * @private - * @param {Array} array The array to iterate over. + * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, - length = array.length; + length = array ? array.length : 0; while (++index < length) { if (iteratee(array[index], index, array) === false) { diff --git a/_arrayEachRight.js b/_arrayEachRight.js index d39a69a94..54dcf2903 100644 --- a/_arrayEachRight.js +++ b/_arrayEachRight.js @@ -3,12 +3,12 @@ * iteratee shorthands. * * @private - * @param {Array} array The array to iterate over. + * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEachRight(array, iteratee) { - var length = array.length; + var length = array ? array.length : 0; while (length--) { if (iteratee(array[length], length, array) === false) { diff --git a/_arrayEvery.js b/_arrayEvery.js index c2ab8922f..3659b1c95 100644 --- a/_arrayEvery.js +++ b/_arrayEvery.js @@ -3,14 +3,14 @@ * iteratee shorthands. * * @private - * @param {Array} array The array to iterate over. + * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. */ function arrayEvery(array, predicate) { var index = -1, - length = array.length; + length = array ? array.length : 0; while (++index < length) { if (!predicate(array[index], index, array)) { diff --git a/_arrayFilter.js b/_arrayFilter.js index dadc70fce..09cfaf8cb 100644 --- a/_arrayFilter.js +++ b/_arrayFilter.js @@ -3,13 +3,13 @@ * iteratee shorthands. * * @private - * @param {Array} array The array to iterate over. + * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { var index = -1, - length = array.length, + length = array ? array.length : 0, resIndex = 0, result = []; diff --git a/_arrayIncludes.js b/_arrayIncludes.js index b6c6fffd4..a3dfdf9d1 100644 --- a/_arrayIncludes.js +++ b/_arrayIncludes.js @@ -1,16 +1,17 @@ -import baseIndexOf from './_baseIndexOf'; +import baseIndexOf from './_baseIndexOf.js'; /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private - * @param {Array} array The array to search. + * @param {Array} [array] The array to search. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { - return !!array.length && baseIndexOf(array, value, 0) > -1; + var length = array ? array.length : 0; + return !!length && baseIndexOf(array, value, 0) > -1; } export default arrayIncludes; diff --git a/_arrayIncludesWith.js b/_arrayIncludesWith.js index 4a3baab93..24edf9fcf 100644 --- a/_arrayIncludesWith.js +++ b/_arrayIncludesWith.js @@ -2,14 +2,14 @@ * This function is like `arrayIncludes` except that it accepts a comparator. * * @private - * @param {Array} array The array to search. + * @param {Array} [array] The array to search. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { var index = -1, - length = array.length; + length = array ? array.length : 0; while (++index < length) { if (comparator(value, array[index])) { diff --git a/_arrayMap.js b/_arrayMap.js index eb475cc15..c9dfd1e63 100644 --- a/_arrayMap.js +++ b/_arrayMap.js @@ -3,13 +3,13 @@ * shorthands. * * @private - * @param {Array} array The array to iterate over. + * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, - length = array.length, + length = array ? array.length : 0, result = Array(length); while (++index < length) { diff --git a/_arrayReduce.js b/_arrayReduce.js index 2f9db33f5..5c009765e 100644 --- a/_arrayReduce.js +++ b/_arrayReduce.js @@ -3,7 +3,7 @@ * iteratee shorthands. * * @private - * @param {Array} array The array to iterate over. + * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as @@ -12,7 +12,7 @@ */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, - length = array.length; + length = array ? array.length : 0; if (initAccum && length) { accumulator = array[++index]; diff --git a/_arrayReduceRight.js b/_arrayReduceRight.js index 0f9d810bd..01fc473bf 100644 --- a/_arrayReduceRight.js +++ b/_arrayReduceRight.js @@ -3,7 +3,7 @@ * iteratee shorthands. * * @private - * @param {Array} array The array to iterate over. + * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the last element of `array` as @@ -11,7 +11,7 @@ * @returns {*} Returns the accumulated value. */ function arrayReduceRight(array, iteratee, accumulator, initAccum) { - var length = array.length; + var length = array ? array.length : 0; if (initAccum && length) { accumulator = array[--length]; } diff --git a/_arraySome.js b/_arraySome.js index b8700dede..2da32de54 100644 --- a/_arraySome.js +++ b/_arraySome.js @@ -3,14 +3,14 @@ * shorthands. * * @private - * @param {Array} array The array to iterate over. + * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, - length = array.length; + length = array ? array.length : 0; while (++index < length) { if (predicate(array[index], index, array)) { diff --git a/_assignInDefaults.js b/_assignInDefaults.js index e379a41af..cfee5ac67 100644 --- a/_assignInDefaults.js +++ b/_assignInDefaults.js @@ -1,4 +1,4 @@ -import eq from './eq'; +import eq from './eq.js'; /** Used for built-in method references. */ var objectProto = Object.prototype; diff --git a/_assignMergeValue.js b/_assignMergeValue.js index 63bab0e63..cb4c2473a 100644 --- a/_assignMergeValue.js +++ b/_assignMergeValue.js @@ -1,4 +1,4 @@ -import eq from './eq'; +import eq from './eq.js'; /** * This function is like `assignValue` except that it doesn't assign diff --git a/_assignValue.js b/_assignValue.js index b6c54e896..f5c2443f5 100644 --- a/_assignValue.js +++ b/_assignValue.js @@ -1,4 +1,4 @@ -import eq from './eq'; +import eq from './eq.js'; /** Used for built-in method references. */ var objectProto = Object.prototype; diff --git a/_assocIndexOf.js b/_assocIndexOf.js index 86abb1547..d4985ce1f 100644 --- a/_assocIndexOf.js +++ b/_assocIndexOf.js @@ -1,4 +1,4 @@ -import eq from './eq'; +import eq from './eq.js'; /** * Gets the index at which the `key` is found in `array` of key-value pairs. diff --git a/_baseAggregator.js b/_baseAggregator.js index d017ea45c..5bf1fdddc 100644 --- a/_baseAggregator.js +++ b/_baseAggregator.js @@ -1,4 +1,4 @@ -import baseEach from './_baseEach'; +import baseEach from './_baseEach.js'; /** * Aggregates elements of `collection` on `accumulator` with keys transformed diff --git a/_baseAssign.js b/_baseAssign.js index af9797f44..81ae5a5b9 100644 --- a/_baseAssign.js +++ b/_baseAssign.js @@ -1,5 +1,5 @@ -import copyObject from './_copyObject'; -import keys from './keys'; +import copyObject from './_copyObject.js'; +import keys from './keys.js'; /** * The base implementation of `_.assign` without support for multiple sources diff --git a/_baseAt.js b/_baseAt.js index 6ff2bdd50..e54eef3fe 100644 --- a/_baseAt.js +++ b/_baseAt.js @@ -1,4 +1,4 @@ -import get from './get'; +import get from './get.js'; /** * The base implementation of `_.at` without support for individual paths. diff --git a/_baseClone.js b/_baseClone.js index 10ce1d0ff..124c1f163 100644 --- a/_baseClone.js +++ b/_baseClone.js @@ -1,20 +1,20 @@ -import Stack from './_Stack'; -import arrayEach from './_arrayEach'; -import assignValue from './_assignValue'; -import baseAssign from './_baseAssign'; -import cloneBuffer from './_cloneBuffer'; -import copyArray from './_copyArray'; -import copySymbols from './_copySymbols'; -import getAllKeys from './_getAllKeys'; -import getTag from './_getTag'; -import initCloneArray from './_initCloneArray'; -import initCloneByTag from './_initCloneByTag'; -import initCloneObject from './_initCloneObject'; -import isArray from './isArray'; -import isBuffer from './isBuffer'; -import isHostObject from './_isHostObject'; -import isObject from './isObject'; -import keys from './keys'; +import Stack from './_Stack.js'; +import arrayEach from './_arrayEach.js'; +import assignValue from './_assignValue.js'; +import baseAssign from './_baseAssign.js'; +import cloneBuffer from './_cloneBuffer.js'; +import copyArray from './_copyArray.js'; +import copySymbols from './_copySymbols.js'; +import getAllKeys from './_getAllKeys.js'; +import getTag from './_getTag.js'; +import initCloneArray from './_initCloneArray.js'; +import initCloneByTag from './_initCloneByTag.js'; +import initCloneObject from './_initCloneObject.js'; +import isArray from './isArray.js'; +import isBuffer from './isBuffer.js'; +import isHostObject from './_isHostObject.js'; +import isObject from './isObject.js'; +import keys from './keys.js'; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', diff --git a/_baseConforms.js b/_baseConforms.js index 1c60bc583..103c9f4cb 100644 --- a/_baseConforms.js +++ b/_baseConforms.js @@ -1,4 +1,4 @@ -import keys from './keys'; +import keys from './keys.js'; /** * The base implementation of `_.conforms` which doesn't clone `source`. diff --git a/_baseCreate.js b/_baseCreate.js index 95945bbb7..db9679b95 100644 --- a/_baseCreate.js +++ b/_baseCreate.js @@ -1,4 +1,4 @@ -import isObject from './isObject'; +import isObject from './isObject.js'; /** Built-in value references. */ var objectCreate = Object.create; diff --git a/_baseDifference.js b/_baseDifference.js index 46cc2ccdb..040d04b9e 100644 --- a/_baseDifference.js +++ b/_baseDifference.js @@ -1,9 +1,9 @@ -import SetCache from './_SetCache'; -import arrayIncludes from './_arrayIncludes'; -import arrayIncludesWith from './_arrayIncludesWith'; -import arrayMap from './_arrayMap'; -import baseUnary from './_baseUnary'; -import cacheHas from './_cacheHas'; +import SetCache from './_SetCache.js'; +import arrayIncludes from './_arrayIncludes.js'; +import arrayIncludesWith from './_arrayIncludesWith.js'; +import arrayMap from './_arrayMap.js'; +import baseUnary from './_baseUnary.js'; +import cacheHas from './_cacheHas.js'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; diff --git a/_baseEach.js b/_baseEach.js index 01e9c423d..038e9366d 100644 --- a/_baseEach.js +++ b/_baseEach.js @@ -1,5 +1,5 @@ -import baseForOwn from './_baseForOwn'; -import createBaseEach from './_createBaseEach'; +import baseForOwn from './_baseForOwn.js'; +import createBaseEach from './_createBaseEach.js'; /** * The base implementation of `_.forEach` without support for iteratee shorthands. diff --git a/_baseEachRight.js b/_baseEachRight.js index dee5059ba..0e4b053de 100644 --- a/_baseEachRight.js +++ b/_baseEachRight.js @@ -1,5 +1,5 @@ -import baseForOwnRight from './_baseForOwnRight'; -import createBaseEach from './_createBaseEach'; +import baseForOwnRight from './_baseForOwnRight.js'; +import createBaseEach from './_createBaseEach.js'; /** * The base implementation of `_.forEachRight` without support for iteratee shorthands. diff --git a/_baseEvery.js b/_baseEvery.js index d4b2ddd9c..2154b4700 100644 --- a/_baseEvery.js +++ b/_baseEvery.js @@ -1,4 +1,4 @@ -import baseEach from './_baseEach'; +import baseEach from './_baseEach.js'; /** * The base implementation of `_.every` without support for iteratee shorthands. diff --git a/_baseExtremum.js b/_baseExtremum.js index 4fd04a025..d154c6127 100644 --- a/_baseExtremum.js +++ b/_baseExtremum.js @@ -1,4 +1,4 @@ -import isSymbol from './isSymbol'; +import isSymbol from './isSymbol.js'; /** * The base implementation of methods like `_.max` and `_.min` which accepts a diff --git a/_baseFill.js b/_baseFill.js index f7e4c8cff..c7ef26e73 100644 --- a/_baseFill.js +++ b/_baseFill.js @@ -1,5 +1,5 @@ -import toInteger from './toInteger'; -import toLength from './toLength'; +import toInteger from './toInteger.js'; +import toLength from './toLength.js'; /** * The base implementation of `_.fill` without an iteratee call guard. diff --git a/_baseFilter.js b/_baseFilter.js index 942c522e5..4840ed609 100644 --- a/_baseFilter.js +++ b/_baseFilter.js @@ -1,4 +1,4 @@ -import baseEach from './_baseEach'; +import baseEach from './_baseEach.js'; /** * The base implementation of `_.filter` without support for iteratee shorthands. diff --git a/_baseFindIndex.js b/_baseFindIndex.js index b40ce3a4d..0295f7d96 100644 --- a/_baseFindIndex.js +++ b/_baseFindIndex.js @@ -5,12 +5,13 @@ * @private * @param {Array} array The array to search. * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {number} Returns the index of the matched value, else `-1`. */ -function baseFindIndex(array, predicate, fromRight) { +function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, - index = fromRight ? length : -1; + index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { diff --git a/_baseFind.js b/_baseFindKey.js similarity index 53% rename from _baseFind.js rename to _baseFindKey.js index a6d965bd8..816e74374 100644 --- a/_baseFind.js +++ b/_baseFindKey.js @@ -1,25 +1,23 @@ /** - * The base implementation of methods like `_.find` and `_.findKey`, without - * support for iteratee shorthands, which iterates over `collection` using - * `eachFunc`. + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. * * @private * @param {Array|Object} collection The collection to search. * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. - * @param {boolean} [retKey] Specify returning the key of the found element - * instead of the element itself. * @returns {*} Returns the found element or its key, else `undefined`. */ -function baseFind(collection, predicate, eachFunc, retKey) { +function baseFindKey(collection, predicate, eachFunc) { var result; eachFunc(collection, function(value, key, collection) { if (predicate(value, key, collection)) { - result = retKey ? key : value; + result = key; return false; } }); return result; } -export default baseFind; +export default baseFindKey; diff --git a/_baseFlatten.js b/_baseFlatten.js index d19d8f5d6..b42dee6b9 100644 --- a/_baseFlatten.js +++ b/_baseFlatten.js @@ -1,5 +1,5 @@ -import arrayPush from './_arrayPush'; -import isFlattenable from './_isFlattenable'; +import arrayPush from './_arrayPush.js'; +import isFlattenable from './_isFlattenable.js'; /** * The base implementation of `_.flatten` with support for restricting flattening. diff --git a/_baseFor.js b/_baseFor.js index 64b462b27..debbcf8cb 100644 --- a/_baseFor.js +++ b/_baseFor.js @@ -1,4 +1,4 @@ -import createBaseFor from './_createBaseFor'; +import createBaseFor from './_createBaseFor.js'; /** * The base implementation of `baseForOwn` which iterates over `object` diff --git a/_baseForOwn.js b/_baseForOwn.js index 002d298f8..2293e9a6c 100644 --- a/_baseForOwn.js +++ b/_baseForOwn.js @@ -1,5 +1,5 @@ -import baseFor from './_baseFor'; -import keys from './keys'; +import baseFor from './_baseFor.js'; +import keys from './keys.js'; /** * The base implementation of `_.forOwn` without support for iteratee shorthands. diff --git a/_baseForOwnRight.js b/_baseForOwnRight.js index d3287b382..06871b4bb 100644 --- a/_baseForOwnRight.js +++ b/_baseForOwnRight.js @@ -1,5 +1,5 @@ -import baseForRight from './_baseForRight'; -import keys from './keys'; +import baseForRight from './_baseForRight.js'; +import keys from './keys.js'; /** * The base implementation of `_.forOwnRight` without support for iteratee shorthands. diff --git a/_baseForRight.js b/_baseForRight.js index 31e303767..85596da28 100644 --- a/_baseForRight.js +++ b/_baseForRight.js @@ -1,4 +1,4 @@ -import createBaseFor from './_createBaseFor'; +import createBaseFor from './_createBaseFor.js'; /** * This function is like `baseFor` except that it iterates over properties diff --git a/_baseFunctions.js b/_baseFunctions.js index 3d8b4a58a..35a875e96 100644 --- a/_baseFunctions.js +++ b/_baseFunctions.js @@ -1,5 +1,5 @@ -import arrayFilter from './_arrayFilter'; -import isFunction from './isFunction'; +import arrayFilter from './_arrayFilter.js'; +import isFunction from './isFunction.js'; /** * The base implementation of `_.functions` which creates an array of diff --git a/_baseGet.js b/_baseGet.js index d2cb535cb..18bdab3a2 100644 --- a/_baseGet.js +++ b/_baseGet.js @@ -1,6 +1,6 @@ -import castPath from './_castPath'; -import isKey from './_isKey'; -import toKey from './_toKey'; +import castPath from './_castPath.js'; +import isKey from './_isKey.js'; +import toKey from './_toKey.js'; /** * The base implementation of `_.get` without support for default values. diff --git a/_baseGetAllKeys.js b/_baseGetAllKeys.js index cf117547e..af5533b09 100644 --- a/_baseGetAllKeys.js +++ b/_baseGetAllKeys.js @@ -1,5 +1,5 @@ -import arrayPush from './_arrayPush'; -import isArray from './isArray'; +import arrayPush from './_arrayPush.js'; +import isArray from './isArray.js'; /** * The base implementation of `getAllKeys` and `getAllKeysIn` which uses diff --git a/_baseHas.js b/_baseHas.js index 8fdb4406b..b26c103cb 100644 --- a/_baseHas.js +++ b/_baseHas.js @@ -1,4 +1,4 @@ -import getPrototype from './_getPrototype'; +import getPrototype from './_getPrototype.js'; /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -10,7 +10,7 @@ var hasOwnProperty = objectProto.hasOwnProperty; * The base implementation of `_.has` without support for deep paths. * * @private - * @param {Object} object The object to query. + * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ @@ -18,8 +18,9 @@ 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 hasOwnProperty.call(object, key) || - (typeof object == 'object' && key in object && getPrototype(object) === null); + return object != null && + (hasOwnProperty.call(object, key) || + (typeof object == 'object' && key in object && getPrototype(object) === null)); } export default baseHas; diff --git a/_baseHasIn.js b/_baseHasIn.js index 62ab0391c..ee48bc131 100644 --- a/_baseHasIn.js +++ b/_baseHasIn.js @@ -2,12 +2,12 @@ * The base implementation of `_.hasIn` without support for deep paths. * * @private - * @param {Object} object The object to query. + * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHasIn(object, key) { - return key in Object(object); + return object != null && key in Object(object); } export default baseHasIn; diff --git a/_baseIndexOf.js b/_baseIndexOf.js index 06452347a..f8477a9ae 100644 --- a/_baseIndexOf.js +++ b/_baseIndexOf.js @@ -1,4 +1,4 @@ -import indexOfNaN from './_indexOfNaN'; +import indexOfNaN from './_indexOfNaN.js'; /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. diff --git a/_baseIntersection.js b/_baseIntersection.js index f301527ca..dede69664 100644 --- a/_baseIntersection.js +++ b/_baseIntersection.js @@ -1,9 +1,9 @@ -import SetCache from './_SetCache'; -import arrayIncludes from './_arrayIncludes'; -import arrayIncludesWith from './_arrayIncludesWith'; -import arrayMap from './_arrayMap'; -import baseUnary from './_baseUnary'; -import cacheHas from './_cacheHas'; +import SetCache from './_SetCache.js'; +import arrayIncludes from './_arrayIncludes.js'; +import arrayIncludesWith from './_arrayIncludesWith.js'; +import arrayMap from './_arrayMap.js'; +import baseUnary from './_baseUnary.js'; +import cacheHas from './_cacheHas.js'; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMin = Math.min; diff --git a/_baseInverter.js b/_baseInverter.js index eef7f19ce..5cb3800ce 100644 --- a/_baseInverter.js +++ b/_baseInverter.js @@ -1,4 +1,4 @@ -import baseForOwn from './_baseForOwn'; +import baseForOwn from './_baseForOwn.js'; /** * The base implementation of `_.invert` and `_.invertBy` which inverts diff --git a/_baseInvoke.js b/_baseInvoke.js index ebbd25656..1c2e03de9 100644 --- a/_baseInvoke.js +++ b/_baseInvoke.js @@ -1,9 +1,9 @@ -import apply from './_apply'; -import castPath from './_castPath'; -import isKey from './_isKey'; -import last from './last'; -import parent from './_parent'; -import toKey from './_toKey'; +import apply from './_apply.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'; /** * The base implementation of `_.invoke` without support for individual diff --git a/_baseIsEqual.js b/_baseIsEqual.js index d04dd52a7..c8b9738db 100644 --- a/_baseIsEqual.js +++ b/_baseIsEqual.js @@ -1,6 +1,6 @@ -import baseIsEqualDeep from './_baseIsEqualDeep'; -import isObject from './isObject'; -import isObjectLike from './isObjectLike'; +import baseIsEqualDeep from './_baseIsEqualDeep.js'; +import isObject from './isObject.js'; +import isObjectLike from './isObjectLike.js'; /** * The base implementation of `_.isEqual` which supports partial comparisons diff --git a/_baseIsEqualDeep.js b/_baseIsEqualDeep.js index c8160a8bb..bd5d0ef62 100644 --- a/_baseIsEqualDeep.js +++ b/_baseIsEqualDeep.js @@ -1,11 +1,11 @@ -import Stack from './_Stack'; -import equalArrays from './_equalArrays'; -import equalByTag from './_equalByTag'; -import equalObjects from './_equalObjects'; -import getTag from './_getTag'; -import isArray from './isArray'; -import isHostObject from './_isHostObject'; -import isTypedArray from './isTypedArray'; +import Stack from './_Stack.js'; +import equalArrays from './_equalArrays.js'; +import equalByTag from './_equalByTag.js'; +import equalObjects from './_equalObjects.js'; +import getTag from './_getTag.js'; +import isArray from './isArray.js'; +import isHostObject from './_isHostObject.js'; +import isTypedArray from './isTypedArray.js'; /** Used to compose bitmasks for comparison styles. */ var PARTIAL_COMPARE_FLAG = 2; diff --git a/_baseIsMatch.js b/_baseIsMatch.js index e720351dc..e72774db4 100644 --- a/_baseIsMatch.js +++ b/_baseIsMatch.js @@ -1,5 +1,5 @@ -import Stack from './_Stack'; -import baseIsEqual from './_baseIsEqual'; +import Stack from './_Stack.js'; +import baseIsEqual from './_baseIsEqual.js'; /** Used to compose bitmasks for comparison styles. */ var UNORDERED_COMPARE_FLAG = 1, diff --git a/_baseIsNative.js b/_baseIsNative.js new file mode 100644 index 000000000..eececaa8a --- /dev/null +++ b/_baseIsNative.js @@ -0,0 +1,47 @@ +import isFunction from './isFunction.js'; +import isHostObject from './_isHostObject.js'; +import isMasked from './_isMasked.js'; +import isObject from './isObject.js'; +import toSource from './_toSource.js'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +export default baseIsNative; diff --git a/_baseIteratee.js b/_baseIteratee.js index 0a3d36658..af052002e 100644 --- a/_baseIteratee.js +++ b/_baseIteratee.js @@ -1,8 +1,8 @@ -import baseMatches from './_baseMatches'; -import baseMatchesProperty from './_baseMatchesProperty'; -import identity from './identity'; -import isArray from './isArray'; -import property from './property'; +import baseMatches from './_baseMatches.js'; +import baseMatchesProperty from './_baseMatchesProperty.js'; +import identity from './identity.js'; +import isArray from './isArray.js'; +import property from './property.js'; /** * The base implementation of `_.iteratee`. diff --git a/_baseKeysIn.js b/_baseKeysIn.js index 06f42f870..b76d475f7 100644 --- a/_baseKeysIn.js +++ b/_baseKeysIn.js @@ -1,5 +1,5 @@ -import Reflect from './_Reflect'; -import iteratorToArray from './_iteratorToArray'; +import Reflect from './_Reflect.js'; +import iteratorToArray from './_iteratorToArray.js'; /** Used for built-in method references. */ var objectProto = Object.prototype; diff --git a/_baseMap.js b/_baseMap.js index a85bdd178..c607c0191 100644 --- a/_baseMap.js +++ b/_baseMap.js @@ -1,5 +1,5 @@ -import baseEach from './_baseEach'; -import isArrayLike from './isArrayLike'; +import baseEach from './_baseEach.js'; +import isArrayLike from './isArrayLike.js'; /** * The base implementation of `_.map` without support for iteratee shorthands. diff --git a/_baseMatches.js b/_baseMatches.js index 14ce12d22..74e9971f6 100644 --- a/_baseMatches.js +++ b/_baseMatches.js @@ -1,6 +1,6 @@ -import baseIsMatch from './_baseIsMatch'; -import getMatchData from './_getMatchData'; -import matchesStrictComparable from './_matchesStrictComparable'; +import baseIsMatch from './_baseIsMatch.js'; +import getMatchData from './_getMatchData.js'; +import matchesStrictComparable from './_matchesStrictComparable.js'; /** * The base implementation of `_.matches` which doesn't clone `source`. diff --git a/_baseMatchesProperty.js b/_baseMatchesProperty.js index de6ed4f7a..1085ab239 100644 --- a/_baseMatchesProperty.js +++ b/_baseMatchesProperty.js @@ -1,10 +1,10 @@ -import baseIsEqual from './_baseIsEqual'; -import get from './get'; -import hasIn from './hasIn'; -import isKey from './_isKey'; -import isStrictComparable from './_isStrictComparable'; -import matchesStrictComparable from './_matchesStrictComparable'; -import toKey from './_toKey'; +import baseIsEqual from './_baseIsEqual.js'; +import get from './get.js'; +import hasIn from './hasIn.js'; +import isKey from './_isKey.js'; +import isStrictComparable from './_isStrictComparable.js'; +import matchesStrictComparable from './_matchesStrictComparable.js'; +import toKey from './_toKey.js'; /** Used to compose bitmasks for comparison styles. */ var UNORDERED_COMPARE_FLAG = 1, diff --git a/_baseMean.js b/_baseMean.js index 70d0a2065..1a95e7f2f 100644 --- a/_baseMean.js +++ b/_baseMean.js @@ -1,4 +1,4 @@ -import baseSum from './_baseSum'; +import baseSum from './_baseSum.js'; /** Used as references for various `Number` constants. */ var NAN = 0 / 0; diff --git a/_baseMerge.js b/_baseMerge.js index d6747a3a6..35d8efa1e 100644 --- a/_baseMerge.js +++ b/_baseMerge.js @@ -1,11 +1,11 @@ -import Stack from './_Stack'; -import arrayEach from './_arrayEach'; -import assignMergeValue from './_assignMergeValue'; -import baseMergeDeep from './_baseMergeDeep'; -import isArray from './isArray'; -import isObject from './isObject'; -import isTypedArray from './isTypedArray'; -import keysIn from './keysIn'; +import Stack from './_Stack.js'; +import arrayEach from './_arrayEach.js'; +import assignMergeValue from './_assignMergeValue.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. diff --git a/_baseMergeDeep.js b/_baseMergeDeep.js index 1e5e001f8..3e0e0ef00 100644 --- a/_baseMergeDeep.js +++ b/_baseMergeDeep.js @@ -1,14 +1,14 @@ -import assignMergeValue from './_assignMergeValue'; -import baseClone from './_baseClone'; -import copyArray from './_copyArray'; -import isArguments from './isArguments'; -import isArray from './isArray'; -import isArrayLikeObject from './isArrayLikeObject'; -import isFunction from './isFunction'; -import isObject from './isObject'; -import isPlainObject from './isPlainObject'; -import isTypedArray from './isTypedArray'; -import toPlainObject from './toPlainObject'; +import assignMergeValue from './_assignMergeValue.js'; +import baseClone from './_baseClone.js'; +import copyArray from './_copyArray.js'; +import isArguments from './isArguments.js'; +import isArray from './isArray.js'; +import isArrayLikeObject from './isArrayLikeObject.js'; +import isFunction from './isFunction.js'; +import isObject from './isObject.js'; +import isPlainObject from './isPlainObject.js'; +import isTypedArray from './isTypedArray.js'; +import toPlainObject from './toPlainObject.js'; /** * A specialized version of `baseMerge` for arrays and objects which performs diff --git a/_baseNth.js b/_baseNth.js index 31d0b880f..df0874135 100644 --- a/_baseNth.js +++ b/_baseNth.js @@ -1,4 +1,4 @@ -import isIndex from './_isIndex'; +import isIndex from './_isIndex.js'; /** * The base implementation of `_.nth` which doesn't coerce `n` to an integer. diff --git a/_baseOrderBy.js b/_baseOrderBy.js index 9a71e53f9..b9d00aaf9 100644 --- a/_baseOrderBy.js +++ b/_baseOrderBy.js @@ -1,10 +1,10 @@ -import arrayMap from './_arrayMap'; -import baseIteratee from './_baseIteratee'; -import baseMap from './_baseMap'; -import baseSortBy from './_baseSortBy'; -import baseUnary from './_baseUnary'; -import compareMultiple from './_compareMultiple'; -import identity from './identity'; +import arrayMap from './_arrayMap.js'; +import baseIteratee from './_baseIteratee.js'; +import baseMap from './_baseMap.js'; +import baseSortBy from './_baseSortBy.js'; +import baseUnary from './_baseUnary.js'; +import compareMultiple from './_compareMultiple.js'; +import identity from './identity.js'; /** * The base implementation of `_.orderBy` without param guards. diff --git a/_basePick.js b/_basePick.js index e877fb1b3..36528b77b 100644 --- a/_basePick.js +++ b/_basePick.js @@ -1,4 +1,4 @@ -import arrayReduce from './_arrayReduce'; +import arrayReduce from './_arrayReduce.js'; /** * The base implementation of `_.pick` without support for individual diff --git a/_basePickBy.js b/_basePickBy.js index 3b88367ea..22d8aa905 100644 --- a/_basePickBy.js +++ b/_basePickBy.js @@ -1,4 +1,4 @@ -import getAllKeysIn from './_getAllKeysIn'; +import getAllKeysIn from './_getAllKeysIn.js'; /** * The base implementation of `_.pickBy` without support for iteratee shorthands. diff --git a/_basePropertyDeep.js b/_basePropertyDeep.js index efa1a1266..2f779ab74 100644 --- a/_basePropertyDeep.js +++ b/_basePropertyDeep.js @@ -1,4 +1,4 @@ -import baseGet from './_baseGet'; +import baseGet from './_baseGet.js'; /** * A specialized version of `baseProperty` which supports deep paths. diff --git a/_basePullAll.js b/_basePullAll.js index f819d5ac8..e69c1003e 100644 --- a/_basePullAll.js +++ b/_basePullAll.js @@ -1,7 +1,8 @@ -import arrayMap from './_arrayMap'; -import baseIndexOf from './_baseIndexOf'; -import baseIndexOfWith from './_baseIndexOfWith'; -import baseUnary from './_baseUnary'; +import arrayMap from './_arrayMap.js'; +import baseIndexOf from './_baseIndexOf.js'; +import baseIndexOfWith from './_baseIndexOfWith.js'; +import baseUnary from './_baseUnary.js'; +import copyArray from './_copyArray.js'; /** Used for built-in method references. */ var arrayProto = Array.prototype; @@ -26,6 +27,9 @@ function basePullAll(array, values, iteratee, comparator) { length = values.length, seen = array; + if (array === values) { + values = copyArray(values); + } if (iteratee) { seen = arrayMap(array, baseUnary(iteratee)); } diff --git a/_basePullAt.js b/_basePullAt.js index 7f7fe94ad..8820c36e9 100644 --- a/_basePullAt.js +++ b/_basePullAt.js @@ -1,9 +1,9 @@ -import castPath from './_castPath'; -import isIndex from './_isIndex'; -import isKey from './_isKey'; -import last from './last'; -import parent from './_parent'; -import toKey from './_toKey'; +import castPath from './_castPath.js'; +import isIndex from './_isIndex.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 arrayProto = Array.prototype; diff --git a/_baseSet.js b/_baseSet.js index ebb90107e..7280d7f31 100644 --- a/_baseSet.js +++ b/_baseSet.js @@ -1,9 +1,9 @@ -import assignValue from './_assignValue'; -import castPath from './_castPath'; -import isIndex from './_isIndex'; -import isKey from './_isKey'; -import isObject from './isObject'; -import toKey from './_toKey'; +import assignValue from './_assignValue.js'; +import castPath from './_castPath.js'; +import isIndex from './_isIndex.js'; +import isKey from './_isKey.js'; +import isObject from './isObject.js'; +import toKey from './_toKey.js'; /** * The base implementation of `_.set`. diff --git a/_baseSetData.js b/_baseSetData.js index f91346443..0ffc99b45 100644 --- a/_baseSetData.js +++ b/_baseSetData.js @@ -1,5 +1,5 @@ -import identity from './identity'; -import metaMap from './_metaMap'; +import identity from './identity.js'; +import metaMap from './_metaMap.js'; /** * The base implementation of `setData` without support for hot loop detection. diff --git a/_baseSome.js b/_baseSome.js index 94f065eae..f2647c23c 100644 --- a/_baseSome.js +++ b/_baseSome.js @@ -1,4 +1,4 @@ -import baseEach from './_baseEach'; +import baseEach from './_baseEach.js'; /** * The base implementation of `_.some` without support for iteratee shorthands. diff --git a/_baseSortedIndex.js b/_baseSortedIndex.js index ab5305c43..9abab9ccd 100644 --- a/_baseSortedIndex.js +++ b/_baseSortedIndex.js @@ -1,6 +1,6 @@ -import baseSortedIndexBy from './_baseSortedIndexBy'; -import identity from './identity'; -import isSymbol from './isSymbol'; +import baseSortedIndexBy from './_baseSortedIndexBy.js'; +import identity from './identity.js'; +import isSymbol from './isSymbol.js'; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295, diff --git a/_baseSortedIndexBy.js b/_baseSortedIndexBy.js index ceec7957c..3aef164a8 100644 --- a/_baseSortedIndexBy.js +++ b/_baseSortedIndexBy.js @@ -1,4 +1,4 @@ -import isSymbol from './isSymbol'; +import isSymbol from './isSymbol.js'; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295, diff --git a/_baseSortedUniq.js b/_baseSortedUniq.js index 6ea872aa2..cb44abc14 100644 --- a/_baseSortedUniq.js +++ b/_baseSortedUniq.js @@ -1,4 +1,4 @@ -import eq from './eq'; +import eq from './eq.js'; /** * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without diff --git a/_baseToNumber.js b/_baseToNumber.js index a062c0215..3552d1a21 100644 --- a/_baseToNumber.js +++ b/_baseToNumber.js @@ -1,4 +1,4 @@ -import isSymbol from './isSymbol'; +import isSymbol from './isSymbol.js'; /** Used as references for various `Number` constants. */ var NAN = 0 / 0; diff --git a/_baseToPairs.js b/_baseToPairs.js index 10c834a13..c1e3f9f8c 100644 --- a/_baseToPairs.js +++ b/_baseToPairs.js @@ -1,4 +1,4 @@ -import arrayMap from './_arrayMap'; +import arrayMap from './_arrayMap.js'; /** * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array diff --git a/_baseToString.js b/_baseToString.js index 02c2c1c46..3b264fc60 100644 --- a/_baseToString.js +++ b/_baseToString.js @@ -1,5 +1,5 @@ -import Symbol from './_Symbol'; -import isSymbol from './isSymbol'; +import Symbol from './_Symbol.js'; +import isSymbol from './isSymbol.js'; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; diff --git a/_baseUniq.js b/_baseUniq.js index 517f020fb..4ca0bcdee 100644 --- a/_baseUniq.js +++ b/_baseUniq.js @@ -1,9 +1,9 @@ -import SetCache from './_SetCache'; -import arrayIncludes from './_arrayIncludes'; -import arrayIncludesWith from './_arrayIncludesWith'; -import cacheHas from './_cacheHas'; -import createSet from './_createSet'; -import setToArray from './_setToArray'; +import SetCache from './_SetCache.js'; +import arrayIncludes from './_arrayIncludes.js'; +import arrayIncludesWith from './_arrayIncludesWith.js'; +import cacheHas from './_cacheHas.js'; +import createSet from './_createSet.js'; +import setToArray from './_setToArray.js'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; diff --git a/_baseUnset.js b/_baseUnset.js index a9d48a19d..d004dac86 100644 --- a/_baseUnset.js +++ b/_baseUnset.js @@ -1,9 +1,9 @@ -import baseHas from './_baseHas'; -import castPath from './_castPath'; -import isKey from './_isKey'; -import last from './last'; -import parent from './_parent'; -import toKey from './_toKey'; +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'; /** * The base implementation of `_.unset`. diff --git a/_baseUpdate.js b/_baseUpdate.js index 79cea3ff2..8bf7d1d11 100644 --- a/_baseUpdate.js +++ b/_baseUpdate.js @@ -1,5 +1,5 @@ -import baseGet from './_baseGet'; -import baseSet from './_baseSet'; +import baseGet from './_baseGet.js'; +import baseSet from './_baseSet.js'; /** * The base implementation of `_.update`. diff --git a/_baseValues.js b/_baseValues.js index b4d657a9b..f3a38d2df 100644 --- a/_baseValues.js +++ b/_baseValues.js @@ -1,4 +1,4 @@ -import arrayMap from './_arrayMap'; +import arrayMap from './_arrayMap.js'; /** * The base implementation of `_.values` and `_.valuesIn` which creates an diff --git a/_baseWhile.js b/_baseWhile.js index f480e753c..5536ea6ef 100644 --- a/_baseWhile.js +++ b/_baseWhile.js @@ -1,4 +1,4 @@ -import baseSlice from './_baseSlice'; +import baseSlice from './_baseSlice.js'; /** * The base implementation of methods like `_.dropWhile` and `_.takeWhile` diff --git a/_baseWrapperValue.js b/_baseWrapperValue.js index 95c652714..0b6807ee0 100644 --- a/_baseWrapperValue.js +++ b/_baseWrapperValue.js @@ -1,6 +1,6 @@ -import LazyWrapper from './_LazyWrapper'; -import arrayPush from './_arrayPush'; -import arrayReduce from './_arrayReduce'; +import LazyWrapper from './_LazyWrapper.js'; +import arrayPush from './_arrayPush.js'; +import arrayReduce from './_arrayReduce.js'; /** * The base implementation of `wrapperValue` which returns the result of diff --git a/_baseXor.js b/_baseXor.js index 7cf0851b7..e5190f416 100644 --- a/_baseXor.js +++ b/_baseXor.js @@ -1,6 +1,6 @@ -import arrayPush from './_arrayPush'; -import baseDifference from './_baseDifference'; -import baseUniq from './_baseUniq'; +import arrayPush from './_arrayPush.js'; +import baseDifference from './_baseDifference.js'; +import baseUniq from './_baseUniq.js'; /** * The base implementation of methods like `_.xor`, without support for diff --git a/_castArrayLikeObject.js b/_castArrayLikeObject.js index ddea66adf..040d3e5eb 100644 --- a/_castArrayLikeObject.js +++ b/_castArrayLikeObject.js @@ -1,4 +1,4 @@ -import isArrayLikeObject from './isArrayLikeObject'; +import isArrayLikeObject from './isArrayLikeObject.js'; /** * Casts `value` to an empty array if it's not an array like object. diff --git a/_castFunction.js b/_castFunction.js index f5ac5d351..03a2e9913 100644 --- a/_castFunction.js +++ b/_castFunction.js @@ -1,4 +1,4 @@ -import identity from './identity'; +import identity from './identity.js'; /** * Casts `value` to `identity` if it's not a function. diff --git a/_castPath.js b/_castPath.js index ffaf2b6c1..55e78cfbc 100644 --- a/_castPath.js +++ b/_castPath.js @@ -1,5 +1,5 @@ -import isArray from './isArray'; -import stringToPath from './_stringToPath'; +import isArray from './isArray.js'; +import stringToPath from './_stringToPath.js'; /** * Casts `value` to a path array if it's not one. diff --git a/_castSlice.js b/_castSlice.js index 4d8a7f52b..011bbe4eb 100644 --- a/_castSlice.js +++ b/_castSlice.js @@ -1,4 +1,4 @@ -import baseSlice from './_baseSlice'; +import baseSlice from './_baseSlice.js'; /** * Casts `array` to a slice if it's needed. diff --git a/_charsEndIndex.js b/_charsEndIndex.js index 79590a0e2..af9926e7a 100644 --- a/_charsEndIndex.js +++ b/_charsEndIndex.js @@ -1,4 +1,4 @@ -import baseIndexOf from './_baseIndexOf'; +import baseIndexOf from './_baseIndexOf.js'; /** * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol diff --git a/_charsStartIndex.js b/_charsStartIndex.js index 301a82491..7406b19f4 100644 --- a/_charsStartIndex.js +++ b/_charsStartIndex.js @@ -1,4 +1,4 @@ -import baseIndexOf from './_baseIndexOf'; +import baseIndexOf from './_baseIndexOf.js'; /** * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol diff --git a/_cloneArrayBuffer.js b/_cloneArrayBuffer.js index 2b3a5eba5..9f33e7a7c 100644 --- a/_cloneArrayBuffer.js +++ b/_cloneArrayBuffer.js @@ -1,4 +1,4 @@ -import Uint8Array from './_Uint8Array'; +import Uint8Array from './_Uint8Array.js'; /** * Creates a clone of `arrayBuffer`. diff --git a/_cloneDataView.js b/_cloneDataView.js index 211b6b2c3..f9b9a6f03 100644 --- a/_cloneDataView.js +++ b/_cloneDataView.js @@ -1,4 +1,4 @@ -import cloneArrayBuffer from './_cloneArrayBuffer'; +import cloneArrayBuffer from './_cloneArrayBuffer.js'; /** * Creates a clone of `dataView`. diff --git a/_cloneMap.js b/_cloneMap.js index cf29f2ef3..4b9d28e1d 100644 --- a/_cloneMap.js +++ b/_cloneMap.js @@ -1,6 +1,6 @@ -import addMapEntry from './_addMapEntry'; -import arrayReduce from './_arrayReduce'; -import mapToArray from './_mapToArray'; +import addMapEntry from './_addMapEntry.js'; +import arrayReduce from './_arrayReduce.js'; +import mapToArray from './_mapToArray.js'; /** * Creates a clone of `map`. diff --git a/_cloneSet.js b/_cloneSet.js index 3cc5bf948..c6f0e0db4 100644 --- a/_cloneSet.js +++ b/_cloneSet.js @@ -1,6 +1,6 @@ -import addSetEntry from './_addSetEntry'; -import arrayReduce from './_arrayReduce'; -import setToArray from './_setToArray'; +import addSetEntry from './_addSetEntry.js'; +import arrayReduce from './_arrayReduce.js'; +import setToArray from './_setToArray.js'; /** * Creates a clone of `set`. diff --git a/_cloneSymbol.js b/_cloneSymbol.js index 9cd1e1c09..357b155f4 100644 --- a/_cloneSymbol.js +++ b/_cloneSymbol.js @@ -1,4 +1,4 @@ -import Symbol from './_Symbol'; +import Symbol from './_Symbol.js'; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, diff --git a/_cloneTypedArray.js b/_cloneTypedArray.js index abc4554d9..2fa9b8a6a 100644 --- a/_cloneTypedArray.js +++ b/_cloneTypedArray.js @@ -1,4 +1,4 @@ -import cloneArrayBuffer from './_cloneArrayBuffer'; +import cloneArrayBuffer from './_cloneArrayBuffer.js'; /** * Creates a clone of `typedArray`. diff --git a/_compareAscending.js b/_compareAscending.js index 7737d0dc5..f4451931d 100644 --- a/_compareAscending.js +++ b/_compareAscending.js @@ -1,4 +1,4 @@ -import isSymbol from './isSymbol'; +import isSymbol from './isSymbol.js'; /** * Compares values to sort them in ascending order. diff --git a/_compareMultiple.js b/_compareMultiple.js index 2f34783e6..06e755733 100644 --- a/_compareMultiple.js +++ b/_compareMultiple.js @@ -1,4 +1,4 @@ -import compareAscending from './_compareAscending'; +import compareAscending from './_compareAscending.js'; /** * Used by `_.orderBy` to compare multiple properties of a value to another diff --git a/_copyObject.js b/_copyObject.js index 054a603e4..03d6a671f 100644 --- a/_copyObject.js +++ b/_copyObject.js @@ -1,4 +1,4 @@ -import assignValue from './_assignValue'; +import assignValue from './_assignValue.js'; /** * Copies properties of `source` to `object`. diff --git a/_copySymbols.js b/_copySymbols.js index 54da1b6d1..abf914c41 100644 --- a/_copySymbols.js +++ b/_copySymbols.js @@ -1,5 +1,5 @@ -import copyObject from './_copyObject'; -import getSymbols from './_getSymbols'; +import copyObject from './_copyObject.js'; +import getSymbols from './_getSymbols.js'; /** * Copies own symbol properties of `source` to `object`. diff --git a/_coreJsData.js b/_coreJsData.js new file mode 100644 index 000000000..2ad4fc142 --- /dev/null +++ b/_coreJsData.js @@ -0,0 +1,6 @@ +import root from './_root.js'; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +export default coreJsData; diff --git a/_createAggregator.js b/_createAggregator.js index 168b7f298..dafa4c107 100644 --- a/_createAggregator.js +++ b/_createAggregator.js @@ -1,7 +1,7 @@ -import arrayAggregator from './_arrayAggregator'; -import baseAggregator from './_baseAggregator'; -import baseIteratee from './_baseIteratee'; -import isArray from './isArray'; +import arrayAggregator from './_arrayAggregator.js'; +import baseAggregator from './_baseAggregator.js'; +import baseIteratee from './_baseIteratee.js'; +import isArray from './isArray.js'; /** * Creates a function like `_.groupBy`. diff --git a/_createAssigner.js b/_createAssigner.js index f27a167fa..f309b2f35 100644 --- a/_createAssigner.js +++ b/_createAssigner.js @@ -1,5 +1,5 @@ -import isIterateeCall from './_isIterateeCall'; -import rest from './rest'; +import isIterateeCall from './_isIterateeCall.js'; +import rest from './rest.js'; /** * Creates a function like `_.assign`. diff --git a/_createBaseEach.js b/_createBaseEach.js index b996be35a..2c3181bac 100644 --- a/_createBaseEach.js +++ b/_createBaseEach.js @@ -1,4 +1,4 @@ -import isArrayLike from './isArrayLike'; +import isArrayLike from './isArrayLike.js'; /** * Creates a `baseEach` or `baseEachRight` function. diff --git a/_createBaseWrapper.js b/_createBaseWrapper.js index d14365731..9e968d62d 100644 --- a/_createBaseWrapper.js +++ b/_createBaseWrapper.js @@ -1,5 +1,5 @@ -import createCtorWrapper from './_createCtorWrapper'; -import root from './_root'; +import createCtorWrapper from './_createCtorWrapper.js'; +import root from './_root.js'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1; diff --git a/_createCaseFirst.js b/_createCaseFirst.js index 3d8649fb7..f569ce8c7 100644 --- a/_createCaseFirst.js +++ b/_createCaseFirst.js @@ -1,7 +1,7 @@ -import castSlice from './_castSlice'; -import reHasComplexSymbol from './_reHasComplexSymbol'; -import stringToArray from './_stringToArray'; -import toString from './toString'; +import castSlice from './_castSlice.js'; +import reHasComplexSymbol from './_reHasComplexSymbol.js'; +import stringToArray from './_stringToArray.js'; +import toString from './toString.js'; /** * Creates a function like `_.lowerFirst`. diff --git a/_createCompounder.js b/_createCompounder.js index 818912f4f..f3503fb01 100644 --- a/_createCompounder.js +++ b/_createCompounder.js @@ -1,6 +1,6 @@ -import arrayReduce from './_arrayReduce'; -import deburr from './deburr'; -import words from './words'; +import arrayReduce from './_arrayReduce.js'; +import deburr from './deburr.js'; +import words from './words.js'; /** Used to compose unicode capture groups. */ var rsApos = "['\u2019]"; diff --git a/_createCtorWrapper.js b/_createCtorWrapper.js index a1159a2c1..d57b5818d 100644 --- a/_createCtorWrapper.js +++ b/_createCtorWrapper.js @@ -1,5 +1,5 @@ -import baseCreate from './_baseCreate'; -import isObject from './isObject'; +import baseCreate from './_baseCreate.js'; +import isObject from './isObject.js'; /** * Creates a function that produces an instance of `Ctor` regardless of diff --git a/_createCurryWrapper.js b/_createCurryWrapper.js index cb24d3f27..ccb39b297 100644 --- a/_createCurryWrapper.js +++ b/_createCurryWrapper.js @@ -1,10 +1,10 @@ -import apply from './_apply'; -import createCtorWrapper from './_createCtorWrapper'; -import createHybridWrapper from './_createHybridWrapper'; -import createRecurryWrapper from './_createRecurryWrapper'; -import getHolder from './_getHolder'; -import replaceHolders from './_replaceHolders'; -import root from './_root'; +import apply from './_apply.js'; +import createCtorWrapper from './_createCtorWrapper.js'; +import createHybridWrapper from './_createHybridWrapper.js'; +import createRecurryWrapper from './_createRecurryWrapper.js'; +import getHolder from './_getHolder.js'; +import replaceHolders from './_replaceHolders.js'; +import root from './_root.js'; /** * Creates a function that wraps `func` to enable currying. diff --git a/_createFlow.js b/_createFlow.js index 8472b9761..b4ae81768 100644 --- a/_createFlow.js +++ b/_createFlow.js @@ -1,10 +1,10 @@ -import LodashWrapper from './_LodashWrapper'; -import baseFlatten from './_baseFlatten'; -import getData from './_getData'; -import getFuncName from './_getFuncName'; -import isArray from './isArray'; -import isLaziable from './_isLaziable'; -import rest from './rest'; +import LodashWrapper from './_LodashWrapper.js'; +import baseFlatten from './_baseFlatten.js'; +import getData from './_getData.js'; +import getFuncName from './_getFuncName.js'; +import isArray from './isArray.js'; +import isLaziable from './_isLaziable.js'; +import rest from './rest.js'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; diff --git a/_createHybridWrapper.js b/_createHybridWrapper.js index 0b9226937..bb20e8b2c 100644 --- a/_createHybridWrapper.js +++ b/_createHybridWrapper.js @@ -1,12 +1,12 @@ -import composeArgs from './_composeArgs'; -import composeArgsRight from './_composeArgsRight'; -import countHolders from './_countHolders'; -import createCtorWrapper from './_createCtorWrapper'; -import createRecurryWrapper from './_createRecurryWrapper'; -import getHolder from './_getHolder'; -import reorder from './_reorder'; -import replaceHolders from './_replaceHolders'; -import root from './_root'; +import composeArgs from './_composeArgs.js'; +import composeArgsRight from './_composeArgsRight.js'; +import countHolders from './_countHolders.js'; +import createCtorWrapper from './_createCtorWrapper.js'; +import createRecurryWrapper from './_createRecurryWrapper.js'; +import getHolder from './_getHolder.js'; +import reorder from './_reorder.js'; +import replaceHolders from './_replaceHolders.js'; +import root from './_root.js'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, diff --git a/_createInverter.js b/_createInverter.js index 9c86e9fd9..3db3f12df 100644 --- a/_createInverter.js +++ b/_createInverter.js @@ -1,4 +1,4 @@ -import baseInverter from './_baseInverter'; +import baseInverter from './_baseInverter.js'; /** * Creates a function like `_.invertBy`. diff --git a/_createMathOperation.js b/_createMathOperation.js index ce9e2eb86..1a9bbf8e9 100644 --- a/_createMathOperation.js +++ b/_createMathOperation.js @@ -1,5 +1,5 @@ -import baseToNumber from './_baseToNumber'; -import baseToString from './_baseToString'; +import baseToNumber from './_baseToNumber.js'; +import baseToString from './_baseToString.js'; /** * Creates a function that performs a mathematical operation on two values. diff --git a/_createOver.js b/_createOver.js index b44f22d58..e915e9390 100644 --- a/_createOver.js +++ b/_createOver.js @@ -1,11 +1,11 @@ -import apply from './_apply'; -import arrayMap from './_arrayMap'; -import baseFlatten from './_baseFlatten'; -import baseIteratee from './_baseIteratee'; -import baseUnary from './_baseUnary'; -import isArray from './isArray'; -import isFlattenableIteratee from './_isFlattenableIteratee'; -import rest from './rest'; +import apply from './_apply.js'; +import arrayMap from './_arrayMap.js'; +import baseFlatten from './_baseFlatten.js'; +import baseIteratee from './_baseIteratee.js'; +import baseUnary from './_baseUnary.js'; +import isArray from './isArray.js'; +import isFlattenableIteratee from './_isFlattenableIteratee.js'; +import rest from './rest.js'; /** * Creates a function like `_.over`. diff --git a/_createPadding.js b/_createPadding.js index f4e9e037a..b1653992f 100644 --- a/_createPadding.js +++ b/_createPadding.js @@ -1,9 +1,9 @@ -import baseRepeat from './_baseRepeat'; -import baseToString from './_baseToString'; -import castSlice from './_castSlice'; -import reHasComplexSymbol from './_reHasComplexSymbol'; -import stringSize from './_stringSize'; -import stringToArray from './_stringToArray'; +import baseRepeat from './_baseRepeat.js'; +import baseToString from './_baseToString.js'; +import castSlice from './_castSlice.js'; +import reHasComplexSymbol from './_reHasComplexSymbol.js'; +import stringSize from './_stringSize.js'; +import stringToArray from './_stringToArray.js'; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil; diff --git a/_createPartialWrapper.js b/_createPartialWrapper.js index 8a472926a..3eef9bac4 100644 --- a/_createPartialWrapper.js +++ b/_createPartialWrapper.js @@ -1,6 +1,6 @@ -import apply from './_apply'; -import createCtorWrapper from './_createCtorWrapper'; -import root from './_root'; +import apply from './_apply.js'; +import createCtorWrapper from './_createCtorWrapper.js'; +import root from './_root.js'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1; diff --git a/_createRange.js b/_createRange.js index 0d94df11f..1807d2c39 100644 --- a/_createRange.js +++ b/_createRange.js @@ -1,6 +1,6 @@ -import baseRange from './_baseRange'; -import isIterateeCall from './_isIterateeCall'; -import toNumber from './toNumber'; +import baseRange from './_baseRange.js'; +import isIterateeCall from './_isIterateeCall.js'; +import toNumber from './toNumber.js'; /** * Creates a `_.range` or `_.rangeRight` function. diff --git a/_createRecurryWrapper.js b/_createRecurryWrapper.js index 6df8c24f6..2d647cda3 100644 --- a/_createRecurryWrapper.js +++ b/_createRecurryWrapper.js @@ -1,5 +1,5 @@ -import isLaziable from './_isLaziable'; -import setData from './_setData'; +import isLaziable from './_isLaziable.js'; +import setData from './_setData.js'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, diff --git a/_createRelationalOperation.js b/_createRelationalOperation.js index 9fd7bacc9..ea208c6a0 100644 --- a/_createRelationalOperation.js +++ b/_createRelationalOperation.js @@ -1,4 +1,4 @@ -import toNumber from './toNumber'; +import toNumber from './toNumber.js'; /** * Creates a function that performs a relational operation on two values. diff --git a/_createRound.js b/_createRound.js index f0efe5f0e..ab9ec8da7 100644 --- a/_createRound.js +++ b/_createRound.js @@ -1,6 +1,9 @@ -import toInteger from './toInteger'; -import toNumber from './toNumber'; -import toString from './toString'; +import toInteger from './toInteger.js'; +import toNumber from './toNumber.js'; +import toString from './toString.js'; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; /** * Creates a function like `_.round`. @@ -13,7 +16,7 @@ function createRound(methodName) { var func = Math[methodName]; return function(number, precision) { number = toNumber(number); - precision = toInteger(precision); + precision = nativeMin(toInteger(precision), 292); if (precision) { // Shift with exponential notation to avoid floating-point issues. // See [MDN](https://mdn.io/round#Examples) for more details. diff --git a/_createSet.js b/_createSet.js index c049bb0bb..f6062e5b3 100644 --- a/_createSet.js +++ b/_createSet.js @@ -1,6 +1,6 @@ -import Set from './_Set'; -import noop from './noop'; -import setToArray from './_setToArray'; +import Set from './_Set.js'; +import noop from './noop.js'; +import setToArray from './_setToArray.js'; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; diff --git a/_createToPairs.js b/_createToPairs.js index 88d139153..433d654b6 100644 --- a/_createToPairs.js +++ b/_createToPairs.js @@ -1,7 +1,7 @@ -import baseToPairs from './_baseToPairs'; -import getTag from './_getTag'; -import mapToArray from './_mapToArray'; -import setToPairs from './_setToPairs'; +import baseToPairs from './_baseToPairs.js'; +import getTag from './_getTag.js'; +import mapToArray from './_mapToArray.js'; +import setToPairs from './_setToPairs.js'; /** `Object#toString` result references. */ var mapTag = '[object Map]', diff --git a/_createWrapper.js b/_createWrapper.js index eca547642..b5b219f5e 100644 --- a/_createWrapper.js +++ b/_createWrapper.js @@ -1,12 +1,12 @@ -import baseSetData from './_baseSetData'; -import createBaseWrapper from './_createBaseWrapper'; -import createCurryWrapper from './_createCurryWrapper'; -import createHybridWrapper from './_createHybridWrapper'; -import createPartialWrapper from './_createPartialWrapper'; -import getData from './_getData'; -import mergeData from './_mergeData'; -import setData from './_setData'; -import toInteger from './toInteger'; +import baseSetData from './_baseSetData.js'; +import createBaseWrapper from './_createBaseWrapper.js'; +import createCurryWrapper from './_createCurryWrapper.js'; +import createHybridWrapper from './_createHybridWrapper.js'; +import createPartialWrapper from './_createPartialWrapper.js'; +import getData from './_getData.js'; +import mergeData from './_mergeData.js'; +import setData from './_setData.js'; +import toInteger from './toInteger.js'; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; diff --git a/_equalArrays.js b/_equalArrays.js index b13f4d265..4ed5fcb1f 100644 --- a/_equalArrays.js +++ b/_equalArrays.js @@ -1,5 +1,5 @@ -import SetCache from './_SetCache'; -import arraySome from './_arraySome'; +import SetCache from './_SetCache.js'; +import arraySome from './_arraySome.js'; /** Used to compose bitmasks for comparison styles. */ var UNORDERED_COMPARE_FLAG = 1, diff --git a/_equalByTag.js b/_equalByTag.js index d7ba39775..334769de7 100644 --- a/_equalByTag.js +++ b/_equalByTag.js @@ -1,8 +1,8 @@ -import Symbol from './_Symbol'; -import Uint8Array from './_Uint8Array'; -import equalArrays from './_equalArrays'; -import mapToArray from './_mapToArray'; -import setToArray from './_setToArray'; +import Symbol from './_Symbol.js'; +import Uint8Array from './_Uint8Array.js'; +import equalArrays from './_equalArrays.js'; +import mapToArray from './_mapToArray.js'; +import setToArray from './_setToArray.js'; /** Used to compose bitmasks for comparison styles. */ var UNORDERED_COMPARE_FLAG = 1, diff --git a/_equalObjects.js b/_equalObjects.js index 59b7fbc9d..93facbc10 100644 --- a/_equalObjects.js +++ b/_equalObjects.js @@ -1,5 +1,5 @@ -import baseHas from './_baseHas'; -import keys from './keys'; +import baseHas from './_baseHas.js'; +import keys from './keys.js'; /** Used to compose bitmasks for comparison styles. */ var PARTIAL_COMPARE_FLAG = 2; diff --git a/_getAllKeys.js b/_getAllKeys.js index 468ae4a19..e9a6772e4 100644 --- a/_getAllKeys.js +++ b/_getAllKeys.js @@ -1,6 +1,6 @@ -import baseGetAllKeys from './_baseGetAllKeys'; -import getSymbols from './_getSymbols'; -import keys from './keys'; +import baseGetAllKeys from './_baseGetAllKeys.js'; +import getSymbols from './_getSymbols.js'; +import keys from './keys.js'; /** * Creates an array of own enumerable property names and symbols of `object`. diff --git a/_getAllKeysIn.js b/_getAllKeysIn.js index 6fed31afa..d7fac96f8 100644 --- a/_getAllKeysIn.js +++ b/_getAllKeysIn.js @@ -1,6 +1,6 @@ -import baseGetAllKeys from './_baseGetAllKeys'; -import getSymbolsIn from './_getSymbolsIn'; -import keysIn from './keysIn'; +import baseGetAllKeys from './_baseGetAllKeys.js'; +import getSymbolsIn from './_getSymbolsIn.js'; +import keysIn from './keysIn.js'; /** * Creates an array of own and inherited enumerable property names and diff --git a/_getData.js b/_getData.js index d598853a9..36265ebdd 100644 --- a/_getData.js +++ b/_getData.js @@ -1,5 +1,5 @@ -import metaMap from './_metaMap'; -import noop from './noop'; +import metaMap from './_metaMap.js'; +import noop from './noop.js'; /** * Gets metadata for `func`. diff --git a/_getFuncName.js b/_getFuncName.js index 410468b97..06e2a3d9e 100644 --- a/_getFuncName.js +++ b/_getFuncName.js @@ -1,4 +1,4 @@ -import realNames from './_realNames'; +import realNames from './_realNames.js'; /** Used for built-in method references. */ var objectProto = Object.prototype; diff --git a/_getLength.js b/_getLength.js index db48bc193..e0534cafb 100644 --- a/_getLength.js +++ b/_getLength.js @@ -1,4 +1,4 @@ -import baseProperty from './_baseProperty'; +import baseProperty from './_baseProperty.js'; /** * Gets the "length" property value of `object`. diff --git a/_getMapData.js b/_getMapData.js index adcbb6bde..6f55f4f79 100644 --- a/_getMapData.js +++ b/_getMapData.js @@ -1,4 +1,4 @@ -import isKeyable from './_isKeyable'; +import isKeyable from './_isKeyable.js'; /** * Gets the data for `map`. diff --git a/_getMatchData.js b/_getMatchData.js index de84bb721..545d3e89f 100644 --- a/_getMatchData.js +++ b/_getMatchData.js @@ -1,5 +1,5 @@ -import isStrictComparable from './_isStrictComparable'; -import toPairs from './toPairs'; +import isStrictComparable from './_isStrictComparable.js'; +import keys from './keys.js'; /** * Gets the property names, values, and compare flags of `object`. @@ -9,11 +9,14 @@ import toPairs from './toPairs'; * @returns {Array} Returns the match data of `object`. */ function getMatchData(object) { - var result = toPairs(object), + var result = keys(object), length = result.length; while (length--) { - result[length][2] = isStrictComparable(result[length][1]); + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; } return result; } diff --git a/_getNative.js b/_getNative.js index a1dccd550..d2cb43860 100644 --- a/_getNative.js +++ b/_getNative.js @@ -1,4 +1,5 @@ -import isNative from './isNative'; +import baseIsNative from './_baseIsNative.js'; +import getValue from './_getValue.js'; /** * Gets the native function at `key` of `object`. @@ -9,8 +10,8 @@ import isNative from './isNative'; * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { - var value = object[key]; - return isNative(value) ? value : undefined; + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; } export default getNative; diff --git a/_getSymbols.js b/_getSymbols.js index b83d3b9a1..cdb107c4f 100644 --- a/_getSymbols.js +++ b/_getSymbols.js @@ -1,3 +1,5 @@ +import stubArray from './stubArray.js'; + /** Built-in value references. */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; @@ -16,9 +18,7 @@ function getSymbols(object) { // Fallback for IE < 11. if (!getOwnPropertySymbols) { - getSymbols = function() { - return []; - }; + getSymbols = stubArray; } export default getSymbols; diff --git a/_getSymbolsIn.js b/_getSymbolsIn.js index 509422009..27bb01c73 100644 --- a/_getSymbolsIn.js +++ b/_getSymbolsIn.js @@ -1,6 +1,6 @@ -import arrayPush from './_arrayPush'; -import getPrototype from './_getPrototype'; -import getSymbols from './_getSymbols'; +import arrayPush from './_arrayPush.js'; +import getPrototype from './_getPrototype.js'; +import getSymbols from './_getSymbols.js'; /** Built-in value references. */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; diff --git a/_getTag.js b/_getTag.js index d9c3884ec..8b1abd4ef 100644 --- a/_getTag.js +++ b/_getTag.js @@ -1,9 +1,9 @@ -import DataView from './_DataView'; -import Map from './_Map'; -import Promise from './_Promise'; -import Set from './_Set'; -import WeakMap from './_WeakMap'; -import toSource from './_toSource'; +import DataView from './_DataView.js'; +import Map from './_Map.js'; +import Promise from './_Promise.js'; +import Set from './_Set.js'; +import WeakMap from './_WeakMap.js'; +import toSource from './_toSource.js'; /** `Object#toString` result references. */ var mapTag = '[object Map]', diff --git a/_getValue.js b/_getValue.js new file mode 100644 index 000000000..cbdd538d0 --- /dev/null +++ b/_getValue.js @@ -0,0 +1,13 @@ +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +export default getValue; diff --git a/_hasPath.js b/_hasPath.js index 9dd99305c..669355eb4 100644 --- a/_hasPath.js +++ b/_hasPath.js @@ -1,11 +1,11 @@ -import castPath from './_castPath'; -import isArguments from './isArguments'; -import isArray from './isArray'; -import isIndex from './_isIndex'; -import isKey from './_isKey'; -import isLength from './isLength'; -import isString from './isString'; -import toKey from './_toKey'; +import castPath from './_castPath.js'; +import isArguments from './isArguments.js'; +import isArray from './isArray.js'; +import isIndex from './_isIndex.js'; +import isKey from './_isKey.js'; +import isLength from './isLength.js'; +import isString from './isString.js'; +import toKey from './_toKey.js'; /** * Checks if `path` exists on `object`. diff --git a/_hashClear.js b/_hashClear.js index ac510cebe..e7f7ab5ef 100644 --- a/_hashClear.js +++ b/_hashClear.js @@ -1,4 +1,4 @@ -import nativeCreate from './_nativeCreate'; +import nativeCreate from './_nativeCreate.js'; /** * Removes all key-value entries from the hash. diff --git a/_hashGet.js b/_hashGet.js index 4e8c118f5..4a3f43b27 100644 --- a/_hashGet.js +++ b/_hashGet.js @@ -1,4 +1,4 @@ -import nativeCreate from './_nativeCreate'; +import nativeCreate from './_nativeCreate.js'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; diff --git a/_hashHas.js b/_hashHas.js index e1b698309..8de3daad2 100644 --- a/_hashHas.js +++ b/_hashHas.js @@ -1,4 +1,4 @@ -import nativeCreate from './_nativeCreate'; +import nativeCreate from './_nativeCreate.js'; /** Used for built-in method references. */ var objectProto = Object.prototype; diff --git a/_hashSet.js b/_hashSet.js index 37227ed7b..13af365f6 100644 --- a/_hashSet.js +++ b/_hashSet.js @@ -1,4 +1,4 @@ -import nativeCreate from './_nativeCreate'; +import nativeCreate from './_nativeCreate.js'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; diff --git a/_indexKeys.js b/_indexKeys.js index 67c2f07c3..243f81505 100644 --- a/_indexKeys.js +++ b/_indexKeys.js @@ -1,8 +1,8 @@ -import baseTimes from './_baseTimes'; -import isArguments from './isArguments'; -import isArray from './isArray'; -import isLength from './isLength'; -import isString from './isString'; +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, diff --git a/_indexOfNaN.js b/_indexOfNaN.js index 5c089661c..5a8f0225e 100644 --- a/_indexOfNaN.js +++ b/_indexOfNaN.js @@ -9,7 +9,7 @@ */ function indexOfNaN(array, fromIndex, fromRight) { var length = array.length, - index = fromIndex + (fromRight ? 0 : -1); + index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { var other = array[index]; diff --git a/_initCloneByTag.js b/_initCloneByTag.js index 5f4e14a41..f7f3eac58 100644 --- a/_initCloneByTag.js +++ b/_initCloneByTag.js @@ -1,10 +1,10 @@ -import cloneArrayBuffer from './_cloneArrayBuffer'; -import cloneDataView from './_cloneDataView'; -import cloneMap from './_cloneMap'; -import cloneRegExp from './_cloneRegExp'; -import cloneSet from './_cloneSet'; -import cloneSymbol from './_cloneSymbol'; -import cloneTypedArray from './_cloneTypedArray'; +import cloneArrayBuffer from './_cloneArrayBuffer.js'; +import cloneDataView from './_cloneDataView.js'; +import cloneMap from './_cloneMap.js'; +import cloneRegExp from './_cloneRegExp.js'; +import cloneSet from './_cloneSet.js'; +import cloneSymbol from './_cloneSymbol.js'; +import cloneTypedArray from './_cloneTypedArray.js'; /** `Object#toString` result references. */ var boolTag = '[object Boolean]', diff --git a/_initCloneObject.js b/_initCloneObject.js index de21f6966..bdcf19b0a 100644 --- a/_initCloneObject.js +++ b/_initCloneObject.js @@ -1,6 +1,6 @@ -import baseCreate from './_baseCreate'; -import getPrototype from './_getPrototype'; -import isPrototype from './_isPrototype'; +import baseCreate from './_baseCreate.js'; +import getPrototype from './_getPrototype.js'; +import isPrototype from './_isPrototype.js'; /** * Initializes an object clone. diff --git a/_isFlattenable.js b/_isFlattenable.js index bac7447f7..3fbb434dc 100644 --- a/_isFlattenable.js +++ b/_isFlattenable.js @@ -1,5 +1,5 @@ -import isArguments from './isArguments'; -import isArray from './isArray'; +import isArguments from './isArguments.js'; +import isArray from './isArray.js'; /** * Checks if `value` is a flattenable `arguments` object or array. diff --git a/_isFlattenableIteratee.js b/_isFlattenableIteratee.js index 61a54ed44..63359df44 100644 --- a/_isFlattenableIteratee.js +++ b/_isFlattenableIteratee.js @@ -1,5 +1,5 @@ -import isArray from './isArray'; -import isFunction from './isFunction'; +import isArray from './isArray.js'; +import isFunction from './isFunction.js'; /** * Checks if `value` is a flattenable array and not a `_.matchesProperty` diff --git a/_isIterateeCall.js b/_isIterateeCall.js index 4eae5b2dd..1fb6dc93d 100644 --- a/_isIterateeCall.js +++ b/_isIterateeCall.js @@ -1,7 +1,7 @@ -import eq from './eq'; -import isArrayLike from './isArrayLike'; -import isIndex from './_isIndex'; -import isObject from './isObject'; +import eq from './eq.js'; +import isArrayLike from './isArrayLike.js'; +import isIndex from './_isIndex.js'; +import isObject from './isObject.js'; /** * Checks if the given arguments are from an iteratee call. diff --git a/_isKey.js b/_isKey.js index 7226c0a5e..3e36bce80 100644 --- a/_isKey.js +++ b/_isKey.js @@ -1,5 +1,5 @@ -import isArray from './isArray'; -import isSymbol from './isSymbol'; +import isArray from './isArray.js'; +import isSymbol from './isSymbol.js'; /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, diff --git a/_isLaziable.js b/_isLaziable.js index 8ebec971b..45a8b1fcd 100644 --- a/_isLaziable.js +++ b/_isLaziable.js @@ -1,7 +1,7 @@ -import LazyWrapper from './_LazyWrapper'; -import getData from './_getData'; -import getFuncName from './_getFuncName'; -import lodash from './wrapperLodash'; +import LazyWrapper from './_LazyWrapper.js'; +import getData from './_getData.js'; +import getFuncName from './_getFuncName.js'; +import lodash from './wrapperLodash.js'; /** * Checks if `func` has a lazy counterpart. diff --git a/_isMaskable.js b/_isMaskable.js new file mode 100644 index 000000000..3a4ffd11a --- /dev/null +++ b/_isMaskable.js @@ -0,0 +1,14 @@ +import coreJsData from './_coreJsData.js'; +import isFunction from './isFunction.js'; +import stubFalse from './stubFalse.js'; + +/** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ +var isMaskable = !coreJsData ? stubFalse : isFunction; + +export default isMaskable; diff --git a/_isMasked.js b/_isMasked.js new file mode 100644 index 000000000..e3f9d6f4f --- /dev/null +++ b/_isMasked.js @@ -0,0 +1,20 @@ +import coreJsData from './_coreJsData.js'; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +export default isMasked; diff --git a/_isStrictComparable.js b/_isStrictComparable.js index 97be5a20b..087efddb1 100644 --- a/_isStrictComparable.js +++ b/_isStrictComparable.js @@ -1,4 +1,4 @@ -import isObject from './isObject'; +import isObject from './isObject.js'; /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. diff --git a/_lazyClone.js b/_lazyClone.js index e51a13d69..d2f162904 100644 --- a/_lazyClone.js +++ b/_lazyClone.js @@ -1,5 +1,5 @@ -import LazyWrapper from './_LazyWrapper'; -import copyArray from './_copyArray'; +import LazyWrapper from './_LazyWrapper.js'; +import copyArray from './_copyArray.js'; /** * Creates a clone of the lazy wrapper object. diff --git a/_lazyReverse.js b/_lazyReverse.js index fbc1a34c7..e79a9bc84 100644 --- a/_lazyReverse.js +++ b/_lazyReverse.js @@ -1,4 +1,4 @@ -import LazyWrapper from './_LazyWrapper'; +import LazyWrapper from './_LazyWrapper.js'; /** * Reverses the direction of lazy iteration. diff --git a/_lazyValue.js b/_lazyValue.js index 0fa97c62a..1eac26965 100644 --- a/_lazyValue.js +++ b/_lazyValue.js @@ -1,6 +1,6 @@ -import baseWrapperValue from './_baseWrapperValue'; -import getView from './_getView'; -import isArray from './isArray'; +import baseWrapperValue from './_baseWrapperValue.js'; +import getView from './_getView.js'; +import isArray from './isArray.js'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; diff --git a/_listCacheDelete.js b/_listCacheDelete.js index 9d7bac53e..72b3453c3 100644 --- a/_listCacheDelete.js +++ b/_listCacheDelete.js @@ -1,4 +1,4 @@ -import assocIndexOf from './_assocIndexOf'; +import assocIndexOf from './_assocIndexOf.js'; /** Used for built-in method references. */ var arrayProto = Array.prototype; diff --git a/_listCacheGet.js b/_listCacheGet.js index 7a52b08f1..53ce0017d 100644 --- a/_listCacheGet.js +++ b/_listCacheGet.js @@ -1,4 +1,4 @@ -import assocIndexOf from './_assocIndexOf'; +import assocIndexOf from './_assocIndexOf.js'; /** * Gets the list cache value for `key`. diff --git a/_listCacheHas.js b/_listCacheHas.js index 3db6fade0..8701cae28 100644 --- a/_listCacheHas.js +++ b/_listCacheHas.js @@ -1,4 +1,4 @@ -import assocIndexOf from './_assocIndexOf'; +import assocIndexOf from './_assocIndexOf.js'; /** * Checks if a list cache value for `key` exists. diff --git a/_listCacheSet.js b/_listCacheSet.js index a6c468365..5777e0557 100644 --- a/_listCacheSet.js +++ b/_listCacheSet.js @@ -1,4 +1,4 @@ -import assocIndexOf from './_assocIndexOf'; +import assocIndexOf from './_assocIndexOf.js'; /** * Sets the list cache `key` to `value`. diff --git a/_mapCacheClear.js b/_mapCacheClear.js index d10073fc5..1a8dc6cb3 100644 --- a/_mapCacheClear.js +++ b/_mapCacheClear.js @@ -1,6 +1,6 @@ -import Hash from './_Hash'; -import ListCache from './_ListCache'; -import Map from './_Map'; +import Hash from './_Hash.js'; +import ListCache from './_ListCache.js'; +import Map from './_Map.js'; /** * Removes all key-value entries from the map. diff --git a/_mapCacheDelete.js b/_mapCacheDelete.js index 88b896f30..e8614a598 100644 --- a/_mapCacheDelete.js +++ b/_mapCacheDelete.js @@ -1,4 +1,4 @@ -import getMapData from './_getMapData'; +import getMapData from './_getMapData.js'; /** * Removes `key` and its value from the map. diff --git a/_mapCacheGet.js b/_mapCacheGet.js index d6c7c468a..3b481e0fb 100644 --- a/_mapCacheGet.js +++ b/_mapCacheGet.js @@ -1,4 +1,4 @@ -import getMapData from './_getMapData'; +import getMapData from './_getMapData.js'; /** * Gets the map value for `key`. diff --git a/_mapCacheHas.js b/_mapCacheHas.js index d64e370d8..9de3e7f6f 100644 --- a/_mapCacheHas.js +++ b/_mapCacheHas.js @@ -1,4 +1,4 @@ -import getMapData from './_getMapData'; +import getMapData from './_getMapData.js'; /** * Checks if a map value for `key` exists. diff --git a/_mapCacheSet.js b/_mapCacheSet.js index f8a6cd728..b10aeda33 100644 --- a/_mapCacheSet.js +++ b/_mapCacheSet.js @@ -1,4 +1,4 @@ -import getMapData from './_getMapData'; +import getMapData from './_getMapData.js'; /** * Sets the map `key` to `value`. diff --git a/_mergeData.js b/_mergeData.js index 1b0b4d6a6..c22fbd996 100644 --- a/_mergeData.js +++ b/_mergeData.js @@ -1,6 +1,6 @@ -import composeArgs from './_composeArgs'; -import composeArgsRight from './_composeArgsRight'; -import replaceHolders from './_replaceHolders'; +import composeArgs from './_composeArgs.js'; +import composeArgsRight from './_composeArgsRight.js'; +import replaceHolders from './_replaceHolders.js'; /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; diff --git a/_mergeDefaults.js b/_mergeDefaults.js index e469ca6ef..b262d18f2 100644 --- a/_mergeDefaults.js +++ b/_mergeDefaults.js @@ -1,5 +1,5 @@ -import baseMerge from './_baseMerge'; -import isObject from './isObject'; +import baseMerge from './_baseMerge.js'; +import isObject from './isObject.js'; /** * Used by `_.defaultsDeep` to customize its `_.merge` use. diff --git a/_metaMap.js b/_metaMap.js index 02ab0e582..d7e5b9518 100644 --- a/_metaMap.js +++ b/_metaMap.js @@ -1,4 +1,4 @@ -import WeakMap from './_WeakMap'; +import WeakMap from './_WeakMap.js'; /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; diff --git a/_nativeCreate.js b/_nativeCreate.js index 6444b749a..27b476bc5 100644 --- a/_nativeCreate.js +++ b/_nativeCreate.js @@ -1,4 +1,4 @@ -import getNative from './_getNative'; +import getNative from './_getNative.js'; /* Built-in method references that are verified to be native. */ var nativeCreate = getNative(Object, 'create'); diff --git a/_parent.js b/_parent.js index 2f20c1442..aab10e6cc 100644 --- a/_parent.js +++ b/_parent.js @@ -1,5 +1,5 @@ -import baseGet from './_baseGet'; -import baseSlice from './_baseSlice'; +import baseGet from './_baseGet.js'; +import baseSlice from './_baseSlice.js'; /** * Gets the parent value at `path` of `object`. diff --git a/_reorder.js b/_reorder.js index 55bbdcc49..b7ade47a6 100644 --- a/_reorder.js +++ b/_reorder.js @@ -1,5 +1,5 @@ -import copyArray from './_copyArray'; -import isIndex from './_isIndex'; +import copyArray from './_copyArray.js'; +import isIndex from './_isIndex.js'; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMin = Math.min; diff --git a/_root.js b/_root.js index 8f97b7899..45b72b891 100644 --- a/_root.js +++ b/_root.js @@ -1,41 +1,15 @@ -import checkGlobal from './_checkGlobal'; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; +import checkGlobal from './_checkGlobal.js'; /** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); +var freeGlobal = checkGlobal(typeof global == 'object' && global); /** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); +var freeSelf = checkGlobal(typeof self == 'object' && self); /** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); +var thisGlobal = checkGlobal(typeof this == 'object' && this); -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || thisGlobal || Function('return this')(); export default root; diff --git a/_setData.js b/_setData.js index bf761f2b4..38cae5be8 100644 --- a/_setData.js +++ b/_setData.js @@ -1,5 +1,5 @@ -import baseSetData from './_baseSetData'; -import now from './now'; +import baseSetData from './_baseSetData.js'; +import now from './now.js'; /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 150, diff --git a/_stackClear.js b/_stackClear.js index d39f417fc..763cb12b2 100644 --- a/_stackClear.js +++ b/_stackClear.js @@ -1,4 +1,4 @@ -import ListCache from './_ListCache'; +import ListCache from './_ListCache.js'; /** * Removes all key-value entries from the stack. diff --git a/_stackSet.js b/_stackSet.js index fe646275f..719f20b2b 100644 --- a/_stackSet.js +++ b/_stackSet.js @@ -1,5 +1,5 @@ -import ListCache from './_ListCache'; -import MapCache from './_MapCache'; +import ListCache from './_ListCache.js'; +import MapCache from './_MapCache.js'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; diff --git a/_stringSize.js b/_stringSize.js index c85c6cbcb..1109286ae 100644 --- a/_stringSize.js +++ b/_stringSize.js @@ -1,4 +1,4 @@ -import reHasComplexSymbol from './_reHasComplexSymbol'; +import reHasComplexSymbol from './_reHasComplexSymbol.js'; /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', diff --git a/_stringToPath.js b/_stringToPath.js index a7d746f64..7279d4525 100644 --- a/_stringToPath.js +++ b/_stringToPath.js @@ -1,8 +1,8 @@ -import memoize from './memoize'; -import toString from './toString'; +import memoize from './memoize.js'; +import toString from './toString.js'; /** Used to match property names within property paths. */ -var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g; +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; diff --git a/_toKey.js b/_toKey.js index 358003d63..295277f63 100644 --- a/_toKey.js +++ b/_toKey.js @@ -1,4 +1,4 @@ -import isSymbol from './isSymbol'; +import isSymbol from './isSymbol.js'; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; diff --git a/_wrapperClone.js b/_wrapperClone.js index 7fcc05346..8d0d73036 100644 --- a/_wrapperClone.js +++ b/_wrapperClone.js @@ -1,6 +1,6 @@ -import LazyWrapper from './_LazyWrapper'; -import LodashWrapper from './_LodashWrapper'; -import copyArray from './_copyArray'; +import LazyWrapper from './_LazyWrapper.js'; +import LodashWrapper from './_LodashWrapper.js'; +import copyArray from './_copyArray.js'; /** * Creates a clone of `wrapper`. diff --git a/add.js b/add.js index d37311069..7c7e74970 100644 --- a/add.js +++ b/add.js @@ -1,4 +1,4 @@ -import createMathOperation from './_createMathOperation'; +import createMathOperation from './_createMathOperation.js'; /** * Adds two numbers. diff --git a/after.js b/after.js index 78cce6418..79a050dc1 100644 --- a/after.js +++ b/after.js @@ -1,4 +1,4 @@ -import toInteger from './toInteger'; +import toInteger from './toInteger.js'; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; diff --git a/array.default.js b/array.default.js index 4adc415d1..13c079757 100644 --- a/array.default.js +++ b/array.default.js @@ -1,68 +1,68 @@ -import chunk from './chunk'; -import compact from './compact'; -import concat from './concat'; -import difference from './difference'; -import differenceBy from './differenceBy'; -import differenceWith from './differenceWith'; -import drop from './drop'; -import dropRight from './dropRight'; -import dropRightWhile from './dropRightWhile'; -import dropWhile from './dropWhile'; -import fill from './fill'; -import findIndex from './findIndex'; -import findLastIndex from './findLastIndex'; -import first from './first'; -import flatten from './flatten'; -import flattenDeep from './flattenDeep'; -import flattenDepth from './flattenDepth'; -import fromPairs from './fromPairs'; -import head from './head'; -import indexOf from './indexOf'; -import initial from './initial'; -import intersection from './intersection'; -import intersectionBy from './intersectionBy'; -import intersectionWith from './intersectionWith'; -import join from './join'; -import last from './last'; -import lastIndexOf from './lastIndexOf'; -import nth from './nth'; -import pull from './pull'; -import pullAll from './pullAll'; -import pullAllBy from './pullAllBy'; -import pullAllWith from './pullAllWith'; -import pullAt from './pullAt'; -import remove from './remove'; -import reverse from './reverse'; -import slice from './slice'; -import sortedIndex from './sortedIndex'; -import sortedIndexBy from './sortedIndexBy'; -import sortedIndexOf from './sortedIndexOf'; -import sortedLastIndex from './sortedLastIndex'; -import sortedLastIndexBy from './sortedLastIndexBy'; -import sortedLastIndexOf from './sortedLastIndexOf'; -import sortedUniq from './sortedUniq'; -import sortedUniqBy from './sortedUniqBy'; -import tail from './tail'; -import take from './take'; -import takeRight from './takeRight'; -import takeRightWhile from './takeRightWhile'; -import takeWhile from './takeWhile'; -import union from './union'; -import unionBy from './unionBy'; -import unionWith from './unionWith'; -import uniq from './uniq'; -import uniqBy from './uniqBy'; -import uniqWith from './uniqWith'; -import unzip from './unzip'; -import unzipWith from './unzipWith'; -import without from './without'; -import xor from './xor'; -import xorBy from './xorBy'; -import xorWith from './xorWith'; -import zip from './zip'; -import zipObject from './zipObject'; -import zipObjectDeep from './zipObjectDeep'; -import zipWith from './zipWith'; +import chunk from './chunk.js'; +import compact from './compact.js'; +import concat from './concat.js'; +import difference from './difference.js'; +import differenceBy from './differenceBy.js'; +import differenceWith from './differenceWith.js'; +import drop from './drop.js'; +import dropRight from './dropRight.js'; +import dropRightWhile from './dropRightWhile.js'; +import dropWhile from './dropWhile.js'; +import fill from './fill.js'; +import findIndex from './findIndex.js'; +import findLastIndex from './findLastIndex.js'; +import first from './first.js'; +import flatten from './flatten.js'; +import flattenDeep from './flattenDeep.js'; +import flattenDepth from './flattenDepth.js'; +import fromPairs from './fromPairs.js'; +import head from './head.js'; +import indexOf from './indexOf.js'; +import initial from './initial.js'; +import intersection from './intersection.js'; +import intersectionBy from './intersectionBy.js'; +import intersectionWith from './intersectionWith.js'; +import join from './join.js'; +import last from './last.js'; +import lastIndexOf from './lastIndexOf.js'; +import nth from './nth.js'; +import pull from './pull.js'; +import pullAll from './pullAll.js'; +import pullAllBy from './pullAllBy.js'; +import pullAllWith from './pullAllWith.js'; +import pullAt from './pullAt.js'; +import remove from './remove.js'; +import reverse from './reverse.js'; +import slice from './slice.js'; +import sortedIndex from './sortedIndex.js'; +import sortedIndexBy from './sortedIndexBy.js'; +import sortedIndexOf from './sortedIndexOf.js'; +import sortedLastIndex from './sortedLastIndex.js'; +import sortedLastIndexBy from './sortedLastIndexBy.js'; +import sortedLastIndexOf from './sortedLastIndexOf.js'; +import sortedUniq from './sortedUniq.js'; +import sortedUniqBy from './sortedUniqBy.js'; +import tail from './tail.js'; +import take from './take.js'; +import takeRight from './takeRight.js'; +import takeRightWhile from './takeRightWhile.js'; +import takeWhile from './takeWhile.js'; +import union from './union.js'; +import unionBy from './unionBy.js'; +import unionWith from './unionWith.js'; +import uniq from './uniq.js'; +import uniqBy from './uniqBy.js'; +import uniqWith from './uniqWith.js'; +import unzip from './unzip.js'; +import unzipWith from './unzipWith.js'; +import without from './without.js'; +import xor from './xor.js'; +import xorBy from './xorBy.js'; +import xorWith from './xorWith.js'; +import zip from './zip.js'; +import zipObject from './zipObject.js'; +import zipObjectDeep from './zipObjectDeep.js'; +import zipWith from './zipWith.js'; export default { chunk, compact, concat, difference, differenceBy, diff --git a/array.js b/array.js index 9296fc766..acb4afacd 100644 --- a/array.js +++ b/array.js @@ -1,66 +1,66 @@ -export { default as chunk } from './chunk'; -export { default as compact } from './compact'; -export { default as concat } from './concat'; -export { default as difference } from './difference'; -export { default as differenceBy } from './differenceBy'; -export { default as differenceWith } from './differenceWith'; -export { default as drop } from './drop'; -export { default as dropRight } from './dropRight'; -export { default as dropRightWhile } from './dropRightWhile'; -export { default as dropWhile } from './dropWhile'; -export { default as fill } from './fill'; -export { default as findIndex } from './findIndex'; -export { default as findLastIndex } from './findLastIndex'; -export { default as first } from './first'; -export { default as flatten } from './flatten'; -export { default as flattenDeep } from './flattenDeep'; -export { default as flattenDepth } from './flattenDepth'; -export { default as fromPairs } from './fromPairs'; -export { default as head } from './head'; -export { default as indexOf } from './indexOf'; -export { default as initial } from './initial'; -export { default as intersection } from './intersection'; -export { default as intersectionBy } from './intersectionBy'; -export { default as intersectionWith } from './intersectionWith'; -export { default as join } from './join'; -export { default as last } from './last'; -export { default as lastIndexOf } from './lastIndexOf'; -export { default as nth } from './nth'; -export { default as pull } from './pull'; -export { default as pullAll } from './pullAll'; -export { default as pullAllBy } from './pullAllBy'; -export { default as pullAllWith } from './pullAllWith'; -export { default as pullAt } from './pullAt'; -export { default as remove } from './remove'; -export { default as reverse } from './reverse'; -export { default as slice } from './slice'; -export { default as sortedIndex } from './sortedIndex'; -export { default as sortedIndexBy } from './sortedIndexBy'; -export { default as sortedIndexOf } from './sortedIndexOf'; -export { default as sortedLastIndex } from './sortedLastIndex'; -export { default as sortedLastIndexBy } from './sortedLastIndexBy'; -export { default as sortedLastIndexOf } from './sortedLastIndexOf'; -export { default as sortedUniq } from './sortedUniq'; -export { default as sortedUniqBy } from './sortedUniqBy'; -export { default as tail } from './tail'; -export { default as take } from './take'; -export { default as takeRight } from './takeRight'; -export { default as takeRightWhile } from './takeRightWhile'; -export { default as takeWhile } from './takeWhile'; -export { default as union } from './union'; -export { default as unionBy } from './unionBy'; -export { default as unionWith } from './unionWith'; -export { default as uniq } from './uniq'; -export { default as uniqBy } from './uniqBy'; -export { default as uniqWith } from './uniqWith'; -export { default as unzip } from './unzip'; -export { default as unzipWith } from './unzipWith'; -export { default as without } from './without'; -export { default as xor } from './xor'; -export { default as xorBy } from './xorBy'; -export { default as xorWith } from './xorWith'; -export { default as zip } from './zip'; -export { default as zipObject } from './zipObject'; -export { default as zipObjectDeep } from './zipObjectDeep'; -export { default as zipWith } from './zipWith'; +export { default as chunk } from './chunk.js'; +export { default as compact } from './compact.js'; +export { default as concat } from './concat.js'; +export { default as difference } from './difference.js'; +export { default as differenceBy } from './differenceBy.js'; +export { default as differenceWith } from './differenceWith.js'; +export { default as drop } from './drop.js'; +export { default as dropRight } from './dropRight.js'; +export { default as dropRightWhile } from './dropRightWhile.js'; +export { default as dropWhile } from './dropWhile.js'; +export { default as fill } from './fill.js'; +export { default as findIndex } from './findIndex.js'; +export { default as findLastIndex } from './findLastIndex.js'; +export { default as first } from './first.js'; +export { default as flatten } from './flatten.js'; +export { default as flattenDeep } from './flattenDeep.js'; +export { default as flattenDepth } from './flattenDepth.js'; +export { default as fromPairs } from './fromPairs.js'; +export { default as head } from './head.js'; +export { default as indexOf } from './indexOf.js'; +export { default as initial } from './initial.js'; +export { default as intersection } from './intersection.js'; +export { default as intersectionBy } from './intersectionBy.js'; +export { default as intersectionWith } from './intersectionWith.js'; +export { default as join } from './join.js'; +export { default as last } from './last.js'; +export { default as lastIndexOf } from './lastIndexOf.js'; +export { default as nth } from './nth.js'; +export { default as pull } from './pull.js'; +export { default as pullAll } from './pullAll.js'; +export { default as pullAllBy } from './pullAllBy.js'; +export { default as pullAllWith } from './pullAllWith.js'; +export { default as pullAt } from './pullAt.js'; +export { default as remove } from './remove.js'; +export { default as reverse } from './reverse.js'; +export { default as slice } from './slice.js'; +export { default as sortedIndex } from './sortedIndex.js'; +export { default as sortedIndexBy } from './sortedIndexBy.js'; +export { default as sortedIndexOf } from './sortedIndexOf.js'; +export { default as sortedLastIndex } from './sortedLastIndex.js'; +export { default as sortedLastIndexBy } from './sortedLastIndexBy.js'; +export { default as sortedLastIndexOf } from './sortedLastIndexOf.js'; +export { default as sortedUniq } from './sortedUniq.js'; +export { default as sortedUniqBy } from './sortedUniqBy.js'; +export { default as tail } from './tail.js'; +export { default as take } from './take.js'; +export { default as takeRight } from './takeRight.js'; +export { default as takeRightWhile } from './takeRightWhile.js'; +export { default as takeWhile } from './takeWhile.js'; +export { default as union } from './union.js'; +export { default as unionBy } from './unionBy.js'; +export { default as unionWith } from './unionWith.js'; +export { default as uniq } from './uniq.js'; +export { default as uniqBy } from './uniqBy.js'; +export { default as uniqWith } from './uniqWith.js'; +export { default as unzip } from './unzip.js'; +export { default as unzipWith } from './unzipWith.js'; +export { default as without } from './without.js'; +export { default as xor } from './xor.js'; +export { default as xorBy } from './xorBy.js'; +export { default as xorWith } from './xorWith.js'; +export { default as zip } from './zip.js'; +export { default as zipObject } from './zipObject.js'; +export { default as zipObjectDeep } from './zipObjectDeep.js'; +export { default as zipWith } from './zipWith.js'; export { default as default } from './array.default'; diff --git a/ary.js b/ary.js index 0798dee52..592cc8a2a 100644 --- a/ary.js +++ b/ary.js @@ -1,4 +1,4 @@ -import createWrapper from './_createWrapper'; +import createWrapper from './_createWrapper.js'; /** Used to compose bitmasks for wrapper metadata. */ var ARY_FLAG = 128; diff --git a/assign.js b/assign.js index b97139063..07e639494 100644 --- a/assign.js +++ b/assign.js @@ -1,9 +1,9 @@ -import assignValue from './_assignValue'; -import copyObject from './_copyObject'; -import createAssigner from './_createAssigner'; -import isArrayLike from './isArrayLike'; -import isPrototype from './_isPrototype'; -import keys from './keys'; +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 keys from './keys.js'; /** Used for built-in method references. */ var objectProto = Object.prototype; diff --git a/assignIn.js b/assignIn.js index 10e446b03..4d673f6e0 100644 --- a/assignIn.js +++ b/assignIn.js @@ -1,9 +1,9 @@ -import assignValue from './_assignValue'; -import copyObject from './_copyObject'; -import createAssigner from './_createAssigner'; -import isArrayLike from './isArrayLike'; -import isPrototype from './_isPrototype'; -import keysIn from './keysIn'; +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; diff --git a/assignInWith.js b/assignInWith.js index 729375948..c7864a192 100644 --- a/assignInWith.js +++ b/assignInWith.js @@ -1,6 +1,6 @@ -import copyObject from './_copyObject'; -import createAssigner from './_createAssigner'; -import keysIn from './keysIn'; +import copyObject from './_copyObject.js'; +import createAssigner from './_createAssigner.js'; +import keysIn from './keysIn.js'; /** * This method is like `_.assignIn` except that it accepts `customizer` diff --git a/assignWith.js b/assignWith.js index 1ee0df523..f19d7c5b4 100644 --- a/assignWith.js +++ b/assignWith.js @@ -1,6 +1,6 @@ -import copyObject from './_copyObject'; -import createAssigner from './_createAssigner'; -import keys from './keys'; +import copyObject from './_copyObject.js'; +import createAssigner from './_createAssigner.js'; +import keys from './keys.js'; /** * This method is like `_.assign` except that it accepts `customizer` diff --git a/at.js b/at.js index 4b75444ad..0033ed8c1 100644 --- a/at.js +++ b/at.js @@ -1,6 +1,6 @@ -import baseAt from './_baseAt'; -import baseFlatten from './_baseFlatten'; -import rest from './rest'; +import baseAt from './_baseAt.js'; +import baseFlatten from './_baseFlatten.js'; +import rest from './rest.js'; /** * Creates an array of values corresponding to `paths` of `object`. @@ -18,9 +18,6 @@ import rest from './rest'; * * _.at(object, ['a[0].b.c', 'a[1]']); * // => [3, 4] - * - * _.at(['a', 'b', 'c'], 0, 2); - * // => ['a', 'c'] */ var at = rest(function(object, paths) { return baseAt(object, baseFlatten(paths, 1)); diff --git a/attempt.js b/attempt.js index 345fa2a62..019d352b3 100644 --- a/attempt.js +++ b/attempt.js @@ -1,6 +1,6 @@ -import apply from './_apply'; -import isError from './isError'; -import rest from './rest'; +import apply from './_apply.js'; +import isError from './isError.js'; +import rest from './rest.js'; /** * Attempts to invoke `func`, returning either the result or the caught error diff --git a/before.js b/before.js index d745c8772..3e49da548 100644 --- a/before.js +++ b/before.js @@ -1,4 +1,4 @@ -import toInteger from './toInteger'; +import toInteger from './toInteger.js'; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; diff --git a/bind.js b/bind.js index 14bd2260f..b6e4ab6b5 100644 --- a/bind.js +++ b/bind.js @@ -1,7 +1,7 @@ -import createWrapper from './_createWrapper'; -import getHolder from './_getHolder'; -import replaceHolders from './_replaceHolders'; -import rest from './rest'; +import createWrapper from './_createWrapper.js'; +import getHolder from './_getHolder.js'; +import replaceHolders from './_replaceHolders.js'; +import rest from './rest.js'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, @@ -14,7 +14,7 @@ var BIND_FLAG = 1, * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. * - * **Note:** Unlike native `Function#bind` this method doesn't set the "length" + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" * property of bound functions. * * @static diff --git a/bindAll.js b/bindAll.js index 30cd83d2a..04e3492c8 100644 --- a/bindAll.js +++ b/bindAll.js @@ -1,8 +1,8 @@ -import arrayEach from './_arrayEach'; -import baseFlatten from './_baseFlatten'; -import bind from './bind'; -import rest from './rest'; -import toKey from './_toKey'; +import arrayEach from './_arrayEach.js'; +import baseFlatten from './_baseFlatten.js'; +import bind from './bind.js'; +import rest from './rest.js'; +import toKey from './_toKey.js'; /** * Binds methods of an object to the object itself, overwriting the existing @@ -26,7 +26,7 @@ import toKey from './_toKey'; * } * }; * - * _.bindAll(view, 'onClick'); + * _.bindAll(view, ['onClick']); * jQuery(element).on('click', view.onClick); * // => Logs 'clicked docs' when clicked. */ diff --git a/bindKey.js b/bindKey.js index cfc43e43b..51778db85 100644 --- a/bindKey.js +++ b/bindKey.js @@ -1,7 +1,7 @@ -import createWrapper from './_createWrapper'; -import getHolder from './_getHolder'; -import replaceHolders from './_replaceHolders'; -import rest from './rest'; +import createWrapper from './_createWrapper.js'; +import getHolder from './_getHolder.js'; +import replaceHolders from './_replaceHolders.js'; +import rest from './rest.js'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, diff --git a/camelCase.js b/camelCase.js index 84f106bcd..cc5ee9392 100644 --- a/camelCase.js +++ b/camelCase.js @@ -1,5 +1,5 @@ -import capitalize from './capitalize'; -import createCompounder from './_createCompounder'; +import capitalize from './capitalize.js'; +import createCompounder from './_createCompounder.js'; /** * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). diff --git a/capitalize.js b/capitalize.js index 56ed4a133..557673b7f 100644 --- a/capitalize.js +++ b/capitalize.js @@ -1,5 +1,5 @@ -import toString from './toString'; -import upperFirst from './upperFirst'; +import toString from './toString.js'; +import upperFirst from './upperFirst.js'; /** * Converts the first character of `string` to upper case and the remaining diff --git a/castArray.js b/castArray.js index 7513ec88d..1ec560a28 100644 --- a/castArray.js +++ b/castArray.js @@ -1,4 +1,4 @@ -import isArray from './isArray'; +import isArray from './isArray.js'; /** * Casts `value` as an array if it's not one. diff --git a/ceil.js b/ceil.js index e909ae0e7..e86212a47 100644 --- a/ceil.js +++ b/ceil.js @@ -1,4 +1,4 @@ -import createRound from './_createRound'; +import createRound from './_createRound.js'; /** * Computes `number` rounded up to `precision`. diff --git a/chain.js b/chain.js index 088f0f621..6556af12a 100644 --- a/chain.js +++ b/chain.js @@ -1,4 +1,4 @@ -import lodash from './wrapperLodash'; +import lodash from './wrapperLodash.js'; /** * Creates a `lodash` wrapper instance that wraps `value` with explicit method diff --git a/chunk.js b/chunk.js index 5f147383e..d0cf6b30c 100644 --- a/chunk.js +++ b/chunk.js @@ -1,6 +1,6 @@ -import baseSlice from './_baseSlice'; -import isIterateeCall from './_isIterateeCall'; -import toInteger from './toInteger'; +import baseSlice from './_baseSlice.js'; +import isIterateeCall from './_isIterateeCall.js'; +import toInteger from './toInteger.js'; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, diff --git a/clamp.js b/clamp.js index 31a315752..fbb51164d 100644 --- a/clamp.js +++ b/clamp.js @@ -1,5 +1,5 @@ -import baseClamp from './_baseClamp'; -import toNumber from './toNumber'; +import baseClamp from './_baseClamp.js'; +import toNumber from './toNumber.js'; /** * Clamps `number` within the inclusive `lower` and `upper` bounds. diff --git a/clone.js b/clone.js index 36385ac99..b2f2c906d 100644 --- a/clone.js +++ b/clone.js @@ -1,4 +1,4 @@ -import baseClone from './_baseClone'; +import baseClone from './_baseClone.js'; /** * Creates a shallow clone of `value`. diff --git a/cloneDeep.js b/cloneDeep.js index 80281fa4d..de7ce2812 100644 --- a/cloneDeep.js +++ b/cloneDeep.js @@ -1,4 +1,4 @@ -import baseClone from './_baseClone'; +import baseClone from './_baseClone.js'; /** * This method is like `_.clone` except that it recursively clones `value`. diff --git a/cloneDeepWith.js b/cloneDeepWith.js index f8b81d0ba..b1933966b 100644 --- a/cloneDeepWith.js +++ b/cloneDeepWith.js @@ -1,4 +1,4 @@ -import baseClone from './_baseClone'; +import baseClone from './_baseClone.js'; /** * This method is like `_.cloneWith` except that it recursively clones `value`. diff --git a/cloneWith.js b/cloneWith.js index a98e42d5d..390f18879 100644 --- a/cloneWith.js +++ b/cloneWith.js @@ -1,4 +1,4 @@ -import baseClone from './_baseClone'; +import baseClone from './_baseClone.js'; /** * This method is like `_.clone` except that it accepts `customizer` which diff --git a/collection.default.js b/collection.default.js index 69e67acd6..ff56c45a6 100644 --- a/collection.default.js +++ b/collection.default.js @@ -1,32 +1,32 @@ -import at from './at'; -import countBy from './countBy'; -import each from './each'; -import eachRight from './eachRight'; -import every from './every'; -import filter from './filter'; -import find from './find'; -import findLast from './findLast'; -import flatMap from './flatMap'; -import flatMapDeep from './flatMapDeep'; -import flatMapDepth from './flatMapDepth'; -import forEach from './forEach'; -import forEachRight from './forEachRight'; -import groupBy from './groupBy'; -import includes from './includes'; -import invokeMap from './invokeMap'; -import keyBy from './keyBy'; -import map from './map'; -import orderBy from './orderBy'; -import partition from './partition'; -import reduce from './reduce'; -import reduceRight from './reduceRight'; -import reject from './reject'; -import sample from './sample'; -import sampleSize from './sampleSize'; -import shuffle from './shuffle'; -import size from './size'; -import some from './some'; -import sortBy from './sortBy'; +import at from './at.js'; +import countBy from './countBy.js'; +import each from './each.js'; +import eachRight from './eachRight.js'; +import every from './every.js'; +import filter from './filter.js'; +import find from './find.js'; +import findLast from './findLast.js'; +import flatMap from './flatMap.js'; +import flatMapDeep from './flatMapDeep.js'; +import flatMapDepth from './flatMapDepth.js'; +import forEach from './forEach.js'; +import forEachRight from './forEachRight.js'; +import groupBy from './groupBy.js'; +import includes from './includes.js'; +import invokeMap from './invokeMap.js'; +import keyBy from './keyBy.js'; +import map from './map.js'; +import orderBy from './orderBy.js'; +import partition from './partition.js'; +import reduce from './reduce.js'; +import reduceRight from './reduceRight.js'; +import reject from './reject.js'; +import sample from './sample.js'; +import sampleSize from './sampleSize.js'; +import shuffle from './shuffle.js'; +import size from './size.js'; +import some from './some.js'; +import sortBy from './sortBy.js'; export default { at, countBy, each, eachRight, every, diff --git a/collection.js b/collection.js index 728ad335f..307d94490 100644 --- a/collection.js +++ b/collection.js @@ -1,30 +1,30 @@ -export { default as at } from './at'; -export { default as countBy } from './countBy'; -export { default as each } from './each'; -export { default as eachRight } from './eachRight'; -export { default as every } from './every'; -export { default as filter } from './filter'; -export { default as find } from './find'; -export { default as findLast } from './findLast'; -export { default as flatMap } from './flatMap'; -export { default as flatMapDeep } from './flatMapDeep'; -export { default as flatMapDepth } from './flatMapDepth'; -export { default as forEach } from './forEach'; -export { default as forEachRight } from './forEachRight'; -export { default as groupBy } from './groupBy'; -export { default as includes } from './includes'; -export { default as invokeMap } from './invokeMap'; -export { default as keyBy } from './keyBy'; -export { default as map } from './map'; -export { default as orderBy } from './orderBy'; -export { default as partition } from './partition'; -export { default as reduce } from './reduce'; -export { default as reduceRight } from './reduceRight'; -export { default as reject } from './reject'; -export { default as sample } from './sample'; -export { default as sampleSize } from './sampleSize'; -export { default as shuffle } from './shuffle'; -export { default as size } from './size'; -export { default as some } from './some'; -export { default as sortBy } from './sortBy'; +export { default as at } from './at.js'; +export { default as countBy } from './countBy.js'; +export { default as each } from './each.js'; +export { default as eachRight } from './eachRight.js'; +export { default as every } from './every.js'; +export { default as filter } from './filter.js'; +export { default as find } from './find.js'; +export { default as findLast } from './findLast.js'; +export { default as flatMap } from './flatMap.js'; +export { default as flatMapDeep } from './flatMapDeep.js'; +export { default as flatMapDepth } from './flatMapDepth.js'; +export { default as forEach } from './forEach.js'; +export { default as forEachRight } from './forEachRight.js'; +export { default as groupBy } from './groupBy.js'; +export { default as includes } from './includes.js'; +export { default as invokeMap } from './invokeMap.js'; +export { default as keyBy } from './keyBy.js'; +export { default as map } from './map.js'; +export { default as orderBy } from './orderBy.js'; +export { default as partition } from './partition.js'; +export { default as reduce } from './reduce.js'; +export { default as reduceRight } from './reduceRight.js'; +export { default as reject } from './reject.js'; +export { default as sample } from './sample.js'; +export { default as sampleSize } from './sampleSize.js'; +export { default as shuffle } from './shuffle.js'; +export { default as size } from './size.js'; +export { default as some } from './some.js'; +export { default as sortBy } from './sortBy.js'; export { default as default } from './collection.default'; diff --git a/commit.js b/commit.js index 11b526a64..e449abecb 100644 --- a/commit.js +++ b/commit.js @@ -1,4 +1,4 @@ -import LodashWrapper from './_LodashWrapper'; +import LodashWrapper from './_LodashWrapper.js'; /** * Executes the chain sequence and returns the wrapped result. diff --git a/concat.js b/concat.js index 73f28f230..1774be94c 100644 --- a/concat.js +++ b/concat.js @@ -1,7 +1,7 @@ -import arrayPush from './_arrayPush'; -import baseFlatten from './_baseFlatten'; -import copyArray from './_copyArray'; -import isArray from './isArray'; +import arrayPush from './_arrayPush.js'; +import baseFlatten from './_baseFlatten.js'; +import copyArray from './_copyArray.js'; +import isArray from './isArray.js'; /** * Creates a new array concatenating `array` with any additional arrays diff --git a/cond.js b/cond.js index c08ca1482..dec7766df 100644 --- a/cond.js +++ b/cond.js @@ -1,7 +1,7 @@ -import apply from './_apply'; -import arrayMap from './_arrayMap'; -import baseIteratee from './_baseIteratee'; -import rest from './rest'; +import apply from './_apply.js'; +import arrayMap from './_arrayMap.js'; +import baseIteratee from './_baseIteratee.js'; +import rest from './rest.js'; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; diff --git a/conforms.js b/conforms.js index 2a467f3dd..79afafd7e 100644 --- a/conforms.js +++ b/conforms.js @@ -1,5 +1,5 @@ -import baseClone from './_baseClone'; -import baseConforms from './_baseConforms'; +import baseClone from './_baseClone.js'; +import baseConforms from './_baseConforms.js'; /** * Creates a function that invokes the predicate properties of `source` with @@ -19,7 +19,7 @@ import baseConforms from './_baseConforms'; * { 'user': 'fred', 'age': 40 } * ]; * - * _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) })); + * _.filter(users, _.conforms({ 'age': function(n) { return n > 38; } })); * // => [{ 'user': 'fred', 'age': 40 }] */ function conforms(source) { diff --git a/constant.js b/constant.js index 78dd50cae..c8dac98ca 100644 --- a/constant.js +++ b/constant.js @@ -9,10 +9,12 @@ * @returns {Function} Returns the new constant function. * @example * - * var object = { 'user': 'fred' }; - * var getter = _.constant(object); + * var objects = _.times(2, _.constant({ 'a': 1 })); * - * getter() === object; + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); * // => true */ function constant(value) { diff --git a/countBy.js b/countBy.js index 70d61fbe6..acbdd19c4 100644 --- a/countBy.js +++ b/countBy.js @@ -1,4 +1,4 @@ -import createAggregator from './_createAggregator'; +import createAggregator from './_createAggregator.js'; /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -25,6 +25,7 @@ var hasOwnProperty = objectProto.hasOwnProperty; * _.countBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': 1, '6': 2 } * + * // The `_.property` iteratee shorthand. * _.countBy(['one', 'two', 'three'], 'length'); * // => { '3': 2, '5': 1 } */ diff --git a/create.js b/create.js index ab060acf3..deb77460f 100644 --- a/create.js +++ b/create.js @@ -1,5 +1,5 @@ -import baseAssign from './_baseAssign'; -import baseCreate from './_baseCreate'; +import baseAssign from './_baseAssign.js'; +import baseCreate from './_baseCreate.js'; /** * Creates an object that inherits from the `prototype` object. If a diff --git a/curry.js b/curry.js index e2c85e0d7..38228fda9 100644 --- a/curry.js +++ b/curry.js @@ -1,4 +1,4 @@ -import createWrapper from './_createWrapper'; +import createWrapper from './_createWrapper.js'; /** Used to compose bitmasks for wrapper metadata. */ var CURRY_FLAG = 8; diff --git a/curryRight.js b/curryRight.js index 9f7bfb3d5..ea08d0be1 100644 --- a/curryRight.js +++ b/curryRight.js @@ -1,4 +1,4 @@ -import createWrapper from './_createWrapper'; +import createWrapper from './_createWrapper.js'; /** Used to compose bitmasks for wrapper metadata. */ var CURRY_RIGHT_FLAG = 16; diff --git a/date.default.js b/date.default.js index d03070153..9f1ee4947 100644 --- a/date.default.js +++ b/date.default.js @@ -1,4 +1,4 @@ -import now from './now'; +import now from './now.js'; export default { now diff --git a/date.js b/date.js index d5c560b51..56c92bcf2 100644 --- a/date.js +++ b/date.js @@ -1,2 +1,2 @@ -export { default as now } from './now'; +export { default as now } from './now.js'; export { default as default } from './date.default'; diff --git a/debounce.js b/debounce.js index 4e14a433c..1a7ca7234 100644 --- a/debounce.js +++ b/debounce.js @@ -1,6 +1,6 @@ -import isObject from './isObject'; -import now from './now'; -import toNumber from './toNumber'; +import isObject from './isObject.js'; +import now from './now.js'; +import toNumber from './toNumber.js'; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; @@ -65,7 +65,7 @@ function debounce(func, wait, options) { maxWait, result, timerId, - lastCallTime = 0, + lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, @@ -116,7 +116,7 @@ function debounce(func, wait, options) { // Either this is the first call, activity has stopped and we're at the // trailing edge, the system time has gone backwards and we're treating // it as the trailing edge, or we've hit the `maxWait` limit. - return (!lastCallTime || (timeSinceLastCall >= wait) || + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); } @@ -130,7 +130,6 @@ function debounce(func, wait, options) { } function trailingEdge(time) { - clearTimeout(timerId); timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been @@ -143,11 +142,8 @@ function debounce(func, wait, options) { } function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastCallTime = lastInvokeTime = 0; - lastArgs = lastThis = timerId = undefined; + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; } function flush() { @@ -168,7 +164,6 @@ function debounce(func, wait, options) { } if (maxing) { // Handle invocations in a tight loop. - clearTimeout(timerId); timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } diff --git a/deburr.js b/deburr.js index 03085a50e..1d93de941 100644 --- a/deburr.js +++ b/deburr.js @@ -1,5 +1,5 @@ -import deburrLetter from './_deburrLetter'; -import toString from './toString'; +import deburrLetter from './_deburrLetter.js'; +import toString from './toString.js'; /** Used to match latin-1 supplementary letters (excluding mathematical operators). */ var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; diff --git a/defaults.js b/defaults.js index 107e2f09e..614b2c6a9 100644 --- a/defaults.js +++ b/defaults.js @@ -1,7 +1,7 @@ -import apply from './_apply'; -import assignInDefaults from './_assignInDefaults'; -import assignInWith from './assignInWith'; -import rest from './rest'; +import apply from './_apply.js'; +import assignInDefaults from './_assignInDefaults.js'; +import assignInWith from './assignInWith.js'; +import rest from './rest.js'; /** * Assigns own and inherited enumerable string keyed properties of source diff --git a/defaultsDeep.js b/defaultsDeep.js index 0c15aea67..1320536e3 100644 --- a/defaultsDeep.js +++ b/defaultsDeep.js @@ -1,7 +1,7 @@ -import apply from './_apply'; -import mergeDefaults from './_mergeDefaults'; -import mergeWith from './mergeWith'; -import rest from './rest'; +import apply from './_apply.js'; +import mergeDefaults from './_mergeDefaults.js'; +import mergeWith from './mergeWith.js'; +import rest from './rest.js'; /** * This method is like `_.defaults` except that it recursively assigns diff --git a/defer.js b/defer.js index b0691f6c2..a8a42f141 100644 --- a/defer.js +++ b/defer.js @@ -1,5 +1,5 @@ -import baseDelay from './_baseDelay'; -import rest from './rest'; +import baseDelay from './_baseDelay.js'; +import rest from './rest.js'; /** * Defers invoking the `func` until the current call stack has cleared. Any diff --git a/delay.js b/delay.js index fa5729f72..308d3e002 100644 --- a/delay.js +++ b/delay.js @@ -1,6 +1,6 @@ -import baseDelay from './_baseDelay'; -import rest from './rest'; -import toNumber from './toNumber'; +import baseDelay from './_baseDelay.js'; +import rest from './rest.js'; +import toNumber from './toNumber.js'; /** * Invokes `func` after `wait` milliseconds. Any additional arguments are diff --git a/difference.js b/difference.js index 0c684897f..12540cbfc 100644 --- a/difference.js +++ b/difference.js @@ -1,7 +1,7 @@ -import baseDifference from './_baseDifference'; -import baseFlatten from './_baseFlatten'; -import isArrayLikeObject from './isArrayLikeObject'; -import rest from './rest'; +import baseDifference from './_baseDifference.js'; +import baseFlatten from './_baseFlatten.js'; +import isArrayLikeObject from './isArrayLikeObject.js'; +import rest from './rest.js'; /** * Creates an array of unique `array` values not included in the other given @@ -19,8 +19,8 @@ import rest from './rest'; * @see _.without, _.xor * @example * - * _.difference([3, 2, 1], [4, 2]); - * // => [3, 1] + * _.difference([2, 1], [2, 3]); + * // => [1] */ var difference = rest(function(array, values) { return isArrayLikeObject(array) diff --git a/differenceBy.js b/differenceBy.js index 971468324..9af817d6a 100644 --- a/differenceBy.js +++ b/differenceBy.js @@ -1,9 +1,9 @@ -import baseDifference from './_baseDifference'; -import baseFlatten from './_baseFlatten'; -import baseIteratee from './_baseIteratee'; -import isArrayLikeObject from './isArrayLikeObject'; -import last from './last'; -import rest from './rest'; +import baseDifference from './_baseDifference.js'; +import baseFlatten from './_baseFlatten.js'; +import baseIteratee from './_baseIteratee.js'; +import isArrayLikeObject from './isArrayLikeObject.js'; +import last from './last.js'; +import rest from './rest.js'; /** * This method is like `_.difference` except that it accepts `iteratee` which @@ -22,8 +22,8 @@ import rest from './rest'; * @returns {Array} Returns the new array of filtered values. * @example * - * _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor); - * // => [3.1, 1.3] + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] * * // The `_.property` iteratee shorthand. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); diff --git a/differenceWith.js b/differenceWith.js index 60f307a36..e8d5a133d 100644 --- a/differenceWith.js +++ b/differenceWith.js @@ -1,8 +1,8 @@ -import baseDifference from './_baseDifference'; -import baseFlatten from './_baseFlatten'; -import isArrayLikeObject from './isArrayLikeObject'; -import last from './last'; -import rest from './rest'; +import baseDifference from './_baseDifference.js'; +import baseFlatten from './_baseFlatten.js'; +import isArrayLikeObject from './isArrayLikeObject.js'; +import last from './last.js'; +import rest from './rest.js'; /** * This method is like `_.difference` except that it accepts `comparator` diff --git a/divide.js b/divide.js index 22b3ef1f4..2ef7e9185 100644 --- a/divide.js +++ b/divide.js @@ -1,4 +1,4 @@ -import createMathOperation from './_createMathOperation'; +import createMathOperation from './_createMathOperation.js'; /** * Divide two numbers. diff --git a/drop.js b/drop.js index 62e6a10c7..f172708c4 100644 --- a/drop.js +++ b/drop.js @@ -1,5 +1,5 @@ -import baseSlice from './_baseSlice'; -import toInteger from './toInteger'; +import baseSlice from './_baseSlice.js'; +import toInteger from './toInteger.js'; /** * Creates a slice of `array` with `n` elements dropped from the beginning. diff --git a/dropRight.js b/dropRight.js index 7e865fc0c..2ad39b4df 100644 --- a/dropRight.js +++ b/dropRight.js @@ -1,5 +1,5 @@ -import baseSlice from './_baseSlice'; -import toInteger from './toInteger'; +import baseSlice from './_baseSlice.js'; +import toInteger from './toInteger.js'; /** * Creates a slice of `array` with `n` elements dropped from the end. diff --git a/dropRightWhile.js b/dropRightWhile.js index 0ac98bb40..d76b76cdb 100644 --- a/dropRightWhile.js +++ b/dropRightWhile.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import baseWhile from './_baseWhile'; +import baseIteratee from './_baseIteratee.js'; +import baseWhile from './_baseWhile.js'; /** * Creates a slice of `array` excluding elements dropped from the end. diff --git a/dropWhile.js b/dropWhile.js index 3d1726578..f638cd4ce 100644 --- a/dropWhile.js +++ b/dropWhile.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import baseWhile from './_baseWhile'; +import baseIteratee from './_baseIteratee.js'; +import baseWhile from './_baseWhile.js'; /** * Creates a slice of `array` excluding elements dropped from the beginning. diff --git a/each.js b/each.js index 388824242..d2fd2ffbd 100644 --- a/each.js +++ b/each.js @@ -1 +1 @@ -export { default } from './forEach' +export { default } from './forEach.js' diff --git a/eachRight.js b/eachRight.js index 72ac72ab9..b08d8f5e0 100644 --- a/eachRight.js +++ b/eachRight.js @@ -1 +1 @@ -export { default } from './forEachRight' +export { default } from './forEachRight.js' diff --git a/endsWith.js b/endsWith.js index d37e48dd8..505566953 100644 --- a/endsWith.js +++ b/endsWith.js @@ -1,7 +1,7 @@ -import baseClamp from './_baseClamp'; -import baseToString from './_baseToString'; -import toInteger from './toInteger'; -import toString from './toString'; +import baseClamp from './_baseClamp.js'; +import baseToString from './_baseToString.js'; +import toInteger from './toInteger.js'; +import toString from './toString.js'; /** * Checks if `string` ends with the given target string. @@ -12,7 +12,7 @@ import toString from './toString'; * @category String * @param {string} [string=''] The string to search. * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search from. + * @param {number} [position=string.length] The position to search up to. * @returns {boolean} Returns `true` if `string` ends with `target`, * else `false`. * @example diff --git a/entries.js b/entries.js index 8d8f2a3e1..d532bf90d 100644 --- a/entries.js +++ b/entries.js @@ -1 +1 @@ -export { default } from './toPairs' +export { default } from './toPairs.js' diff --git a/entriesIn.js b/entriesIn.js index 310756c95..74db25d2c 100644 --- a/entriesIn.js +++ b/entriesIn.js @@ -1 +1 @@ -export { default } from './toPairsIn' +export { default } from './toPairsIn.js' diff --git a/escape.js b/escape.js index acf57ced9..e5ada6da3 100644 --- a/escape.js +++ b/escape.js @@ -1,5 +1,5 @@ -import escapeHtmlChar from './_escapeHtmlChar'; -import toString from './toString'; +import escapeHtmlChar from './_escapeHtmlChar.js'; +import toString from './toString.js'; /** Used to match HTML entities and HTML characters. */ var reUnescapedHtml = /[&<>"'`]/g, diff --git a/escapeRegExp.js b/escapeRegExp.js index aad60d1bf..9c26f2225 100644 --- a/escapeRegExp.js +++ b/escapeRegExp.js @@ -1,4 +1,4 @@ -import toString from './toString'; +import toString from './toString.js'; /** * Used to match `RegExp` diff --git a/every.js b/every.js index 065cee657..f64a4a4f1 100644 --- a/every.js +++ b/every.js @@ -1,8 +1,8 @@ -import arrayEvery from './_arrayEvery'; -import baseEvery from './_baseEvery'; -import baseIteratee from './_baseIteratee'; -import isArray from './isArray'; -import isIterateeCall from './_isIterateeCall'; +import arrayEvery from './_arrayEvery.js'; +import baseEvery from './_baseEvery.js'; +import baseIteratee from './_baseIteratee.js'; +import isArray from './isArray.js'; +import isIterateeCall from './_isIterateeCall.js'; /** * Checks if `predicate` returns truthy for **all** elements of `collection`. diff --git a/extend.js b/extend.js index 62e97fd87..2feb9d19b 100644 --- a/extend.js +++ b/extend.js @@ -1 +1 @@ -export { default } from './assignIn' +export { default } from './assignIn.js' diff --git a/extendWith.js b/extendWith.js index bd45c9a57..106469d9d 100644 --- a/extendWith.js +++ b/extendWith.js @@ -1 +1 @@ -export { default } from './assignInWith' +export { default } from './assignInWith.js' diff --git a/fill.js b/fill.js index c0b265032..6f8423646 100644 --- a/fill.js +++ b/fill.js @@ -1,5 +1,5 @@ -import baseFill from './_baseFill'; -import isIterateeCall from './_isIterateeCall'; +import baseFill from './_baseFill.js'; +import isIterateeCall from './_isIterateeCall.js'; /** * Fills elements of `array` with `value` from `start` up to, but not diff --git a/filter.js b/filter.js index f4f1ce9d7..26ceb01ab 100644 --- a/filter.js +++ b/filter.js @@ -1,7 +1,7 @@ -import arrayFilter from './_arrayFilter'; -import baseFilter from './_baseFilter'; -import baseIteratee from './_baseIteratee'; -import isArray from './isArray'; +import arrayFilter from './_arrayFilter.js'; +import baseFilter from './_baseFilter.js'; +import baseIteratee from './_baseIteratee.js'; +import isArray from './isArray.js'; /** * Iterates over elements of `collection`, returning an array of all elements diff --git a/find.js b/find.js index 2b8832754..a45ed0614 100644 --- a/find.js +++ b/find.js @@ -1,8 +1,6 @@ -import baseEach from './_baseEach'; -import baseFind from './_baseFind'; -import baseFindIndex from './_baseFindIndex'; -import baseIteratee from './_baseIteratee'; -import isArray from './isArray'; +import findIndex from './findIndex.js'; +import isArrayLike from './isArrayLike.js'; +import values from './values.js'; /** * Iterates over elements of `collection`, returning the first element @@ -16,6 +14,7 @@ import isArray from './isArray'; * @param {Array|Object} collection The collection to search. * @param {Array|Function|Object|string} [predicate=_.identity] * The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * @@ -40,13 +39,10 @@ import isArray from './isArray'; * _.find(users, 'active'); * // => object for 'barney' */ -function find(collection, predicate) { - predicate = baseIteratee(predicate, 3); - if (isArray(collection)) { - var index = baseFindIndex(collection, predicate); - return index > -1 ? collection[index] : undefined; - } - return baseFind(collection, predicate, baseEach); +function find(collection, predicate, fromIndex) { + collection = isArrayLike(collection) ? collection : values(collection); + var index = findIndex(collection, predicate, fromIndex); + return index > -1 ? collection[index] : undefined; } export default find; diff --git a/findIndex.js b/findIndex.js index 4cb5f7ff6..5aea01ecd 100644 --- a/findIndex.js +++ b/findIndex.js @@ -1,5 +1,9 @@ -import baseFindIndex from './_baseFindIndex'; -import baseIteratee from './_baseIteratee'; +import baseFindIndex from './_baseFindIndex.js'; +import baseIteratee from './_baseIteratee.js'; +import toInteger from './toInteger.js'; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; /** * This method is like `_.find` except that it returns the index of the first @@ -12,6 +16,7 @@ import baseIteratee from './_baseIteratee'; * @param {Array} array The array to search. * @param {Array|Function|Object|string} [predicate=_.identity] * The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * @@ -36,10 +41,16 @@ import baseIteratee from './_baseIteratee'; * _.findIndex(users, 'active'); * // => 2 */ -function findIndex(array, predicate) { - return (array && array.length) - ? baseFindIndex(array, baseIteratee(predicate, 3)) - : -1; +function findIndex(array, predicate, fromIndex) { + var length = array ? array.length : 0; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); } export default findIndex; diff --git a/findKey.js b/findKey.js index 4a1fe1e1e..e7d1b4a82 100644 --- a/findKey.js +++ b/findKey.js @@ -1,6 +1,6 @@ -import baseFind from './_baseFind'; -import baseForOwn from './_baseForOwn'; -import baseIteratee from './_baseIteratee'; +import baseFindKey from './_baseFindKey.js'; +import baseForOwn from './_baseForOwn.js'; +import baseIteratee from './_baseIteratee.js'; /** * This method is like `_.find` except that it returns the key of the first @@ -39,7 +39,7 @@ import baseIteratee from './_baseIteratee'; * // => 'barney' */ function findKey(object, predicate) { - return baseFind(object, baseIteratee(predicate, 3), baseForOwn, true); + return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn); } export default findKey; diff --git a/findLast.js b/findLast.js index d73a3184b..f7a53251a 100644 --- a/findLast.js +++ b/findLast.js @@ -1,8 +1,6 @@ -import baseEachRight from './_baseEachRight'; -import baseFind from './_baseFind'; -import baseFindIndex from './_baseFindIndex'; -import baseIteratee from './_baseIteratee'; -import isArray from './isArray'; +import findLastIndex from './findLastIndex.js'; +import isArrayLike from './isArrayLike.js'; +import values from './values.js'; /** * This method is like `_.find` except that it iterates over elements of @@ -15,6 +13,7 @@ import isArray from './isArray'; * @param {Array|Object} collection The collection to search. * @param {Array|Function|Object|string} [predicate=_.identity] * The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * @@ -23,13 +22,10 @@ import isArray from './isArray'; * }); * // => 3 */ -function findLast(collection, predicate) { - predicate = baseIteratee(predicate, 3); - if (isArray(collection)) { - var index = baseFindIndex(collection, predicate, true); - return index > -1 ? collection[index] : undefined; - } - return baseFind(collection, predicate, baseEachRight); +function findLast(collection, predicate, fromIndex) { + collection = isArrayLike(collection) ? collection : values(collection); + var index = findLastIndex(collection, predicate, fromIndex); + return index > -1 ? collection[index] : undefined; } export default findLast; diff --git a/findLastIndex.js b/findLastIndex.js index 929fbb146..afedd2725 100644 --- a/findLastIndex.js +++ b/findLastIndex.js @@ -1,5 +1,10 @@ -import baseFindIndex from './_baseFindIndex'; -import baseIteratee from './_baseIteratee'; +import baseFindIndex from './_baseFindIndex.js'; +import baseIteratee from './_baseIteratee.js'; +import toInteger from './toInteger.js'; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; /** * This method is like `_.findIndex` except that it iterates over elements @@ -12,6 +17,7 @@ import baseIteratee from './_baseIteratee'; * @param {Array} array The array to search. * @param {Array|Function|Object|string} [predicate=_.identity] * The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * @@ -36,10 +42,19 @@ import baseIteratee from './_baseIteratee'; * _.findLastIndex(users, 'active'); * // => 0 */ -function findLastIndex(array, predicate) { - return (array && array.length) - ? baseFindIndex(array, baseIteratee(predicate, 3), true) - : -1; +function findLastIndex(array, predicate, fromIndex) { + var length = array ? array.length : 0; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index, true); } export default findLastIndex; diff --git a/findLastKey.js b/findLastKey.js index a6c2003ef..0658a13e5 100644 --- a/findLastKey.js +++ b/findLastKey.js @@ -1,6 +1,6 @@ -import baseFind from './_baseFind'; -import baseForOwnRight from './_baseForOwnRight'; -import baseIteratee from './_baseIteratee'; +import baseFindKey from './_baseFindKey.js'; +import baseForOwnRight from './_baseForOwnRight.js'; +import baseIteratee from './_baseIteratee.js'; /** * This method is like `_.findKey` except that it iterates over elements of @@ -39,7 +39,7 @@ import baseIteratee from './_baseIteratee'; * // => 'pebbles' */ function findLastKey(object, predicate) { - return baseFind(object, baseIteratee(predicate, 3), baseForOwnRight, true); + return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight); } export default findLastKey; diff --git a/first.js b/first.js index 5a7e2c5b4..db707ff9a 100644 --- a/first.js +++ b/first.js @@ -1 +1 @@ -export { default } from './head' +export { default } from './head.js' diff --git a/flatMap.js b/flatMap.js index c261691fe..431ebe9a7 100644 --- a/flatMap.js +++ b/flatMap.js @@ -1,5 +1,5 @@ -import baseFlatten from './_baseFlatten'; -import map from './map'; +import baseFlatten from './_baseFlatten.js'; +import map from './map.js'; /** * Creates a flattened array of values by running each element in `collection` diff --git a/flatMapDeep.js b/flatMapDeep.js index dfff660e2..78667dd82 100644 --- a/flatMapDeep.js +++ b/flatMapDeep.js @@ -1,5 +1,5 @@ -import baseFlatten from './_baseFlatten'; -import map from './map'; +import baseFlatten from './_baseFlatten.js'; +import map from './map.js'; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; diff --git a/flatMapDepth.js b/flatMapDepth.js index a8bcdf83a..b6f7e818a 100644 --- a/flatMapDepth.js +++ b/flatMapDepth.js @@ -1,6 +1,6 @@ -import baseFlatten from './_baseFlatten'; -import map from './map'; -import toInteger from './toInteger'; +import baseFlatten from './_baseFlatten.js'; +import map from './map.js'; +import toInteger from './toInteger.js'; /** * This method is like `_.flatMap` except that it recursively flattens the diff --git a/flatten.js b/flatten.js index 97ef4d70a..009b3906d 100644 --- a/flatten.js +++ b/flatten.js @@ -1,4 +1,4 @@ -import baseFlatten from './_baseFlatten'; +import baseFlatten from './_baseFlatten.js'; /** * Flattens `array` a single level deep. diff --git a/flattenDeep.js b/flattenDeep.js index b58fadf10..55afc054a 100644 --- a/flattenDeep.js +++ b/flattenDeep.js @@ -1,4 +1,4 @@ -import baseFlatten from './_baseFlatten'; +import baseFlatten from './_baseFlatten.js'; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; diff --git a/flattenDepth.js b/flattenDepth.js index 73eb8fdb0..1f6d9e550 100644 --- a/flattenDepth.js +++ b/flattenDepth.js @@ -1,5 +1,5 @@ -import baseFlatten from './_baseFlatten'; -import toInteger from './toInteger'; +import baseFlatten from './_baseFlatten.js'; +import toInteger from './toInteger.js'; /** * Recursively flatten `array` up to `depth` times. diff --git a/flip.js b/flip.js index f52c15a07..24a83b7d7 100644 --- a/flip.js +++ b/flip.js @@ -1,4 +1,4 @@ -import createWrapper from './_createWrapper'; +import createWrapper from './_createWrapper.js'; /** Used to compose bitmasks for wrapper metadata. */ var FLIP_FLAG = 512; diff --git a/floor.js b/floor.js index 8c06c3afd..7ea5394f7 100644 --- a/floor.js +++ b/floor.js @@ -1,4 +1,4 @@ -import createRound from './_createRound'; +import createRound from './_createRound.js'; /** * Computes `number` rounded down to `precision`. diff --git a/flow.js b/flow.js index a54f2ae56..b6506bfdc 100644 --- a/flow.js +++ b/flow.js @@ -1,4 +1,4 @@ -import createFlow from './_createFlow'; +import createFlow from './_createFlow.js'; /** * Creates a function that returns the result of invoking the given functions @@ -18,7 +18,7 @@ import createFlow from './_createFlow'; * return n * n; * } * - * var addSquare = _.flow(_.add, square); + * var addSquare = _.flow([_.add, square]); * addSquare(1, 2); * // => 9 */ diff --git a/flowRight.js b/flowRight.js index a0284a071..f363509a7 100644 --- a/flowRight.js +++ b/flowRight.js @@ -1,4 +1,4 @@ -import createFlow from './_createFlow'; +import createFlow from './_createFlow.js'; /** * This method is like `_.flow` except that it creates a function that @@ -17,7 +17,7 @@ import createFlow from './_createFlow'; * return n * n; * } * - * var addSquare = _.flowRight(square, _.add); + * var addSquare = _.flowRight([square, _.add]); * addSquare(1, 2); * // => 9 */ diff --git a/forEach.js b/forEach.js index 28dfe48e3..a101d7c33 100644 --- a/forEach.js +++ b/forEach.js @@ -1,7 +1,7 @@ -import arrayEach from './_arrayEach'; -import baseEach from './_baseEach'; -import baseIteratee from './_baseIteratee'; -import isArray from './isArray'; +import arrayEach from './_arrayEach.js'; +import baseEach from './_baseEach.js'; +import baseIteratee from './_baseIteratee.js'; +import isArray from './isArray.js'; /** * Iterates over elements of `collection` and invokes `iteratee` for each element. diff --git a/forEachRight.js b/forEachRight.js index a297e28d5..73c39866a 100644 --- a/forEachRight.js +++ b/forEachRight.js @@ -1,7 +1,7 @@ -import arrayEachRight from './_arrayEachRight'; -import baseEachRight from './_baseEachRight'; -import baseIteratee from './_baseIteratee'; -import isArray from './isArray'; +import arrayEachRight from './_arrayEachRight.js'; +import baseEachRight from './_baseEachRight.js'; +import baseIteratee from './_baseIteratee.js'; +import isArray from './isArray.js'; /** * This method is like `_.forEach` except that it iterates over elements of diff --git a/forIn.js b/forIn.js index 8e3fe30e2..6355127dc 100644 --- a/forIn.js +++ b/forIn.js @@ -1,6 +1,6 @@ -import baseFor from './_baseFor'; -import baseIteratee from './_baseIteratee'; -import keysIn from './keysIn'; +import baseFor from './_baseFor.js'; +import baseIteratee from './_baseIteratee.js'; +import keysIn from './keysIn.js'; /** * Iterates over own and inherited enumerable string keyed properties of an diff --git a/forInRight.js b/forInRight.js index 3b4897dae..a9d3adf2c 100644 --- a/forInRight.js +++ b/forInRight.js @@ -1,6 +1,6 @@ -import baseForRight from './_baseForRight'; -import baseIteratee from './_baseIteratee'; -import keysIn from './keysIn'; +import baseForRight from './_baseForRight.js'; +import baseIteratee from './_baseIteratee.js'; +import keysIn from './keysIn.js'; /** * This method is like `_.forIn` except that it iterates over properties of diff --git a/forOwn.js b/forOwn.js index 1f282df0f..fec2df37f 100644 --- a/forOwn.js +++ b/forOwn.js @@ -1,5 +1,5 @@ -import baseForOwn from './_baseForOwn'; -import baseIteratee from './_baseIteratee'; +import baseForOwn from './_baseForOwn.js'; +import baseIteratee from './_baseIteratee.js'; /** * Iterates over own enumerable string keyed properties of an object and diff --git a/forOwnRight.js b/forOwnRight.js index 9d1dca0df..efe146e58 100644 --- a/forOwnRight.js +++ b/forOwnRight.js @@ -1,5 +1,5 @@ -import baseForOwnRight from './_baseForOwnRight'; -import baseIteratee from './_baseIteratee'; +import baseForOwnRight from './_baseForOwnRight.js'; +import baseIteratee from './_baseIteratee.js'; /** * This method is like `_.forOwn` except that it iterates over properties of diff --git a/function.default.js b/function.default.js index 34fe1ffa8..a92f4dfda 100644 --- a/function.default.js +++ b/function.default.js @@ -1,26 +1,26 @@ -import after from './after'; -import ary from './ary'; -import before from './before'; -import bind from './bind'; -import bindKey from './bindKey'; -import curry from './curry'; -import curryRight from './curryRight'; -import debounce from './debounce'; -import defer from './defer'; -import delay from './delay'; -import flip from './flip'; -import memoize from './memoize'; -import negate from './negate'; -import once from './once'; -import overArgs from './overArgs'; -import partial from './partial'; -import partialRight from './partialRight'; -import rearg from './rearg'; -import rest from './rest'; -import spread from './spread'; -import throttle from './throttle'; -import unary from './unary'; -import wrap from './wrap'; +import after from './after.js'; +import ary from './ary.js'; +import before from './before.js'; +import bind from './bind.js'; +import bindKey from './bindKey.js'; +import curry from './curry.js'; +import curryRight from './curryRight.js'; +import debounce from './debounce.js'; +import defer from './defer.js'; +import delay from './delay.js'; +import flip from './flip.js'; +import memoize from './memoize.js'; +import negate from './negate.js'; +import once from './once.js'; +import overArgs from './overArgs.js'; +import partial from './partial.js'; +import partialRight from './partialRight.js'; +import rearg from './rearg.js'; +import rest from './rest.js'; +import spread from './spread.js'; +import throttle from './throttle.js'; +import unary from './unary.js'; +import wrap from './wrap.js'; export default { after, ary, before, bind, bindKey, diff --git a/function.js b/function.js index 7e3fc192c..fb924abb5 100644 --- a/function.js +++ b/function.js @@ -1,24 +1,24 @@ -export { default as after } from './after'; -export { default as ary } from './ary'; -export { default as before } from './before'; -export { default as bind } from './bind'; -export { default as bindKey } from './bindKey'; -export { default as curry } from './curry'; -export { default as curryRight } from './curryRight'; -export { default as debounce } from './debounce'; -export { default as defer } from './defer'; -export { default as delay } from './delay'; -export { default as flip } from './flip'; -export { default as memoize } from './memoize'; -export { default as negate } from './negate'; -export { default as once } from './once'; -export { default as overArgs } from './overArgs'; -export { default as partial } from './partial'; -export { default as partialRight } from './partialRight'; -export { default as rearg } from './rearg'; -export { default as rest } from './rest'; -export { default as spread } from './spread'; -export { default as throttle } from './throttle'; -export { default as unary } from './unary'; -export { default as wrap } from './wrap'; +export { default as after } from './after.js'; +export { default as ary } from './ary.js'; +export { default as before } from './before.js'; +export { default as bind } from './bind.js'; +export { default as bindKey } from './bindKey.js'; +export { default as curry } from './curry.js'; +export { default as curryRight } from './curryRight.js'; +export { default as debounce } from './debounce.js'; +export { default as defer } from './defer.js'; +export { default as delay } from './delay.js'; +export { default as flip } from './flip.js'; +export { default as memoize } from './memoize.js'; +export { default as negate } from './negate.js'; +export { default as once } from './once.js'; +export { default as overArgs } from './overArgs.js'; +export { default as partial } from './partial.js'; +export { default as partialRight } from './partialRight.js'; +export { default as rearg } from './rearg.js'; +export { default as rest } from './rest.js'; +export { default as spread } from './spread.js'; +export { default as throttle } from './throttle.js'; +export { default as unary } from './unary.js'; +export { default as wrap } from './wrap.js'; export { default as default } from './function.default'; diff --git a/functions.js b/functions.js index 8905eea4c..b9ea4de05 100644 --- a/functions.js +++ b/functions.js @@ -1,5 +1,5 @@ -import baseFunctions from './_baseFunctions'; -import keys from './keys'; +import baseFunctions from './_baseFunctions.js'; +import keys from './keys.js'; /** * Creates an array of function property names from own enumerable properties diff --git a/functionsIn.js b/functionsIn.js index 60bc21089..fb727f179 100644 --- a/functionsIn.js +++ b/functionsIn.js @@ -1,5 +1,5 @@ -import baseFunctions from './_baseFunctions'; -import keysIn from './keysIn'; +import baseFunctions from './_baseFunctions.js'; +import keysIn from './keysIn.js'; /** * Creates an array of function property names from own and inherited diff --git a/get.js b/get.js index c241eab71..a953c56a4 100644 --- a/get.js +++ b/get.js @@ -1,4 +1,4 @@ -import baseGet from './_baseGet'; +import baseGet from './_baseGet.js'; /** * Gets the value at `path` of `object`. If the resolved value is diff --git a/groupBy.js b/groupBy.js index c42ce5bb3..4dae6bb19 100644 --- a/groupBy.js +++ b/groupBy.js @@ -1,4 +1,4 @@ -import createAggregator from './_createAggregator'; +import createAggregator from './_createAggregator.js'; /** Used for built-in method references. */ var objectProto = Object.prototype; diff --git a/gt.js b/gt.js index abdc8557f..6a7227f67 100644 --- a/gt.js +++ b/gt.js @@ -1,5 +1,5 @@ -import baseGt from './_baseGt'; -import createRelationalOperation from './_createRelationalOperation'; +import baseGt from './_baseGt.js'; +import createRelationalOperation from './_createRelationalOperation.js'; /** * Checks if `value` is greater than `other`. diff --git a/gte.js b/gte.js index d4ee04a52..22c72b21b 100644 --- a/gte.js +++ b/gte.js @@ -1,4 +1,4 @@ -import createRelationalOperation from './_createRelationalOperation'; +import createRelationalOperation from './_createRelationalOperation.js'; /** * Checks if `value` is greater than or equal to `other`. diff --git a/has.js b/has.js index e7844016a..83c8e49d9 100644 --- a/has.js +++ b/has.js @@ -1,5 +1,5 @@ -import baseHas from './_baseHas'; -import hasPath from './_hasPath'; +import baseHas from './_baseHas.js'; +import hasPath from './_hasPath.js'; /** * Checks if `path` is a direct property of `object`. diff --git a/hasIn.js b/hasIn.js index f1bc190a8..c02eb1f43 100644 --- a/hasIn.js +++ b/hasIn.js @@ -1,5 +1,5 @@ -import baseHasIn from './_baseHasIn'; -import hasPath from './_hasPath'; +import baseHasIn from './_baseHasIn.js'; +import hasPath from './_hasPath.js'; /** * Checks if `path` is a direct or inherited property of `object`. diff --git a/identity.js b/identity.js index 3a5e66574..bb6d97d36 100644 --- a/identity.js +++ b/identity.js @@ -11,7 +11,7 @@ * * var object = { 'user': 'fred' }; * - * _.identity(object) === object; + * console.log(_.identity(object) === object); * // => true */ function identity(value) { diff --git a/inRange.js b/inRange.js index 66c0004dc..866ad4c8e 100644 --- a/inRange.js +++ b/inRange.js @@ -1,5 +1,5 @@ -import baseInRange from './_baseInRange'; -import toNumber from './toNumber'; +import baseInRange from './_baseInRange.js'; +import toNumber from './toNumber.js'; /** * Checks if `n` is between `start` and up to, but not including, `end`. If diff --git a/includes.js b/includes.js index 82ba4882c..a4f2561b6 100644 --- a/includes.js +++ b/includes.js @@ -1,8 +1,8 @@ -import baseIndexOf from './_baseIndexOf'; -import isArrayLike from './isArrayLike'; -import isString from './isString'; -import toInteger from './toInteger'; -import values from './values'; +import baseIndexOf from './_baseIndexOf.js'; +import isArrayLike from './isArrayLike.js'; +import isString from './isString.js'; +import toInteger from './toInteger.js'; +import values from './values.js'; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; diff --git a/indexOf.js b/indexOf.js index 64940c6cc..7635d1526 100644 --- a/indexOf.js +++ b/indexOf.js @@ -1,5 +1,5 @@ -import baseIndexOf from './_baseIndexOf'; -import toInteger from './toInteger'; +import baseIndexOf from './_baseIndexOf.js'; +import toInteger from './toInteger.js'; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; @@ -32,11 +32,11 @@ function indexOf(array, value, fromIndex) { if (!length) { return -1; } - fromIndex = toInteger(fromIndex); - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); } - return baseIndexOf(array, value, fromIndex); + return baseIndexOf(array, value, index); } export default indexOf; diff --git a/initial.js b/initial.js index e189e6b83..b753abf61 100644 --- a/initial.js +++ b/initial.js @@ -1,4 +1,4 @@ -import dropRight from './dropRight'; +import dropRight from './dropRight.js'; /** * Gets all but the last element of `array`. diff --git a/intersection.js b/intersection.js index ab7f50f16..40a0e896b 100644 --- a/intersection.js +++ b/intersection.js @@ -1,7 +1,7 @@ -import arrayMap from './_arrayMap'; -import baseIntersection from './_baseIntersection'; -import castArrayLikeObject from './_castArrayLikeObject'; -import rest from './rest'; +import arrayMap from './_arrayMap.js'; +import baseIntersection from './_baseIntersection.js'; +import castArrayLikeObject from './_castArrayLikeObject.js'; +import rest from './rest.js'; /** * Creates an array of unique values that are included in all given arrays @@ -17,7 +17,7 @@ import rest from './rest'; * @returns {Array} Returns the new array of intersecting values. * @example * - * _.intersection([2, 1], [4, 2], [1, 2]); + * _.intersection([2, 1], [2, 3]); * // => [2] */ var intersection = rest(function(arrays) { diff --git a/intersectionBy.js b/intersectionBy.js index f6e8bbb7c..96f2ba57d 100644 --- a/intersectionBy.js +++ b/intersectionBy.js @@ -1,9 +1,9 @@ -import arrayMap from './_arrayMap'; -import baseIntersection from './_baseIntersection'; -import baseIteratee from './_baseIteratee'; -import castArrayLikeObject from './_castArrayLikeObject'; -import last from './last'; -import rest from './rest'; +import arrayMap from './_arrayMap.js'; +import baseIntersection from './_baseIntersection.js'; +import baseIteratee from './_baseIteratee.js'; +import castArrayLikeObject from './_castArrayLikeObject.js'; +import last from './last.js'; +import rest from './rest.js'; /** * This method is like `_.intersection` except that it accepts `iteratee` @@ -21,7 +21,7 @@ import rest from './rest'; * @returns {Array} Returns the new array of intersecting values. * @example * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [2.1] * * // The `_.property` iteratee shorthand. diff --git a/intersectionWith.js b/intersectionWith.js index d4fa027e5..205aadc88 100644 --- a/intersectionWith.js +++ b/intersectionWith.js @@ -1,8 +1,8 @@ -import arrayMap from './_arrayMap'; -import baseIntersection from './_baseIntersection'; -import castArrayLikeObject from './_castArrayLikeObject'; -import last from './last'; -import rest from './rest'; +import arrayMap from './_arrayMap.js'; +import baseIntersection from './_baseIntersection.js'; +import castArrayLikeObject from './_castArrayLikeObject.js'; +import last from './last.js'; +import rest from './rest.js'; /** * This method is like `_.intersection` except that it accepts `comparator` diff --git a/invert.js b/invert.js index 283b1250e..3ad074d87 100644 --- a/invert.js +++ b/invert.js @@ -1,6 +1,6 @@ -import constant from './constant'; -import createInverter from './_createInverter'; -import identity from './identity'; +import constant from './constant.js'; +import createInverter from './_createInverter.js'; +import identity from './identity.js'; /** * Creates an object composed of the inverted keys and values of `object`. diff --git a/invertBy.js b/invertBy.js index 3fa2fd773..d645303c3 100644 --- a/invertBy.js +++ b/invertBy.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import createInverter from './_createInverter'; +import baseIteratee from './_baseIteratee.js'; +import createInverter from './_createInverter.js'; /** Used for built-in method references. */ var objectProto = Object.prototype; diff --git a/invoke.js b/invoke.js index d68fa8349..7840164f2 100644 --- a/invoke.js +++ b/invoke.js @@ -1,5 +1,5 @@ -import baseInvoke from './_baseInvoke'; -import rest from './rest'; +import baseInvoke from './_baseInvoke.js'; +import rest from './rest.js'; /** * Invokes the method at `path` of `object`. diff --git a/invokeMap.js b/invokeMap.js index 2115786ab..0ff5c8c86 100644 --- a/invokeMap.js +++ b/invokeMap.js @@ -1,9 +1,9 @@ -import apply from './_apply'; -import baseEach from './_baseEach'; -import baseInvoke from './_baseInvoke'; -import isArrayLike from './isArrayLike'; -import isKey from './_isKey'; -import rest from './rest'; +import apply from './_apply.js'; +import baseEach from './_baseEach.js'; +import baseInvoke from './_baseInvoke.js'; +import isArrayLike from './isArrayLike.js'; +import isKey from './_isKey.js'; +import rest from './rest.js'; /** * Invokes the method at `path` of each element in `collection`, returning diff --git a/isArguments.js b/isArguments.js index 1f4cf8e37..293130db7 100644 --- a/isArguments.js +++ b/isArguments.js @@ -1,4 +1,4 @@ -import isArrayLikeObject from './isArrayLikeObject'; +import isArrayLikeObject from './isArrayLikeObject.js'; /** `Object#toString` result references. */ var argsTag = '[object Arguments]'; diff --git a/isArrayBuffer.js b/isArrayBuffer.js index 9170868fe..bec8bbac9 100644 --- a/isArrayBuffer.js +++ b/isArrayBuffer.js @@ -1,4 +1,4 @@ -import isObjectLike from './isObjectLike'; +import isObjectLike from './isObjectLike.js'; var arrayBufferTag = '[object ArrayBuffer]'; diff --git a/isArrayLike.js b/isArrayLike.js index ea76be4a0..f5a5c1034 100644 --- a/isArrayLike.js +++ b/isArrayLike.js @@ -1,6 +1,6 @@ -import getLength from './_getLength'; -import isFunction from './isFunction'; -import isLength from './isLength'; +import getLength from './_getLength.js'; +import isFunction from './isFunction.js'; +import isLength from './isLength.js'; /** * Checks if `value` is array-like. A value is considered array-like if it's diff --git a/isArrayLikeObject.js b/isArrayLikeObject.js index fea4ab852..0332da45f 100644 --- a/isArrayLikeObject.js +++ b/isArrayLikeObject.js @@ -1,5 +1,5 @@ -import isArrayLike from './isArrayLike'; -import isObjectLike from './isObjectLike'; +import isArrayLike from './isArrayLike.js'; +import isObjectLike from './isObjectLike.js'; /** * This method is like `_.isArrayLike` except that it also checks if `value` diff --git a/isBoolean.js b/isBoolean.js index fc06ac5e8..a2a9f12f3 100644 --- a/isBoolean.js +++ b/isBoolean.js @@ -1,4 +1,4 @@ -import isObjectLike from './isObjectLike'; +import isObjectLike from './isObjectLike.js'; /** `Object#toString` result references. */ var boolTag = '[object Boolean]'; diff --git a/isBuffer.js b/isBuffer.js index 3fefb0fad..1db2c70cf 100644 --- a/isBuffer.js +++ b/isBuffer.js @@ -1,26 +1,14 @@ -import constant from './constant'; -import root from './_root'; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; +import root from './_root.js'; +import stubFalse from './stubFalse.js'; /** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; +var freeExports = typeof exports == 'object' && exports; /** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; +var freeModule = freeExports && typeof module == 'object' && module; /** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = (freeModule && freeModule.exports === freeExports) - ? freeExports - : undefined; +var moduleExports = freeModule && freeModule.exports === freeExports; /** Built-in value references. */ var Buffer = moduleExports ? root.Buffer : undefined; @@ -42,7 +30,7 @@ var Buffer = moduleExports ? root.Buffer : undefined; * _.isBuffer(new Uint8Array(2)); * // => false */ -var isBuffer = !Buffer ? constant(false) : function(value) { +var isBuffer = !Buffer ? stubFalse : function(value) { return value instanceof Buffer; }; diff --git a/isDate.js b/isDate.js index 0496e463c..dee638a9b 100644 --- a/isDate.js +++ b/isDate.js @@ -1,4 +1,4 @@ -import isObjectLike from './isObjectLike'; +import isObjectLike from './isObjectLike.js'; /** `Object#toString` result references. */ var dateTag = '[object Date]'; diff --git a/isElement.js b/isElement.js index a654808b2..05c627f9b 100644 --- a/isElement.js +++ b/isElement.js @@ -1,5 +1,5 @@ -import isObjectLike from './isObjectLike'; -import isPlainObject from './isPlainObject'; +import isObjectLike from './isObjectLike.js'; +import isPlainObject from './isPlainObject.js'; /** * Checks if `value` is likely a DOM element. diff --git a/isEmpty.js b/isEmpty.js index 0e126d7c9..4d7c7afea 100644 --- a/isEmpty.js +++ b/isEmpty.js @@ -1,12 +1,12 @@ -import getTag from './_getTag'; -import isArguments from './isArguments'; -import isArray from './isArray'; -import isArrayLike from './isArrayLike'; -import isBuffer from './isBuffer'; -import isFunction from './isFunction'; -import isObjectLike from './isObjectLike'; -import isString from './isString'; -import keys from './keys'; +import getTag from './_getTag.js'; +import isArguments from './isArguments.js'; +import isArray from './isArray.js'; +import isArrayLike from './isArrayLike.js'; +import isBuffer from './isBuffer.js'; +import isFunction from './isFunction.js'; +import isObjectLike from './isObjectLike.js'; +import isString from './isString.js'; +import keys from './keys.js'; /** `Object#toString` result references. */ var mapTag = '[object Map]', diff --git a/isEqual.js b/isEqual.js index ea6f044c6..292dd4f48 100644 --- a/isEqual.js +++ b/isEqual.js @@ -1,4 +1,4 @@ -import baseIsEqual from './_baseIsEqual'; +import baseIsEqual from './_baseIsEqual.js'; /** * Performs a deep comparison between two values to determine if they are diff --git a/isEqualWith.js b/isEqualWith.js index 2b5cc3747..6276d62fb 100644 --- a/isEqualWith.js +++ b/isEqualWith.js @@ -1,4 +1,4 @@ -import baseIsEqual from './_baseIsEqual'; +import baseIsEqual from './_baseIsEqual.js'; /** * This method is like `_.isEqual` except that it accepts `customizer` which diff --git a/isError.js b/isError.js index 5ad5e7e74..3975a28c5 100644 --- a/isError.js +++ b/isError.js @@ -1,4 +1,4 @@ -import isObjectLike from './isObjectLike'; +import isObjectLike from './isObjectLike.js'; /** `Object#toString` result references. */ var errorTag = '[object Error]'; diff --git a/isFinite.js b/isFinite.js index cea5d0702..b961829b5 100644 --- a/isFinite.js +++ b/isFinite.js @@ -1,4 +1,4 @@ -import root from './_root'; +import root from './_root.js'; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsFinite = root.isFinite; diff --git a/isFunction.js b/isFunction.js index 093161320..0c4adefdd 100644 --- a/isFunction.js +++ b/isFunction.js @@ -1,4 +1,4 @@ -import isObject from './isObject'; +import isObject from './isObject.js'; /** `Object#toString` result references. */ var funcTag = '[object Function]', diff --git a/isInteger.js b/isInteger.js index 92a5635e9..8284ac0bf 100644 --- a/isInteger.js +++ b/isInteger.js @@ -1,4 +1,4 @@ -import toInteger from './toInteger'; +import toInteger from './toInteger.js'; /** * Checks if `value` is an integer. diff --git a/isMap.js b/isMap.js index fbca4571d..8c1578c7d 100644 --- a/isMap.js +++ b/isMap.js @@ -1,5 +1,5 @@ -import getTag from './_getTag'; -import isObjectLike from './isObjectLike'; +import getTag from './_getTag.js'; +import isObjectLike from './isObjectLike.js'; /** `Object#toString` result references. */ var mapTag = '[object Map]'; diff --git a/isMatch.js b/isMatch.js index 721c9b9ae..f45e69101 100644 --- a/isMatch.js +++ b/isMatch.js @@ -1,5 +1,5 @@ -import baseIsMatch from './_baseIsMatch'; -import getMatchData from './_getMatchData'; +import baseIsMatch from './_baseIsMatch.js'; +import getMatchData from './_getMatchData.js'; /** * Performs a partial deep comparison between `object` and `source` to diff --git a/isMatchWith.js b/isMatchWith.js index 0065aa3f6..aeec8f57e 100644 --- a/isMatchWith.js +++ b/isMatchWith.js @@ -1,5 +1,5 @@ -import baseIsMatch from './_baseIsMatch'; -import getMatchData from './_getMatchData'; +import baseIsMatch from './_baseIsMatch.js'; +import getMatchData from './_getMatchData.js'; /** * This method is like `_.isMatch` except that it accepts `customizer` which diff --git a/isNaN.js b/isNaN.js index 90e83bf55..c1747b369 100644 --- a/isNaN.js +++ b/isNaN.js @@ -1,4 +1,4 @@ -import isNumber from './isNumber'; +import isNumber from './isNumber.js'; /** * Checks if `value` is `NaN`. diff --git a/isNative.js b/isNative.js index d7641c0b2..564b7aca7 100644 --- a/isNative.js +++ b/isNative.js @@ -1,34 +1,16 @@ -import isFunction from './isFunction'; -import isHostObject from './_isHostObject'; -import isObject from './isObject'; -import toSource from './_toSource'; +import baseIsNative from './_baseIsNative.js'; +import isMaskable from './_isMaskable.js'; /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** - * Checks if `value` is a native function. + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the + * presence of the `core-js` package because `core-js` circumvents this kind + * of detection. Despite multiple requests, the `core-js` maintainer has made + * it clear: any attempt to fix the detection will be obstructed. As a result, + * we're left with little choice but to throw an error. Unfortunately, this + * also affects packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on `core-js`. * * @static * @memberOf _ @@ -46,11 +28,10 @@ var reIsNative = RegExp('^' + * // => false */ function isNative(value) { - if (!isObject(value)) { - return false; + if (isMaskable(value)) { + throw new Error('This method is not supported with `core-js`. Try https://github.com/es-shims.'); } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); + return baseIsNative(value); } export default isNative; diff --git a/isNumber.js b/isNumber.js index 4b3a66933..608378a31 100644 --- a/isNumber.js +++ b/isNumber.js @@ -1,4 +1,4 @@ -import isObjectLike from './isObjectLike'; +import isObjectLike from './isObjectLike.js'; /** `Object#toString` result references. */ var numberTag = '[object Number]'; diff --git a/isPlainObject.js b/isPlainObject.js index 8dab09ef4..804b380eb 100644 --- a/isPlainObject.js +++ b/isPlainObject.js @@ -1,6 +1,6 @@ -import getPrototype from './_getPrototype'; -import isHostObject from './_isHostObject'; -import isObjectLike from './isObjectLike'; +import getPrototype from './_getPrototype.js'; +import isHostObject from './_isHostObject.js'; +import isObjectLike from './isObjectLike.js'; /** `Object#toString` result references. */ var objectTag = '[object Object]'; diff --git a/isRegExp.js b/isRegExp.js index a52d2159a..d60258466 100644 --- a/isRegExp.js +++ b/isRegExp.js @@ -1,4 +1,4 @@ -import isObject from './isObject'; +import isObject from './isObject.js'; /** `Object#toString` result references. */ var regexpTag = '[object RegExp]'; diff --git a/isSafeInteger.js b/isSafeInteger.js index 50662f1bf..a983c8146 100644 --- a/isSafeInteger.js +++ b/isSafeInteger.js @@ -1,4 +1,4 @@ -import isInteger from './isInteger'; +import isInteger from './isInteger.js'; /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; diff --git a/isSet.js b/isSet.js index 8631f30ca..9089847b2 100644 --- a/isSet.js +++ b/isSet.js @@ -1,5 +1,5 @@ -import getTag from './_getTag'; -import isObjectLike from './isObjectLike'; +import getTag from './_getTag.js'; +import isObjectLike from './isObjectLike.js'; /** `Object#toString` result references. */ var setTag = '[object Set]'; diff --git a/isString.js b/isString.js index de9d971ea..1c82368e4 100644 --- a/isString.js +++ b/isString.js @@ -1,5 +1,5 @@ -import isArray from './isArray'; -import isObjectLike from './isObjectLike'; +import isArray from './isArray.js'; +import isObjectLike from './isObjectLike.js'; /** `Object#toString` result references. */ var stringTag = '[object String]'; diff --git a/isSymbol.js b/isSymbol.js index d068b3862..c32bb5b48 100644 --- a/isSymbol.js +++ b/isSymbol.js @@ -1,4 +1,4 @@ -import isObjectLike from './isObjectLike'; +import isObjectLike from './isObjectLike.js'; /** `Object#toString` result references. */ var symbolTag = '[object Symbol]'; diff --git a/isTypedArray.js b/isTypedArray.js index 34cdc702e..087d6152c 100644 --- a/isTypedArray.js +++ b/isTypedArray.js @@ -1,5 +1,5 @@ -import isLength from './isLength'; -import isObjectLike from './isObjectLike'; +import isLength from './isLength.js'; +import isObjectLike from './isObjectLike.js'; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', diff --git a/isWeakMap.js b/isWeakMap.js index b1c52d892..1a440c807 100644 --- a/isWeakMap.js +++ b/isWeakMap.js @@ -1,5 +1,5 @@ -import getTag from './_getTag'; -import isObjectLike from './isObjectLike'; +import getTag from './_getTag.js'; +import isObjectLike from './isObjectLike.js'; /** `Object#toString` result references. */ var weakMapTag = '[object WeakMap]'; diff --git a/isWeakSet.js b/isWeakSet.js index 70ee0c3ec..e20d9b5fd 100644 --- a/isWeakSet.js +++ b/isWeakSet.js @@ -1,4 +1,4 @@ -import isObjectLike from './isObjectLike'; +import isObjectLike from './isObjectLike.js'; /** `Object#toString` result references. */ var weakSetTag = '[object WeakSet]'; diff --git a/iteratee.js b/iteratee.js index bc2aead60..07256b473 100644 --- a/iteratee.js +++ b/iteratee.js @@ -1,5 +1,5 @@ -import baseClone from './_baseClone'; -import baseIteratee from './_baseIteratee'; +import baseClone from './_baseClone.js'; +import baseIteratee from './_baseIteratee.js'; /** * Creates a function that invokes `func` with the arguments of the created diff --git a/kebabCase.js b/kebabCase.js index 6880ce2e6..1df34db96 100644 --- a/kebabCase.js +++ b/kebabCase.js @@ -1,4 +1,4 @@ -import createCompounder from './_createCompounder'; +import createCompounder from './_createCompounder.js'; /** * Converts `string` to diff --git a/keyBy.js b/keyBy.js index 771a0d8a8..3b140095c 100644 --- a/keyBy.js +++ b/keyBy.js @@ -1,4 +1,4 @@ -import createAggregator from './_createAggregator'; +import createAggregator from './_createAggregator.js'; /** * Creates an object composed of keys generated from the results of running diff --git a/keys.js b/keys.js index 6abc5fe39..2af3acf8c 100644 --- a/keys.js +++ b/keys.js @@ -1,9 +1,9 @@ -import baseHas from './_baseHas'; -import baseKeys from './_baseKeys'; -import indexKeys from './_indexKeys'; -import isArrayLike from './isArrayLike'; -import isIndex from './_isIndex'; -import isPrototype from './_isPrototype'; +import baseHas from './_baseHas.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`. diff --git a/keysIn.js b/keysIn.js index d61f12306..accdcd580 100644 --- a/keysIn.js +++ b/keysIn.js @@ -1,7 +1,7 @@ -import baseKeysIn from './_baseKeysIn'; -import indexKeys from './_indexKeys'; -import isIndex from './_isIndex'; -import isPrototype from './_isPrototype'; +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; diff --git a/lang.default.js b/lang.default.js index 8996b1d56..e51ba3aa0 100644 --- a/lang.default.js +++ b/lang.default.js @@ -1,58 +1,58 @@ -import castArray from './castArray'; -import clone from './clone'; -import cloneDeep from './cloneDeep'; -import cloneDeepWith from './cloneDeepWith'; -import cloneWith from './cloneWith'; -import eq from './eq'; -import gt from './gt'; -import gte from './gte'; -import isArguments from './isArguments'; -import isArray from './isArray'; -import isArrayBuffer from './isArrayBuffer'; -import isArrayLike from './isArrayLike'; -import isArrayLikeObject from './isArrayLikeObject'; -import isBoolean from './isBoolean'; -import isBuffer from './isBuffer'; -import isDate from './isDate'; -import isElement from './isElement'; -import isEmpty from './isEmpty'; -import isEqual from './isEqual'; -import isEqualWith from './isEqualWith'; -import isError from './isError'; -import isFinite from './isFinite'; -import isFunction from './isFunction'; -import isInteger from './isInteger'; -import isLength from './isLength'; -import isMap from './isMap'; -import isMatch from './isMatch'; -import isMatchWith from './isMatchWith'; -import isNaN from './isNaN'; -import isNative from './isNative'; -import isNil from './isNil'; -import isNull from './isNull'; -import isNumber from './isNumber'; -import isObject from './isObject'; -import isObjectLike from './isObjectLike'; -import isPlainObject from './isPlainObject'; -import isRegExp from './isRegExp'; -import isSafeInteger from './isSafeInteger'; -import isSet from './isSet'; -import isString from './isString'; -import isSymbol from './isSymbol'; -import isTypedArray from './isTypedArray'; -import isUndefined from './isUndefined'; -import isWeakMap from './isWeakMap'; -import isWeakSet from './isWeakSet'; -import lt from './lt'; -import lte from './lte'; -import toArray from './toArray'; -import toFinite from './toFinite'; -import toInteger from './toInteger'; -import toLength from './toLength'; -import toNumber from './toNumber'; -import toPlainObject from './toPlainObject'; -import toSafeInteger from './toSafeInteger'; -import toString from './toString'; +import castArray from './castArray.js'; +import clone from './clone.js'; +import cloneDeep from './cloneDeep.js'; +import cloneDeepWith from './cloneDeepWith.js'; +import cloneWith from './cloneWith.js'; +import eq from './eq.js'; +import gt from './gt.js'; +import gte from './gte.js'; +import isArguments from './isArguments.js'; +import isArray from './isArray.js'; +import isArrayBuffer from './isArrayBuffer.js'; +import isArrayLike from './isArrayLike.js'; +import isArrayLikeObject from './isArrayLikeObject.js'; +import isBoolean from './isBoolean.js'; +import isBuffer from './isBuffer.js'; +import isDate from './isDate.js'; +import isElement from './isElement.js'; +import isEmpty from './isEmpty.js'; +import isEqual from './isEqual.js'; +import isEqualWith from './isEqualWith.js'; +import isError from './isError.js'; +import isFinite from './isFinite.js'; +import isFunction from './isFunction.js'; +import isInteger from './isInteger.js'; +import isLength from './isLength.js'; +import isMap from './isMap.js'; +import isMatch from './isMatch.js'; +import isMatchWith from './isMatchWith.js'; +import isNaN from './isNaN.js'; +import isNative from './isNative.js'; +import isNil from './isNil.js'; +import isNull from './isNull.js'; +import isNumber from './isNumber.js'; +import isObject from './isObject.js'; +import isObjectLike from './isObjectLike.js'; +import isPlainObject from './isPlainObject.js'; +import isRegExp from './isRegExp.js'; +import isSafeInteger from './isSafeInteger.js'; +import isSet from './isSet.js'; +import isString from './isString.js'; +import isSymbol from './isSymbol.js'; +import isTypedArray from './isTypedArray.js'; +import isUndefined from './isUndefined.js'; +import isWeakMap from './isWeakMap.js'; +import isWeakSet from './isWeakSet.js'; +import lt from './lt.js'; +import lte from './lte.js'; +import toArray from './toArray.js'; +import toFinite from './toFinite.js'; +import toInteger from './toInteger.js'; +import toLength from './toLength.js'; +import toNumber from './toNumber.js'; +import toPlainObject from './toPlainObject.js'; +import toSafeInteger from './toSafeInteger.js'; +import toString from './toString.js'; export default { castArray, clone, cloneDeep, cloneDeepWith, cloneWith, diff --git a/lang.js b/lang.js index 2c027be03..6490eb4ec 100644 --- a/lang.js +++ b/lang.js @@ -1,56 +1,56 @@ -export { default as castArray } from './castArray'; -export { default as clone } from './clone'; -export { default as cloneDeep } from './cloneDeep'; -export { default as cloneDeepWith } from './cloneDeepWith'; -export { default as cloneWith } from './cloneWith'; -export { default as eq } from './eq'; -export { default as gt } from './gt'; -export { default as gte } from './gte'; -export { default as isArguments } from './isArguments'; -export { default as isArray } from './isArray'; -export { default as isArrayBuffer } from './isArrayBuffer'; -export { default as isArrayLike } from './isArrayLike'; -export { default as isArrayLikeObject } from './isArrayLikeObject'; -export { default as isBoolean } from './isBoolean'; -export { default as isBuffer } from './isBuffer'; -export { default as isDate } from './isDate'; -export { default as isElement } from './isElement'; -export { default as isEmpty } from './isEmpty'; -export { default as isEqual } from './isEqual'; -export { default as isEqualWith } from './isEqualWith'; -export { default as isError } from './isError'; -export { default as isFinite } from './isFinite'; -export { default as isFunction } from './isFunction'; -export { default as isInteger } from './isInteger'; -export { default as isLength } from './isLength'; -export { default as isMap } from './isMap'; -export { default as isMatch } from './isMatch'; -export { default as isMatchWith } from './isMatchWith'; -export { default as isNaN } from './isNaN'; -export { default as isNative } from './isNative'; -export { default as isNil } from './isNil'; -export { default as isNull } from './isNull'; -export { default as isNumber } from './isNumber'; -export { default as isObject } from './isObject'; -export { default as isObjectLike } from './isObjectLike'; -export { default as isPlainObject } from './isPlainObject'; -export { default as isRegExp } from './isRegExp'; -export { default as isSafeInteger } from './isSafeInteger'; -export { default as isSet } from './isSet'; -export { default as isString } from './isString'; -export { default as isSymbol } from './isSymbol'; -export { default as isTypedArray } from './isTypedArray'; -export { default as isUndefined } from './isUndefined'; -export { default as isWeakMap } from './isWeakMap'; -export { default as isWeakSet } from './isWeakSet'; -export { default as lt } from './lt'; -export { default as lte } from './lte'; -export { default as toArray } from './toArray'; -export { default as toFinite } from './toFinite'; -export { default as toInteger } from './toInteger'; -export { default as toLength } from './toLength'; -export { default as toNumber } from './toNumber'; -export { default as toPlainObject } from './toPlainObject'; -export { default as toSafeInteger } from './toSafeInteger'; -export { default as toString } from './toString'; +export { default as castArray } from './castArray.js'; +export { default as clone } from './clone.js'; +export { default as cloneDeep } from './cloneDeep.js'; +export { default as cloneDeepWith } from './cloneDeepWith.js'; +export { default as cloneWith } from './cloneWith.js'; +export { default as eq } from './eq.js'; +export { default as gt } from './gt.js'; +export { default as gte } from './gte.js'; +export { default as isArguments } from './isArguments.js'; +export { default as isArray } from './isArray.js'; +export { default as isArrayBuffer } from './isArrayBuffer.js'; +export { default as isArrayLike } from './isArrayLike.js'; +export { default as isArrayLikeObject } from './isArrayLikeObject.js'; +export { default as isBoolean } from './isBoolean.js'; +export { default as isBuffer } from './isBuffer.js'; +export { default as isDate } from './isDate.js'; +export { default as isElement } from './isElement.js'; +export { default as isEmpty } from './isEmpty.js'; +export { default as isEqual } from './isEqual.js'; +export { default as isEqualWith } from './isEqualWith.js'; +export { default as isError } from './isError.js'; +export { default as isFinite } from './isFinite.js'; +export { default as isFunction } from './isFunction.js'; +export { default as isInteger } from './isInteger.js'; +export { default as isLength } from './isLength.js'; +export { default as isMap } from './isMap.js'; +export { default as isMatch } from './isMatch.js'; +export { default as isMatchWith } from './isMatchWith.js'; +export { default as isNaN } from './isNaN.js'; +export { default as isNative } from './isNative.js'; +export { default as isNil } from './isNil.js'; +export { default as isNull } from './isNull.js'; +export { default as isNumber } from './isNumber.js'; +export { default as isObject } from './isObject.js'; +export { default as isObjectLike } from './isObjectLike.js'; +export { default as isPlainObject } from './isPlainObject.js'; +export { default as isRegExp } from './isRegExp.js'; +export { default as isSafeInteger } from './isSafeInteger.js'; +export { default as isSet } from './isSet.js'; +export { default as isString } from './isString.js'; +export { default as isSymbol } from './isSymbol.js'; +export { default as isTypedArray } from './isTypedArray.js'; +export { default as isUndefined } from './isUndefined.js'; +export { default as isWeakMap } from './isWeakMap.js'; +export { default as isWeakSet } from './isWeakSet.js'; +export { default as lt } from './lt.js'; +export { default as lte } from './lte.js'; +export { default as toArray } from './toArray.js'; +export { default as toFinite } from './toFinite.js'; +export { default as toInteger } from './toInteger.js'; +export { default as toLength } from './toLength.js'; +export { default as toNumber } from './toNumber.js'; +export { default as toPlainObject } from './toPlainObject.js'; +export { default as toSafeInteger } from './toSafeInteger.js'; +export { default as toString } from './toString.js'; export { default as default } from './lang.default'; diff --git a/lastIndexOf.js b/lastIndexOf.js index 80ea69b73..e90ce3078 100644 --- a/lastIndexOf.js +++ b/lastIndexOf.js @@ -1,5 +1,5 @@ -import indexOfNaN from './_indexOfNaN'; -import toInteger from './toInteger'; +import indexOfNaN from './_indexOfNaN.js'; +import toInteger from './toInteger.js'; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max, @@ -41,7 +41,7 @@ function lastIndexOf(array, value, fromIndex) { ) + 1; } if (value !== value) { - return indexOfNaN(array, index, true); + return indexOfNaN(array, index - 1, true); } while (index--) { if (array[index] === value) { diff --git a/lodash.default.js b/lodash.default.js index a0bb35f4a..f90bc9e83 100644 --- a/lodash.default.js +++ b/lodash.default.js @@ -7,44 +7,44 @@ * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -import array from './array'; -import collection from './collection'; -import date from './date'; -import func from './function'; -import lang from './lang'; -import math from './math'; -import number from './number'; -import object from './object'; -import seq from './seq'; -import string from './string'; -import util from './util'; -import LazyWrapper from './_LazyWrapper'; -import LodashWrapper from './_LodashWrapper'; -import Symbol from './_Symbol'; -import arrayEach from './_arrayEach'; -import arrayPush from './_arrayPush'; -import baseForOwn from './_baseForOwn'; -import baseFunctions from './_baseFunctions'; -import baseInvoke from './_baseInvoke'; -import baseIteratee from './_baseIteratee'; -import createHybridWrapper from './_createHybridWrapper'; -import identity from './identity'; -import isArray from './isArray'; -import isObject from './isObject'; -import keys from './keys'; -import last from './last'; -import lazyClone from './_lazyClone'; -import lazyReverse from './_lazyReverse'; -import lazyValue from './_lazyValue'; -import _mixin from './mixin'; -import realNames from './_realNames'; -import rest from './rest'; -import thru from './thru'; -import toInteger from './toInteger'; -import lodash from './wrapperLodash'; +import array from './array.js'; +import collection from './collection.js'; +import date from './date.js'; +import func from './function.js'; +import lang from './lang.js'; +import math from './math.js'; +import number from './number.js'; +import object from './object.js'; +import seq from './seq.js'; +import string from './string.js'; +import util from './util.js'; +import LazyWrapper from './_LazyWrapper.js'; +import LodashWrapper from './_LodashWrapper.js'; +import Symbol from './_Symbol.js'; +import arrayEach from './_arrayEach.js'; +import arrayPush from './_arrayPush.js'; +import baseForOwn from './_baseForOwn.js'; +import baseFunctions from './_baseFunctions.js'; +import baseInvoke from './_baseInvoke.js'; +import baseIteratee from './_baseIteratee.js'; +import createHybridWrapper from './_createHybridWrapper.js'; +import identity from './identity.js'; +import isArray from './isArray.js'; +import isObject from './isObject.js'; +import keys from './keys.js'; +import last from './last.js'; +import lazyClone from './_lazyClone.js'; +import lazyReverse from './_lazyReverse.js'; +import lazyValue from './_lazyValue.js'; +import _mixin from './mixin.js'; +import realNames from './_realNames.js'; +import rest from './rest.js'; +import thru from './thru.js'; +import toInteger from './toInteger.js'; +import lodash from './wrapperLodash.js'; /** Used as the semantic version number. */ -var VERSION = '4.12.0'; +var VERSION = '4.13.0'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_KEY_FLAG = 2; @@ -341,6 +341,11 @@ lodash.mean = math.mean; lodash.meanBy = math.meanBy; lodash.min = math.min; lodash.minBy = math.minBy; +lodash.stubArray = util.stubArray; +lodash.stubFalse = util.stubFalse; +lodash.stubObject = util.stubObject; +lodash.stubString = util.stubString; +lodash.stubTrue = util.stubTrue; lodash.multiply = math.multiply; lodash.nth = array.nth; lodash.noop = util.noop; diff --git a/lodash.js b/lodash.js index f00a4f2c9..56af7f7d4 100644 --- a/lodash.js +++ b/lodash.js @@ -7,318 +7,323 @@ * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -export { default as add } from './add'; -export { default as after } from './after'; -export { default as ary } from './ary'; -export { default as assign } from './assign'; -export { default as assignIn } from './assignIn'; -export { default as assignInWith } from './assignInWith'; -export { default as assignWith } from './assignWith'; -export { default as at } from './at'; -export { default as attempt } from './attempt'; -export { default as before } from './before'; -export { default as bind } from './bind'; -export { default as bindAll } from './bindAll'; -export { default as bindKey } from './bindKey'; -export { default as camelCase } from './camelCase'; -export { default as capitalize } from './capitalize'; -export { default as castArray } from './castArray'; -export { default as ceil } from './ceil'; -export { default as chain } from './chain'; -export { default as chunk } from './chunk'; -export { default as clamp } from './clamp'; -export { default as clone } from './clone'; -export { default as cloneDeep } from './cloneDeep'; -export { default as cloneDeepWith } from './cloneDeepWith'; -export { default as cloneWith } from './cloneWith'; -export { default as commit } from './commit'; -export { default as compact } from './compact'; -export { default as concat } from './concat'; -export { default as cond } from './cond'; -export { default as conforms } from './conforms'; -export { default as constant } from './constant'; -export { default as countBy } from './countBy'; -export { default as create } from './create'; -export { default as curry } from './curry'; -export { default as curryRight } from './curryRight'; -export { default as debounce } from './debounce'; -export { default as deburr } from './deburr'; -export { default as defaults } from './defaults'; -export { default as defaultsDeep } from './defaultsDeep'; -export { default as defer } from './defer'; -export { default as delay } from './delay'; -export { default as difference } from './difference'; -export { default as differenceBy } from './differenceBy'; -export { default as differenceWith } from './differenceWith'; -export { default as divide } from './divide'; -export { default as drop } from './drop'; -export { default as dropRight } from './dropRight'; -export { default as dropRightWhile } from './dropRightWhile'; -export { default as dropWhile } from './dropWhile'; -export { default as each } from './each'; -export { default as eachRight } from './eachRight'; -export { default as endsWith } from './endsWith'; -export { default as entries } from './entries'; -export { default as entriesIn } from './entriesIn'; -export { default as eq } from './eq'; -export { default as escape } from './escape'; -export { default as escapeRegExp } from './escapeRegExp'; -export { default as every } from './every'; -export { default as extend } from './extend'; -export { default as extendWith } from './extendWith'; -export { default as fill } from './fill'; -export { default as filter } from './filter'; -export { default as find } from './find'; -export { default as findIndex } from './findIndex'; -export { default as findKey } from './findKey'; -export { default as findLast } from './findLast'; -export { default as findLastIndex } from './findLastIndex'; -export { default as findLastKey } from './findLastKey'; -export { default as first } from './first'; -export { default as flatMap } from './flatMap'; -export { default as flatMapDeep } from './flatMapDeep'; -export { default as flatMapDepth } from './flatMapDepth'; -export { default as flatten } from './flatten'; -export { default as flattenDeep } from './flattenDeep'; -export { default as flattenDepth } from './flattenDepth'; -export { default as flip } from './flip'; -export { default as floor } from './floor'; -export { default as flow } from './flow'; -export { default as flowRight } from './flowRight'; -export { default as forEach } from './forEach'; -export { default as forEachRight } from './forEachRight'; -export { default as forIn } from './forIn'; -export { default as forInRight } from './forInRight'; -export { default as forOwn } from './forOwn'; -export { default as forOwnRight } from './forOwnRight'; -export { default as fromPairs } from './fromPairs'; -export { default as functions } from './functions'; -export { default as functionsIn } from './functionsIn'; -export { default as get } from './get'; -export { default as groupBy } from './groupBy'; -export { default as gt } from './gt'; -export { default as gte } from './gte'; -export { default as has } from './has'; -export { default as hasIn } from './hasIn'; -export { default as head } from './head'; -export { default as identity } from './identity'; -export { default as inRange } from './inRange'; -export { default as includes } from './includes'; -export { default as indexOf } from './indexOf'; -export { default as initial } from './initial'; -export { default as intersection } from './intersection'; -export { default as intersectionBy } from './intersectionBy'; -export { default as intersectionWith } from './intersectionWith'; -export { default as invert } from './invert'; -export { default as invertBy } from './invertBy'; -export { default as invoke } from './invoke'; -export { default as invokeMap } from './invokeMap'; -export { default as isArguments } from './isArguments'; -export { default as isArray } from './isArray'; -export { default as isArrayBuffer } from './isArrayBuffer'; -export { default as isArrayLike } from './isArrayLike'; -export { default as isArrayLikeObject } from './isArrayLikeObject'; -export { default as isBoolean } from './isBoolean'; -export { default as isBuffer } from './isBuffer'; -export { default as isDate } from './isDate'; -export { default as isElement } from './isElement'; -export { default as isEmpty } from './isEmpty'; -export { default as isEqual } from './isEqual'; -export { default as isEqualWith } from './isEqualWith'; -export { default as isError } from './isError'; -export { default as isFinite } from './isFinite'; -export { default as isFunction } from './isFunction'; -export { default as isInteger } from './isInteger'; -export { default as isLength } from './isLength'; -export { default as isMap } from './isMap'; -export { default as isMatch } from './isMatch'; -export { default as isMatchWith } from './isMatchWith'; -export { default as isNaN } from './isNaN'; -export { default as isNative } from './isNative'; -export { default as isNil } from './isNil'; -export { default as isNull } from './isNull'; -export { default as isNumber } from './isNumber'; -export { default as isObject } from './isObject'; -export { default as isObjectLike } from './isObjectLike'; -export { default as isPlainObject } from './isPlainObject'; -export { default as isRegExp } from './isRegExp'; -export { default as isSafeInteger } from './isSafeInteger'; -export { default as isSet } from './isSet'; -export { default as isString } from './isString'; -export { default as isSymbol } from './isSymbol'; -export { default as isTypedArray } from './isTypedArray'; -export { default as isUndefined } from './isUndefined'; -export { default as isWeakMap } from './isWeakMap'; -export { default as isWeakSet } from './isWeakSet'; -export { default as iteratee } from './iteratee'; -export { default as join } from './join'; -export { default as kebabCase } from './kebabCase'; -export { default as keyBy } from './keyBy'; -export { default as keys } from './keys'; -export { default as keysIn } from './keysIn'; -export { default as last } from './last'; -export { default as lastIndexOf } from './lastIndexOf'; -export { default as lodash } from './wrapperLodash'; -export { default as lowerCase } from './lowerCase'; -export { default as lowerFirst } from './lowerFirst'; -export { default as lt } from './lt'; -export { default as lte } from './lte'; -export { default as map } from './map'; -export { default as mapKeys } from './mapKeys'; -export { default as mapValues } from './mapValues'; -export { default as matches } from './matches'; -export { default as matchesProperty } from './matchesProperty'; -export { default as max } from './max'; -export { default as maxBy } from './maxBy'; -export { default as mean } from './mean'; -export { default as meanBy } from './meanBy'; -export { default as memoize } from './memoize'; -export { default as merge } from './merge'; -export { default as mergeWith } from './mergeWith'; -export { default as method } from './method'; -export { default as methodOf } from './methodOf'; -export { default as min } from './min'; -export { default as minBy } from './minBy'; -export { default as mixin } from './mixin'; -export { default as multiply } from './multiply'; -export { default as negate } from './negate'; -export { default as next } from './next'; -export { default as noop } from './noop'; -export { default as now } from './now'; -export { default as nth } from './nth'; -export { default as nthArg } from './nthArg'; -export { default as omit } from './omit'; -export { default as omitBy } from './omitBy'; -export { default as once } from './once'; -export { default as orderBy } from './orderBy'; -export { default as over } from './over'; -export { default as overArgs } from './overArgs'; -export { default as overEvery } from './overEvery'; -export { default as overSome } from './overSome'; -export { default as pad } from './pad'; -export { default as padEnd } from './padEnd'; -export { default as padStart } from './padStart'; -export { default as parseInt } from './parseInt'; -export { default as partial } from './partial'; -export { default as partialRight } from './partialRight'; -export { default as partition } from './partition'; -export { default as pick } from './pick'; -export { default as pickBy } from './pickBy'; -export { default as plant } from './plant'; -export { default as property } from './property'; -export { default as propertyOf } from './propertyOf'; -export { default as pull } from './pull'; -export { default as pullAll } from './pullAll'; -export { default as pullAllBy } from './pullAllBy'; -export { default as pullAllWith } from './pullAllWith'; -export { default as pullAt } from './pullAt'; -export { default as random } from './random'; -export { default as range } from './range'; -export { default as rangeRight } from './rangeRight'; -export { default as rearg } from './rearg'; -export { default as reduce } from './reduce'; -export { default as reduceRight } from './reduceRight'; -export { default as reject } from './reject'; -export { default as remove } from './remove'; -export { default as repeat } from './repeat'; -export { default as replace } from './replace'; -export { default as rest } from './rest'; -export { default as result } from './result'; -export { default as reverse } from './reverse'; -export { default as round } from './round'; -export { default as sample } from './sample'; -export { default as sampleSize } from './sampleSize'; -export { default as set } from './set'; -export { default as setWith } from './setWith'; -export { default as shuffle } from './shuffle'; -export { default as size } from './size'; -export { default as slice } from './slice'; -export { default as snakeCase } from './snakeCase'; -export { default as some } from './some'; -export { default as sortBy } from './sortBy'; -export { default as sortedIndex } from './sortedIndex'; -export { default as sortedIndexBy } from './sortedIndexBy'; -export { default as sortedIndexOf } from './sortedIndexOf'; -export { default as sortedLastIndex } from './sortedLastIndex'; -export { default as sortedLastIndexBy } from './sortedLastIndexBy'; -export { default as sortedLastIndexOf } from './sortedLastIndexOf'; -export { default as sortedUniq } from './sortedUniq'; -export { default as sortedUniqBy } from './sortedUniqBy'; -export { default as split } from './split'; -export { default as spread } from './spread'; -export { default as startCase } from './startCase'; -export { default as startsWith } from './startsWith'; -export { default as subtract } from './subtract'; -export { default as sum } from './sum'; -export { default as sumBy } from './sumBy'; -export { default as tail } from './tail'; -export { default as take } from './take'; -export { default as takeRight } from './takeRight'; -export { default as takeRightWhile } from './takeRightWhile'; -export { default as takeWhile } from './takeWhile'; -export { default as tap } from './tap'; -export { default as template } from './template'; -export { default as templateSettings } from './templateSettings'; -export { default as throttle } from './throttle'; -export { default as thru } from './thru'; -export { default as times } from './times'; -export { default as toArray } from './toArray'; -export { default as toFinite } from './toFinite'; -export { default as toInteger } from './toInteger'; -export { default as toIterator } from './toIterator'; -export { default as toJSON } from './toJSON'; -export { default as toLength } from './toLength'; -export { default as toLower } from './toLower'; -export { default as toNumber } from './toNumber'; -export { default as toPairs } from './toPairs'; -export { default as toPairsIn } from './toPairsIn'; -export { default as toPath } from './toPath'; -export { default as toPlainObject } from './toPlainObject'; -export { default as toSafeInteger } from './toSafeInteger'; -export { default as toString } from './toString'; -export { default as toUpper } from './toUpper'; -export { default as transform } from './transform'; -export { default as trim } from './trim'; -export { default as trimEnd } from './trimEnd'; -export { default as trimStart } from './trimStart'; -export { default as truncate } from './truncate'; -export { default as unary } from './unary'; -export { default as unescape } from './unescape'; -export { default as union } from './union'; -export { default as unionBy } from './unionBy'; -export { default as unionWith } from './unionWith'; -export { default as uniq } from './uniq'; -export { default as uniqBy } from './uniqBy'; -export { default as uniqWith } from './uniqWith'; -export { default as uniqueId } from './uniqueId'; -export { default as unset } from './unset'; -export { default as unzip } from './unzip'; -export { default as unzipWith } from './unzipWith'; -export { default as update } from './update'; -export { default as updateWith } from './updateWith'; -export { default as upperCase } from './upperCase'; -export { default as upperFirst } from './upperFirst'; -export { default as value } from './value'; -export { default as valueOf } from './valueOf'; -export { default as values } from './values'; -export { default as valuesIn } from './valuesIn'; -export { default as without } from './without'; -export { default as words } from './words'; -export { default as wrap } from './wrap'; -export { default as wrapperAt } from './wrapperAt'; -export { default as wrapperChain } from './wrapperChain'; -export { default as wrapperCommit } from './commit'; -export { default as wrapperLodash } from './wrapperLodash'; -export { default as wrapperNext } from './next'; -export { default as wrapperPlant } from './plant'; -export { default as wrapperReverse } from './wrapperReverse'; -export { default as wrapperToIterator } from './toIterator'; -export { default as wrapperValue } from './wrapperValue'; -export { default as xor } from './xor'; -export { default as xorBy } from './xorBy'; -export { default as xorWith } from './xorWith'; -export { default as zip } from './zip'; -export { default as zipObject } from './zipObject'; -export { default as zipObjectDeep } from './zipObjectDeep'; -export { default as zipWith } from './zipWith'; +export { default as add } from './add.js'; +export { default as after } from './after.js'; +export { default as ary } from './ary.js'; +export { default as assign } from './assign.js'; +export { default as assignIn } from './assignIn.js'; +export { default as assignInWith } from './assignInWith.js'; +export { default as assignWith } from './assignWith.js'; +export { default as at } from './at.js'; +export { default as attempt } from './attempt.js'; +export { default as before } from './before.js'; +export { default as bind } from './bind.js'; +export { default as bindAll } from './bindAll.js'; +export { default as bindKey } from './bindKey.js'; +export { default as camelCase } from './camelCase.js'; +export { default as capitalize } from './capitalize.js'; +export { default as castArray } from './castArray.js'; +export { default as ceil } from './ceil.js'; +export { default as chain } from './chain.js'; +export { default as chunk } from './chunk.js'; +export { default as clamp } from './clamp.js'; +export { default as clone } from './clone.js'; +export { default as cloneDeep } from './cloneDeep.js'; +export { default as cloneDeepWith } from './cloneDeepWith.js'; +export { default as cloneWith } from './cloneWith.js'; +export { default as commit } from './commit.js'; +export { default as compact } from './compact.js'; +export { default as concat } from './concat.js'; +export { default as cond } from './cond.js'; +export { default as conforms } from './conforms.js'; +export { default as constant } from './constant.js'; +export { default as countBy } from './countBy.js'; +export { default as create } from './create.js'; +export { default as curry } from './curry.js'; +export { default as curryRight } from './curryRight.js'; +export { default as debounce } from './debounce.js'; +export { default as deburr } from './deburr.js'; +export { default as defaults } from './defaults.js'; +export { default as defaultsDeep } from './defaultsDeep.js'; +export { default as defer } from './defer.js'; +export { default as delay } from './delay.js'; +export { default as difference } from './difference.js'; +export { default as differenceBy } from './differenceBy.js'; +export { default as differenceWith } from './differenceWith.js'; +export { default as divide } from './divide.js'; +export { default as drop } from './drop.js'; +export { default as dropRight } from './dropRight.js'; +export { default as dropRightWhile } from './dropRightWhile.js'; +export { default as dropWhile } from './dropWhile.js'; +export { default as each } from './each.js'; +export { default as eachRight } from './eachRight.js'; +export { default as endsWith } from './endsWith.js'; +export { default as entries } from './entries.js'; +export { default as entriesIn } from './entriesIn.js'; +export { default as eq } from './eq.js'; +export { default as escape } from './escape.js'; +export { default as escapeRegExp } from './escapeRegExp.js'; +export { default as every } from './every.js'; +export { default as extend } from './extend.js'; +export { default as extendWith } from './extendWith.js'; +export { default as fill } from './fill.js'; +export { default as filter } from './filter.js'; +export { default as find } from './find.js'; +export { default as findIndex } from './findIndex.js'; +export { default as findKey } from './findKey.js'; +export { default as findLast } from './findLast.js'; +export { default as findLastIndex } from './findLastIndex.js'; +export { default as findLastKey } from './findLastKey.js'; +export { default as first } from './first.js'; +export { default as flatMap } from './flatMap.js'; +export { default as flatMapDeep } from './flatMapDeep.js'; +export { default as flatMapDepth } from './flatMapDepth.js'; +export { default as flatten } from './flatten.js'; +export { default as flattenDeep } from './flattenDeep.js'; +export { default as flattenDepth } from './flattenDepth.js'; +export { default as flip } from './flip.js'; +export { default as floor } from './floor.js'; +export { default as flow } from './flow.js'; +export { default as flowRight } from './flowRight.js'; +export { default as forEach } from './forEach.js'; +export { default as forEachRight } from './forEachRight.js'; +export { default as forIn } from './forIn.js'; +export { default as forInRight } from './forInRight.js'; +export { default as forOwn } from './forOwn.js'; +export { default as forOwnRight } from './forOwnRight.js'; +export { default as fromPairs } from './fromPairs.js'; +export { default as functions } from './functions.js'; +export { default as functionsIn } from './functionsIn.js'; +export { default as get } from './get.js'; +export { default as groupBy } from './groupBy.js'; +export { default as gt } from './gt.js'; +export { default as gte } from './gte.js'; +export { default as has } from './has.js'; +export { default as hasIn } from './hasIn.js'; +export { default as head } from './head.js'; +export { default as identity } from './identity.js'; +export { default as inRange } from './inRange.js'; +export { default as includes } from './includes.js'; +export { default as indexOf } from './indexOf.js'; +export { default as initial } from './initial.js'; +export { default as intersection } from './intersection.js'; +export { default as intersectionBy } from './intersectionBy.js'; +export { default as intersectionWith } from './intersectionWith.js'; +export { default as invert } from './invert.js'; +export { default as invertBy } from './invertBy.js'; +export { default as invoke } from './invoke.js'; +export { default as invokeMap } from './invokeMap.js'; +export { default as isArguments } from './isArguments.js'; +export { default as isArray } from './isArray.js'; +export { default as isArrayBuffer } from './isArrayBuffer.js'; +export { default as isArrayLike } from './isArrayLike.js'; +export { default as isArrayLikeObject } from './isArrayLikeObject.js'; +export { default as isBoolean } from './isBoolean.js'; +export { default as isBuffer } from './isBuffer.js'; +export { default as isDate } from './isDate.js'; +export { default as isElement } from './isElement.js'; +export { default as isEmpty } from './isEmpty.js'; +export { default as isEqual } from './isEqual.js'; +export { default as isEqualWith } from './isEqualWith.js'; +export { default as isError } from './isError.js'; +export { default as isFinite } from './isFinite.js'; +export { default as isFunction } from './isFunction.js'; +export { default as isInteger } from './isInteger.js'; +export { default as isLength } from './isLength.js'; +export { default as isMap } from './isMap.js'; +export { default as isMatch } from './isMatch.js'; +export { default as isMatchWith } from './isMatchWith.js'; +export { default as isNaN } from './isNaN.js'; +export { default as isNative } from './isNative.js'; +export { default as isNil } from './isNil.js'; +export { default as isNull } from './isNull.js'; +export { default as isNumber } from './isNumber.js'; +export { default as isObject } from './isObject.js'; +export { default as isObjectLike } from './isObjectLike.js'; +export { default as isPlainObject } from './isPlainObject.js'; +export { default as isRegExp } from './isRegExp.js'; +export { default as isSafeInteger } from './isSafeInteger.js'; +export { default as isSet } from './isSet.js'; +export { default as isString } from './isString.js'; +export { default as isSymbol } from './isSymbol.js'; +export { default as isTypedArray } from './isTypedArray.js'; +export { default as isUndefined } from './isUndefined.js'; +export { default as isWeakMap } from './isWeakMap.js'; +export { default as isWeakSet } from './isWeakSet.js'; +export { default as iteratee } from './iteratee.js'; +export { default as join } from './join.js'; +export { default as kebabCase } from './kebabCase.js'; +export { default as keyBy } from './keyBy.js'; +export { default as keys } from './keys.js'; +export { default as keysIn } from './keysIn.js'; +export { default as last } from './last.js'; +export { default as lastIndexOf } from './lastIndexOf.js'; +export { default as lodash } from './wrapperLodash.js'; +export { default as lowerCase } from './lowerCase.js'; +export { default as lowerFirst } from './lowerFirst.js'; +export { default as lt } from './lt.js'; +export { default as lte } from './lte.js'; +export { default as map } from './map.js'; +export { default as mapKeys } from './mapKeys.js'; +export { default as mapValues } from './mapValues.js'; +export { default as matches } from './matches.js'; +export { default as matchesProperty } from './matchesProperty.js'; +export { default as max } from './max.js'; +export { default as maxBy } from './maxBy.js'; +export { default as mean } from './mean.js'; +export { default as meanBy } from './meanBy.js'; +export { default as memoize } from './memoize.js'; +export { default as merge } from './merge.js'; +export { default as mergeWith } from './mergeWith.js'; +export { default as method } from './method.js'; +export { default as methodOf } from './methodOf.js'; +export { default as min } from './min.js'; +export { default as minBy } from './minBy.js'; +export { default as mixin } from './mixin.js'; +export { default as multiply } from './multiply.js'; +export { default as negate } from './negate.js'; +export { default as next } from './next.js'; +export { default as noop } from './noop.js'; +export { default as now } from './now.js'; +export { default as nth } from './nth.js'; +export { default as nthArg } from './nthArg.js'; +export { default as omit } from './omit.js'; +export { default as omitBy } from './omitBy.js'; +export { default as once } from './once.js'; +export { default as orderBy } from './orderBy.js'; +export { default as over } from './over.js'; +export { default as overArgs } from './overArgs.js'; +export { default as overEvery } from './overEvery.js'; +export { default as overSome } from './overSome.js'; +export { default as pad } from './pad.js'; +export { default as padEnd } from './padEnd.js'; +export { default as padStart } from './padStart.js'; +export { default as parseInt } from './parseInt.js'; +export { default as partial } from './partial.js'; +export { default as partialRight } from './partialRight.js'; +export { default as partition } from './partition.js'; +export { default as pick } from './pick.js'; +export { default as pickBy } from './pickBy.js'; +export { default as plant } from './plant.js'; +export { default as property } from './property.js'; +export { default as propertyOf } from './propertyOf.js'; +export { default as pull } from './pull.js'; +export { default as pullAll } from './pullAll.js'; +export { default as pullAllBy } from './pullAllBy.js'; +export { default as pullAllWith } from './pullAllWith.js'; +export { default as pullAt } from './pullAt.js'; +export { default as random } from './random.js'; +export { default as range } from './range.js'; +export { default as rangeRight } from './rangeRight.js'; +export { default as rearg } from './rearg.js'; +export { default as reduce } from './reduce.js'; +export { default as reduceRight } from './reduceRight.js'; +export { default as reject } from './reject.js'; +export { default as remove } from './remove.js'; +export { default as repeat } from './repeat.js'; +export { default as replace } from './replace.js'; +export { default as rest } from './rest.js'; +export { default as result } from './result.js'; +export { default as reverse } from './reverse.js'; +export { default as round } from './round.js'; +export { default as sample } from './sample.js'; +export { default as sampleSize } from './sampleSize.js'; +export { default as set } from './set.js'; +export { default as setWith } from './setWith.js'; +export { default as shuffle } from './shuffle.js'; +export { default as size } from './size.js'; +export { default as slice } from './slice.js'; +export { default as snakeCase } from './snakeCase.js'; +export { default as some } from './some.js'; +export { default as sortBy } from './sortBy.js'; +export { default as sortedIndex } from './sortedIndex.js'; +export { default as sortedIndexBy } from './sortedIndexBy.js'; +export { default as sortedIndexOf } from './sortedIndexOf.js'; +export { default as sortedLastIndex } from './sortedLastIndex.js'; +export { default as sortedLastIndexBy } from './sortedLastIndexBy.js'; +export { default as sortedLastIndexOf } from './sortedLastIndexOf.js'; +export { default as sortedUniq } from './sortedUniq.js'; +export { default as sortedUniqBy } from './sortedUniqBy.js'; +export { default as split } from './split.js'; +export { default as spread } from './spread.js'; +export { default as startCase } from './startCase.js'; +export { default as startsWith } from './startsWith.js'; +export { default as stubArray } from './stubArray.js'; +export { default as stubFalse } from './stubFalse.js'; +export { default as stubObject } from './stubObject.js'; +export { default as stubString } from './stubString.js'; +export { default as stubTrue } from './stubTrue.js'; +export { default as subtract } from './subtract.js'; +export { default as sum } from './sum.js'; +export { default as sumBy } from './sumBy.js'; +export { default as tail } from './tail.js'; +export { default as take } from './take.js'; +export { default as takeRight } from './takeRight.js'; +export { default as takeRightWhile } from './takeRightWhile.js'; +export { default as takeWhile } from './takeWhile.js'; +export { default as tap } from './tap.js'; +export { default as template } from './template.js'; +export { default as templateSettings } from './templateSettings.js'; +export { default as throttle } from './throttle.js'; +export { default as thru } from './thru.js'; +export { default as times } from './times.js'; +export { default as toArray } from './toArray.js'; +export { default as toFinite } from './toFinite.js'; +export { default as toInteger } from './toInteger.js'; +export { default as toIterator } from './toIterator.js'; +export { default as toJSON } from './toJSON.js'; +export { default as toLength } from './toLength.js'; +export { default as toLower } from './toLower.js'; +export { default as toNumber } from './toNumber.js'; +export { default as toPairs } from './toPairs.js'; +export { default as toPairsIn } from './toPairsIn.js'; +export { default as toPath } from './toPath.js'; +export { default as toPlainObject } from './toPlainObject.js'; +export { default as toSafeInteger } from './toSafeInteger.js'; +export { default as toString } from './toString.js'; +export { default as toUpper } from './toUpper.js'; +export { default as transform } from './transform.js'; +export { default as trim } from './trim.js'; +export { default as trimEnd } from './trimEnd.js'; +export { default as trimStart } from './trimStart.js'; +export { default as truncate } from './truncate.js'; +export { default as unary } from './unary.js'; +export { default as unescape } from './unescape.js'; +export { default as union } from './union.js'; +export { default as unionBy } from './unionBy.js'; +export { default as unionWith } from './unionWith.js'; +export { default as uniq } from './uniq.js'; +export { default as uniqBy } from './uniqBy.js'; +export { default as uniqWith } from './uniqWith.js'; +export { default as uniqueId } from './uniqueId.js'; +export { default as unset } from './unset.js'; +export { default as unzip } from './unzip.js'; +export { default as unzipWith } from './unzipWith.js'; +export { default as update } from './update.js'; +export { default as updateWith } from './updateWith.js'; +export { default as upperCase } from './upperCase.js'; +export { default as upperFirst } from './upperFirst.js'; +export { default as value } from './value.js'; +export { default as valueOf } from './valueOf.js'; +export { default as values } from './values.js'; +export { default as valuesIn } from './valuesIn.js'; +export { default as without } from './without.js'; +export { default as words } from './words.js'; +export { default as wrap } from './wrap.js'; +export { default as wrapperAt } from './wrapperAt.js'; +export { default as wrapperChain } from './wrapperChain.js'; +export { default as wrapperCommit } from './commit.js'; +export { default as wrapperLodash } from './wrapperLodash.js'; +export { default as wrapperNext } from './next.js'; +export { default as wrapperPlant } from './plant.js'; +export { default as wrapperReverse } from './wrapperReverse.js'; +export { default as wrapperToIterator } from './toIterator.js'; +export { default as wrapperValue } from './wrapperValue.js'; +export { default as xor } from './xor.js'; +export { default as xorBy } from './xorBy.js'; +export { default as xorWith } from './xorWith.js'; +export { default as zip } from './zip.js'; +export { default as zipObject } from './zipObject.js'; +export { default as zipObjectDeep } from './zipObjectDeep.js'; +export { default as zipWith } from './zipWith.js'; export { default as default } from './lodash.default'; diff --git a/lowerCase.js b/lowerCase.js index 6174b474c..570d3b602 100644 --- a/lowerCase.js +++ b/lowerCase.js @@ -1,4 +1,4 @@ -import createCompounder from './_createCompounder'; +import createCompounder from './_createCompounder.js'; /** * Converts `string`, as space separated words, to lower case. diff --git a/lowerFirst.js b/lowerFirst.js index 2a1882592..d7cb4b013 100644 --- a/lowerFirst.js +++ b/lowerFirst.js @@ -1,4 +1,4 @@ -import createCaseFirst from './_createCaseFirst'; +import createCaseFirst from './_createCaseFirst.js'; /** * Converts the first character of `string` to lower case. diff --git a/lt.js b/lt.js index 6d108d75e..84181139c 100644 --- a/lt.js +++ b/lt.js @@ -1,5 +1,5 @@ -import baseLt from './_baseLt'; -import createRelationalOperation from './_createRelationalOperation'; +import baseLt from './_baseLt.js'; +import createRelationalOperation from './_createRelationalOperation.js'; /** * Checks if `value` is less than `other`. diff --git a/lte.js b/lte.js index 547f9167a..50c90a9c3 100644 --- a/lte.js +++ b/lte.js @@ -1,4 +1,4 @@ -import createRelationalOperation from './_createRelationalOperation'; +import createRelationalOperation from './_createRelationalOperation.js'; /** * Checks if `value` is less than or equal to `other`. diff --git a/map.js b/map.js index 888dc851f..8c2af401f 100644 --- a/map.js +++ b/map.js @@ -1,7 +1,7 @@ -import arrayMap from './_arrayMap'; -import baseIteratee from './_baseIteratee'; -import baseMap from './_baseMap'; -import isArray from './isArray'; +import arrayMap from './_arrayMap.js'; +import baseIteratee from './_baseIteratee.js'; +import baseMap from './_baseMap.js'; +import isArray from './isArray.js'; /** * Creates an array of values by running each element in `collection` thru diff --git a/mapKeys.js b/mapKeys.js index ee7ba9bc1..d8b9eae24 100644 --- a/mapKeys.js +++ b/mapKeys.js @@ -1,5 +1,5 @@ -import baseForOwn from './_baseForOwn'; -import baseIteratee from './_baseIteratee'; +import baseForOwn from './_baseForOwn.js'; +import baseIteratee from './_baseIteratee.js'; /** * The opposite of `_.mapValues`; this method creates an object with the diff --git a/mapValues.js b/mapValues.js index a2ebcb3ca..d5aae9b68 100644 --- a/mapValues.js +++ b/mapValues.js @@ -1,5 +1,5 @@ -import baseForOwn from './_baseForOwn'; -import baseIteratee from './_baseIteratee'; +import baseForOwn from './_baseForOwn.js'; +import baseIteratee from './_baseIteratee.js'; /** * Creates an object with the same keys as `object` and values generated diff --git a/matches.js b/matches.js index 26ae4d282..c0cd96504 100644 --- a/matches.js +++ b/matches.js @@ -1,5 +1,5 @@ -import baseClone from './_baseClone'; -import baseMatches from './_baseMatches'; +import baseClone from './_baseClone.js'; +import baseMatches from './_baseMatches.js'; /** * Creates a function that performs a partial deep comparison between a given diff --git a/matchesProperty.js b/matchesProperty.js index f47accddc..95ea8ba01 100644 --- a/matchesProperty.js +++ b/matchesProperty.js @@ -1,5 +1,5 @@ -import baseClone from './_baseClone'; -import baseMatchesProperty from './_baseMatchesProperty'; +import baseClone from './_baseClone.js'; +import baseMatchesProperty from './_baseMatchesProperty.js'; /** * Creates a function that performs a partial deep comparison between the diff --git a/math.default.js b/math.default.js index 377e85513..3705ee5a7 100644 --- a/math.default.js +++ b/math.default.js @@ -1,18 +1,18 @@ -import add from './add'; -import ceil from './ceil'; -import divide from './divide'; -import floor from './floor'; -import max from './max'; -import maxBy from './maxBy'; -import mean from './mean'; -import meanBy from './meanBy'; -import min from './min'; -import minBy from './minBy'; -import multiply from './multiply'; -import round from './round'; -import subtract from './subtract'; -import sum from './sum'; -import sumBy from './sumBy'; +import add from './add.js'; +import ceil from './ceil.js'; +import divide from './divide.js'; +import floor from './floor.js'; +import max from './max.js'; +import maxBy from './maxBy.js'; +import mean from './mean.js'; +import meanBy from './meanBy.js'; +import min from './min.js'; +import minBy from './minBy.js'; +import multiply from './multiply.js'; +import round from './round.js'; +import subtract from './subtract.js'; +import sum from './sum.js'; +import sumBy from './sumBy.js'; export default { add, ceil, divide, floor, max, diff --git a/math.js b/math.js index 8cdff4328..772759a48 100644 --- a/math.js +++ b/math.js @@ -1,16 +1,16 @@ -export { default as add } from './add'; -export { default as ceil } from './ceil'; -export { default as divide } from './divide'; -export { default as floor } from './floor'; -export { default as max } from './max'; -export { default as maxBy } from './maxBy'; -export { default as mean } from './mean'; -export { default as meanBy } from './meanBy'; -export { default as min } from './min'; -export { default as minBy } from './minBy'; -export { default as multiply } from './multiply'; -export { default as round } from './round'; -export { default as subtract } from './subtract'; -export { default as sum } from './sum'; -export { default as sumBy } from './sumBy'; +export { default as add } from './add.js'; +export { default as ceil } from './ceil.js'; +export { default as divide } from './divide.js'; +export { default as floor } from './floor.js'; +export { default as max } from './max.js'; +export { default as maxBy } from './maxBy.js'; +export { default as mean } from './mean.js'; +export { default as meanBy } from './meanBy.js'; +export { default as min } from './min.js'; +export { default as minBy } from './minBy.js'; +export { default as multiply } from './multiply.js'; +export { default as round } from './round.js'; +export { default as subtract } from './subtract.js'; +export { default as sum } from './sum.js'; +export { default as sumBy } from './sumBy.js'; export { default as default } from './math.default'; diff --git a/max.js b/max.js index b08649353..339496943 100644 --- a/max.js +++ b/max.js @@ -1,6 +1,6 @@ -import baseExtremum from './_baseExtremum'; -import baseGt from './_baseGt'; -import identity from './identity'; +import baseExtremum from './_baseExtremum.js'; +import baseGt from './_baseGt.js'; +import identity from './identity.js'; /** * Computes the maximum value of `array`. If `array` is empty or falsey, diff --git a/maxBy.js b/maxBy.js index 130c60c40..c94b93594 100644 --- a/maxBy.js +++ b/maxBy.js @@ -1,6 +1,6 @@ -import baseExtremum from './_baseExtremum'; -import baseGt from './_baseGt'; -import baseIteratee from './_baseIteratee'; +import baseExtremum from './_baseExtremum.js'; +import baseGt from './_baseGt.js'; +import baseIteratee from './_baseIteratee.js'; /** * This method is like `_.max` except that it accepts `iteratee` which is diff --git a/mean.js b/mean.js index 1331713b9..2323aefc1 100644 --- a/mean.js +++ b/mean.js @@ -1,5 +1,5 @@ -import baseMean from './_baseMean'; -import identity from './identity'; +import baseMean from './_baseMean.js'; +import identity from './identity.js'; /** * Computes the mean of the values in `array`. diff --git a/meanBy.js b/meanBy.js index 0a1fa8ccc..2cb1c7232 100644 --- a/meanBy.js +++ b/meanBy.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import baseMean from './_baseMean'; +import baseIteratee from './_baseIteratee.js'; +import baseMean from './_baseMean.js'; /** * This method is like `_.mean` except that it accepts `iteratee` which is diff --git a/memoize.js b/memoize.js index 895b2d7a6..33ae047d9 100644 --- a/memoize.js +++ b/memoize.js @@ -1,4 +1,4 @@ -import MapCache from './_MapCache'; +import MapCache from './_MapCache.js'; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; diff --git a/merge.js b/merge.js index 733d0b3da..0dfd0583e 100644 --- a/merge.js +++ b/merge.js @@ -1,5 +1,5 @@ -import baseMerge from './_baseMerge'; -import createAssigner from './_createAssigner'; +import baseMerge from './_baseMerge.js'; +import createAssigner from './_createAssigner.js'; /** * This method is like `_.assign` except that it recursively merges own and diff --git a/mergeWith.js b/mergeWith.js index 2824e70a6..feec5a7b2 100644 --- a/mergeWith.js +++ b/mergeWith.js @@ -1,5 +1,5 @@ -import baseMerge from './_baseMerge'; -import createAssigner from './_createAssigner'; +import baseMerge from './_baseMerge.js'; +import createAssigner from './_createAssigner.js'; /** * This method is like `_.merge` except that it accepts `customizer` which diff --git a/method.js b/method.js index 8f2a31fcf..dbba0c38d 100644 --- a/method.js +++ b/method.js @@ -1,5 +1,5 @@ -import baseInvoke from './_baseInvoke'; -import rest from './rest'; +import baseInvoke from './_baseInvoke.js'; +import rest from './rest.js'; /** * Creates a function that invokes the method at `path` of a given object. diff --git a/methodOf.js b/methodOf.js index e14c1508d..e24c73709 100644 --- a/methodOf.js +++ b/methodOf.js @@ -1,5 +1,5 @@ -import baseInvoke from './_baseInvoke'; -import rest from './rest'; +import baseInvoke from './_baseInvoke.js'; +import rest from './rest.js'; /** * The opposite of `_.method`; this method creates a function that invokes diff --git a/min.js b/min.js index d13c254a3..c411e51a9 100644 --- a/min.js +++ b/min.js @@ -1,6 +1,6 @@ -import baseExtremum from './_baseExtremum'; -import baseLt from './_baseLt'; -import identity from './identity'; +import baseExtremum from './_baseExtremum.js'; +import baseLt from './_baseLt.js'; +import identity from './identity.js'; /** * Computes the minimum value of `array`. If `array` is empty or falsey, diff --git a/minBy.js b/minBy.js index ba0edea3b..b08f182af 100644 --- a/minBy.js +++ b/minBy.js @@ -1,6 +1,6 @@ -import baseExtremum from './_baseExtremum'; -import baseIteratee from './_baseIteratee'; -import baseLt from './_baseLt'; +import baseExtremum from './_baseExtremum.js'; +import baseIteratee from './_baseIteratee.js'; +import baseLt from './_baseLt.js'; /** * This method is like `_.min` except that it accepts `iteratee` which is diff --git a/mixin.js b/mixin.js index 91fa4644b..7d33a25be 100644 --- a/mixin.js +++ b/mixin.js @@ -1,10 +1,10 @@ -import arrayEach from './_arrayEach'; -import arrayPush from './_arrayPush'; -import baseFunctions from './_baseFunctions'; -import copyArray from './_copyArray'; -import isFunction from './isFunction'; -import isObject from './isObject'; -import keys from './keys'; +import arrayEach from './_arrayEach.js'; +import arrayPush from './_arrayPush.js'; +import baseFunctions from './_baseFunctions.js'; +import copyArray from './_copyArray.js'; +import isFunction from './isFunction.js'; +import isObject from './isObject.js'; +import keys from './keys.js'; /** * Adds all own enumerable string keyed function properties of a source diff --git a/multiply.js b/multiply.js index 084a37664..05b06aa5e 100644 --- a/multiply.js +++ b/multiply.js @@ -1,4 +1,4 @@ -import createMathOperation from './_createMathOperation'; +import createMathOperation from './_createMathOperation.js'; /** * Multiply two numbers. diff --git a/next.js b/next.js index 4efa564d9..bb7117b75 100644 --- a/next.js +++ b/next.js @@ -1,4 +1,4 @@ -import toArray from './toArray'; +import toArray from './toArray.js'; /** * Gets the next value on a wrapped object following the diff --git a/noop.js b/noop.js index 1f652b79a..bafa45851 100644 --- a/noop.js +++ b/noop.js @@ -1,6 +1,5 @@ /** - * A no-operation function that returns `undefined` regardless of the - * arguments it receives. + * A method that returns `undefined`. * * @static * @memberOf _ @@ -8,10 +7,8 @@ * @category Util * @example * - * var object = { 'user': 'fred' }; - * - * _.noop(object) === undefined; - * // => true + * _.times(2, _.noop); + * // => [undefined, undefined] */ function noop() { // No operation performed. diff --git a/now.js b/now.js index 1228bcb61..74233124b 100644 --- a/now.js +++ b/now.js @@ -5,7 +5,6 @@ * @static * @memberOf _ * @since 2.4.0 - * @type {Function} * @category Date * @returns {number} Returns the timestamp. * @example @@ -13,8 +12,10 @@ * _.defer(function(stamp) { * console.log(_.now() - stamp); * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred function to be invoked. + * // => Logs the number of milliseconds it took for the deferred invocation. */ -var now = Date.now; +function now() { + return Date.now(); +} export default now; diff --git a/nth.js b/nth.js index b93914c11..8ebf9498c 100644 --- a/nth.js +++ b/nth.js @@ -1,8 +1,8 @@ -import baseNth from './_baseNth'; -import toInteger from './toInteger'; +import baseNth from './_baseNth.js'; +import toInteger from './toInteger.js'; /** - * Gets the element at `n` index of `array`. If `n` is negative, the nth + * Gets the element at index `n` of `array`. If `n` is negative, the nth * element from the end is returned. * * @static diff --git a/nthArg.js b/nthArg.js index e67b068ed..64706724c 100644 --- a/nthArg.js +++ b/nthArg.js @@ -1,9 +1,9 @@ -import baseNth from './_baseNth'; -import rest from './rest'; -import toInteger from './toInteger'; +import baseNth from './_baseNth.js'; +import rest from './rest.js'; +import toInteger from './toInteger.js'; /** - * Creates a function that gets the argument at `n` index. If `n` is negative, + * Creates a function that gets the argument at index `n`. If `n` is negative, * the nth argument from the end is returned. * * @static diff --git a/number.default.js b/number.default.js index 98fd81715..5eef33776 100644 --- a/number.default.js +++ b/number.default.js @@ -1,6 +1,6 @@ -import clamp from './clamp'; -import inRange from './inRange'; -import random from './random'; +import clamp from './clamp.js'; +import inRange from './inRange.js'; +import random from './random.js'; export default { clamp, inRange, random diff --git a/number.js b/number.js index cfffee737..77b17822b 100644 --- a/number.js +++ b/number.js @@ -1,4 +1,4 @@ -export { default as clamp } from './clamp'; -export { default as inRange } from './inRange'; -export { default as random } from './random'; +export { default as clamp } from './clamp.js'; +export { default as inRange } from './inRange.js'; +export { default as random } from './random.js'; export { default as default } from './number.default'; diff --git a/object.default.js b/object.default.js index f9ad0bed3..128cdec4a 100644 --- a/object.default.js +++ b/object.default.js @@ -1,49 +1,49 @@ -import assign from './assign'; -import assignIn from './assignIn'; -import assignInWith from './assignInWith'; -import assignWith from './assignWith'; -import create from './create'; -import defaults from './defaults'; -import defaultsDeep from './defaultsDeep'; -import entries from './entries'; -import entriesIn from './entriesIn'; -import extend from './extend'; -import extendWith from './extendWith'; -import findKey from './findKey'; -import findLastKey from './findLastKey'; -import forIn from './forIn'; -import forInRight from './forInRight'; -import forOwn from './forOwn'; -import forOwnRight from './forOwnRight'; -import functions from './functions'; -import functionsIn from './functionsIn'; -import get from './get'; -import has from './has'; -import hasIn from './hasIn'; -import invert from './invert'; -import invertBy from './invertBy'; -import invoke from './invoke'; -import keys from './keys'; -import keysIn from './keysIn'; -import mapKeys from './mapKeys'; -import mapValues from './mapValues'; -import merge from './merge'; -import mergeWith from './mergeWith'; -import omit from './omit'; -import omitBy from './omitBy'; -import pick from './pick'; -import pickBy from './pickBy'; -import result from './result'; -import set from './set'; -import setWith from './setWith'; -import toPairs from './toPairs'; -import toPairsIn from './toPairsIn'; -import transform from './transform'; -import unset from './unset'; -import update from './update'; -import updateWith from './updateWith'; -import values from './values'; -import valuesIn from './valuesIn'; +import assign from './assign.js'; +import assignIn from './assignIn.js'; +import assignInWith from './assignInWith.js'; +import assignWith from './assignWith.js'; +import create from './create.js'; +import defaults from './defaults.js'; +import defaultsDeep from './defaultsDeep.js'; +import entries from './entries.js'; +import entriesIn from './entriesIn.js'; +import extend from './extend.js'; +import extendWith from './extendWith.js'; +import findKey from './findKey.js'; +import findLastKey from './findLastKey.js'; +import forIn from './forIn.js'; +import forInRight from './forInRight.js'; +import forOwn from './forOwn.js'; +import forOwnRight from './forOwnRight.js'; +import functions from './functions.js'; +import functionsIn from './functionsIn.js'; +import get from './get.js'; +import has from './has.js'; +import hasIn from './hasIn.js'; +import invert from './invert.js'; +import invertBy from './invertBy.js'; +import invoke from './invoke.js'; +import keys from './keys.js'; +import keysIn from './keysIn.js'; +import mapKeys from './mapKeys.js'; +import mapValues from './mapValues.js'; +import merge from './merge.js'; +import mergeWith from './mergeWith.js'; +import omit from './omit.js'; +import omitBy from './omitBy.js'; +import pick from './pick.js'; +import pickBy from './pickBy.js'; +import result from './result.js'; +import set from './set.js'; +import setWith from './setWith.js'; +import toPairs from './toPairs.js'; +import toPairsIn from './toPairsIn.js'; +import transform from './transform.js'; +import unset from './unset.js'; +import update from './update.js'; +import updateWith from './updateWith.js'; +import values from './values.js'; +import valuesIn from './valuesIn.js'; export default { assign, assignIn, assignInWith, assignWith, create, diff --git a/object.js b/object.js index df0056b35..23c705acb 100644 --- a/object.js +++ b/object.js @@ -1,47 +1,47 @@ -export { default as assign } from './assign'; -export { default as assignIn } from './assignIn'; -export { default as assignInWith } from './assignInWith'; -export { default as assignWith } from './assignWith'; -export { default as create } from './create'; -export { default as defaults } from './defaults'; -export { default as defaultsDeep } from './defaultsDeep'; -export { default as entries } from './entries'; -export { default as entriesIn } from './entriesIn'; -export { default as extend } from './extend'; -export { default as extendWith } from './extendWith'; -export { default as findKey } from './findKey'; -export { default as findLastKey } from './findLastKey'; -export { default as forIn } from './forIn'; -export { default as forInRight } from './forInRight'; -export { default as forOwn } from './forOwn'; -export { default as forOwnRight } from './forOwnRight'; -export { default as functions } from './functions'; -export { default as functionsIn } from './functionsIn'; -export { default as get } from './get'; -export { default as has } from './has'; -export { default as hasIn } from './hasIn'; -export { default as invert } from './invert'; -export { default as invertBy } from './invertBy'; -export { default as invoke } from './invoke'; -export { default as keys } from './keys'; -export { default as keysIn } from './keysIn'; -export { default as mapKeys } from './mapKeys'; -export { default as mapValues } from './mapValues'; -export { default as merge } from './merge'; -export { default as mergeWith } from './mergeWith'; -export { default as omit } from './omit'; -export { default as omitBy } from './omitBy'; -export { default as pick } from './pick'; -export { default as pickBy } from './pickBy'; -export { default as result } from './result'; -export { default as set } from './set'; -export { default as setWith } from './setWith'; -export { default as toPairs } from './toPairs'; -export { default as toPairsIn } from './toPairsIn'; -export { default as transform } from './transform'; -export { default as unset } from './unset'; -export { default as update } from './update'; -export { default as updateWith } from './updateWith'; -export { default as values } from './values'; -export { default as valuesIn } from './valuesIn'; +export { default as assign } from './assign.js'; +export { default as assignIn } from './assignIn.js'; +export { default as assignInWith } from './assignInWith.js'; +export { default as assignWith } from './assignWith.js'; +export { default as create } from './create.js'; +export { default as defaults } from './defaults.js'; +export { default as defaultsDeep } from './defaultsDeep.js'; +export { default as entries } from './entries.js'; +export { default as entriesIn } from './entriesIn.js'; +export { default as extend } from './extend.js'; +export { default as extendWith } from './extendWith.js'; +export { default as findKey } from './findKey.js'; +export { default as findLastKey } from './findLastKey.js'; +export { default as forIn } from './forIn.js'; +export { default as forInRight } from './forInRight.js'; +export { default as forOwn } from './forOwn.js'; +export { default as forOwnRight } from './forOwnRight.js'; +export { default as functions } from './functions.js'; +export { default as functionsIn } from './functionsIn.js'; +export { default as get } from './get.js'; +export { default as has } from './has.js'; +export { default as hasIn } from './hasIn.js'; +export { default as invert } from './invert.js'; +export { default as invertBy } from './invertBy.js'; +export { default as invoke } from './invoke.js'; +export { default as keys } from './keys.js'; +export { default as keysIn } from './keysIn.js'; +export { default as mapKeys } from './mapKeys.js'; +export { default as mapValues } from './mapValues.js'; +export { default as merge } from './merge.js'; +export { default as mergeWith } from './mergeWith.js'; +export { default as omit } from './omit.js'; +export { default as omitBy } from './omitBy.js'; +export { default as pick } from './pick.js'; +export { default as pickBy } from './pickBy.js'; +export { default as result } from './result.js'; +export { default as set } from './set.js'; +export { default as setWith } from './setWith.js'; +export { default as toPairs } from './toPairs.js'; +export { default as toPairsIn } from './toPairsIn.js'; +export { default as transform } from './transform.js'; +export { default as unset } from './unset.js'; +export { default as update } from './update.js'; +export { default as updateWith } from './updateWith.js'; +export { default as values } from './values.js'; +export { default as valuesIn } from './valuesIn.js'; export { default as default } from './object.default'; diff --git a/omit.js b/omit.js index 3eeb7ca89..2d6bf944d 100644 --- a/omit.js +++ b/omit.js @@ -1,10 +1,10 @@ -import arrayMap from './_arrayMap'; -import baseDifference from './_baseDifference'; -import baseFlatten from './_baseFlatten'; -import basePick from './_basePick'; -import getAllKeysIn from './_getAllKeysIn'; -import rest from './rest'; -import toKey from './_toKey'; +import arrayMap from './_arrayMap.js'; +import baseDifference from './_baseDifference.js'; +import baseFlatten from './_baseFlatten.js'; +import basePick from './_basePick.js'; +import getAllKeysIn from './_getAllKeysIn.js'; +import rest from './rest.js'; +import toKey from './_toKey.js'; /** * The opposite of `_.pick`; this method creates an object composed of the diff --git a/omitBy.js b/omitBy.js index 9dcfbff6c..309bde47e 100644 --- a/omitBy.js +++ b/omitBy.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import basePickBy from './_basePickBy'; +import baseIteratee from './_baseIteratee.js'; +import basePickBy from './_basePickBy.js'; /** * The opposite of `_.pickBy`; this method creates an object composed of diff --git a/once.js b/once.js index 698afef4a..ed274fedb 100644 --- a/once.js +++ b/once.js @@ -1,4 +1,4 @@ -import before from './before'; +import before from './before.js'; /** * Creates a function that is restricted to invoking `func` once. Repeat calls diff --git a/orderBy.js b/orderBy.js index 0a4081ee1..2f9e00e46 100644 --- a/orderBy.js +++ b/orderBy.js @@ -1,5 +1,5 @@ -import baseOrderBy from './_baseOrderBy'; -import isArray from './isArray'; +import baseOrderBy from './_baseOrderBy.js'; +import isArray from './isArray.js'; /** * This method is like `_.sortBy` except that it allows specifying the sort diff --git a/over.js b/over.js index 1d49032a1..52fa180fb 100644 --- a/over.js +++ b/over.js @@ -1,5 +1,5 @@ -import arrayMap from './_arrayMap'; -import createOver from './_createOver'; +import arrayMap from './_arrayMap.js'; +import createOver from './_createOver.js'; /** * Creates a function that invokes `iteratees` with the arguments it receives @@ -14,7 +14,7 @@ import createOver from './_createOver'; * @returns {Function} Returns the new function. * @example * - * var func = _.over(Math.max, Math.min); + * var func = _.over([Math.max, Math.min]); * * func(1, 2, 3, 4); * // => [4, 1] diff --git a/overArgs.js b/overArgs.js index 51b5b29db..ee8ebcef7 100644 --- a/overArgs.js +++ b/overArgs.js @@ -1,11 +1,11 @@ -import apply from './_apply'; -import arrayMap from './_arrayMap'; -import baseFlatten from './_baseFlatten'; -import baseIteratee from './_baseIteratee'; -import baseUnary from './_baseUnary'; -import isArray from './isArray'; -import isFlattenableIteratee from './_isFlattenableIteratee'; -import rest from './rest'; +import apply from './_apply.js'; +import arrayMap from './_arrayMap.js'; +import baseFlatten from './_baseFlatten.js'; +import baseIteratee from './_baseIteratee.js'; +import baseUnary from './_baseUnary.js'; +import isArray from './isArray.js'; +import isFlattenableIteratee from './_isFlattenableIteratee.js'; +import rest from './rest.js'; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMin = Math.min; @@ -34,7 +34,7 @@ var nativeMin = Math.min; * * var func = _.overArgs(function(x, y) { * return [x, y]; - * }, square, doubled); + * }, [square, doubled]); * * func(9, 3); * // => [81, 6] diff --git a/overEvery.js b/overEvery.js index c3fd2b615..f8cff8584 100644 --- a/overEvery.js +++ b/overEvery.js @@ -1,5 +1,5 @@ -import arrayEvery from './_arrayEvery'; -import createOver from './_createOver'; +import arrayEvery from './_arrayEvery.js'; +import createOver from './_createOver.js'; /** * Creates a function that checks if **all** of the `predicates` return @@ -14,7 +14,7 @@ import createOver from './_createOver'; * @returns {Function} Returns the new function. * @example * - * var func = _.overEvery(Boolean, isFinite); + * var func = _.overEvery([Boolean, isFinite]); * * func('1'); * // => true diff --git a/overSome.js b/overSome.js index 70aab0b8a..f70e59c81 100644 --- a/overSome.js +++ b/overSome.js @@ -1,5 +1,5 @@ -import arraySome from './_arraySome'; -import createOver from './_createOver'; +import arraySome from './_arraySome.js'; +import createOver from './_createOver.js'; /** * Creates a function that checks if **any** of the `predicates` return @@ -14,7 +14,7 @@ import createOver from './_createOver'; * @returns {Function} Returns the new function. * @example * - * var func = _.overSome(Boolean, isFinite); + * var func = _.overSome([Boolean, isFinite]); * * func('1'); * // => true diff --git a/package.json b/package.json index 159881deb..f0b15919d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lodash-es", - "version": "4.12.0", + "version": "4.13.0", "description": "Lodash exported as ES modules.", "keywords": "es6, modules, stdlib, util", "homepage": "https://lodash.com/custom-builds", diff --git a/pad.js b/pad.js index 7d304a09f..b74a0972f 100644 --- a/pad.js +++ b/pad.js @@ -1,7 +1,7 @@ -import createPadding from './_createPadding'; -import stringSize from './_stringSize'; -import toInteger from './toInteger'; -import toString from './toString'; +import createPadding from './_createPadding.js'; +import stringSize from './_stringSize.js'; +import toInteger from './toInteger.js'; +import toString from './toString.js'; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, diff --git a/padEnd.js b/padEnd.js index 1ad75f420..c7df21b8a 100644 --- a/padEnd.js +++ b/padEnd.js @@ -1,7 +1,7 @@ -import createPadding from './_createPadding'; -import stringSize from './_stringSize'; -import toInteger from './toInteger'; -import toString from './toString'; +import createPadding from './_createPadding.js'; +import stringSize from './_stringSize.js'; +import toInteger from './toInteger.js'; +import toString from './toString.js'; /** * Pads `string` on the right side if it's shorter than `length`. Padding diff --git a/padStart.js b/padStart.js index a1c20df30..c61644acf 100644 --- a/padStart.js +++ b/padStart.js @@ -1,7 +1,7 @@ -import createPadding from './_createPadding'; -import stringSize from './_stringSize'; -import toInteger from './toInteger'; -import toString from './toString'; +import createPadding from './_createPadding.js'; +import stringSize from './_stringSize.js'; +import toInteger from './toInteger.js'; +import toString from './toString.js'; /** * Pads `string` on the left side if it's shorter than `length`. Padding diff --git a/parseInt.js b/parseInt.js index f8945c758..875da6f14 100644 --- a/parseInt.js +++ b/parseInt.js @@ -1,5 +1,5 @@ -import root from './_root'; -import toString from './toString'; +import root from './_root.js'; +import toString from './toString.js'; /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g; diff --git a/partial.js b/partial.js index 9a5db5500..22d561874 100644 --- a/partial.js +++ b/partial.js @@ -1,7 +1,7 @@ -import createWrapper from './_createWrapper'; -import getHolder from './_getHolder'; -import replaceHolders from './_replaceHolders'; -import rest from './rest'; +import createWrapper from './_createWrapper.js'; +import getHolder from './_getHolder.js'; +import replaceHolders from './_replaceHolders.js'; +import rest from './rest.js'; /** Used to compose bitmasks for wrapper metadata. */ var PARTIAL_FLAG = 32; diff --git a/partialRight.js b/partialRight.js index 9401e7e9c..9345102b9 100644 --- a/partialRight.js +++ b/partialRight.js @@ -1,7 +1,7 @@ -import createWrapper from './_createWrapper'; -import getHolder from './_getHolder'; -import replaceHolders from './_replaceHolders'; -import rest from './rest'; +import createWrapper from './_createWrapper.js'; +import getHolder from './_getHolder.js'; +import replaceHolders from './_replaceHolders.js'; +import rest from './rest.js'; /** Used to compose bitmasks for wrapper metadata. */ var PARTIAL_RIGHT_FLAG = 64; diff --git a/partition.js b/partition.js index 1d88989fa..3122d1236 100644 --- a/partition.js +++ b/partition.js @@ -1,4 +1,4 @@ -import createAggregator from './_createAggregator'; +import createAggregator from './_createAggregator.js'; /** * Creates an array of elements split into two groups, the first of which diff --git a/pick.js b/pick.js index 4e7dfdfd4..d5b5b68a3 100644 --- a/pick.js +++ b/pick.js @@ -1,8 +1,8 @@ -import arrayMap from './_arrayMap'; -import baseFlatten from './_baseFlatten'; -import basePick from './_basePick'; -import rest from './rest'; -import toKey from './_toKey'; +import arrayMap from './_arrayMap.js'; +import baseFlatten from './_baseFlatten.js'; +import basePick from './_basePick.js'; +import rest from './rest.js'; +import toKey from './_toKey.js'; /** * Creates an object composed of the picked `object` properties. diff --git a/pickBy.js b/pickBy.js index 00633b64c..19331d682 100644 --- a/pickBy.js +++ b/pickBy.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import basePickBy from './_basePickBy'; +import baseIteratee from './_baseIteratee.js'; +import basePickBy from './_basePickBy.js'; /** * Creates an object composed of the `object` properties `predicate` returns diff --git a/plant.js b/plant.js index ab025b487..c165ea5e1 100644 --- a/plant.js +++ b/plant.js @@ -1,5 +1,5 @@ -import baseLodash from './_baseLodash'; -import wrapperClone from './_wrapperClone'; +import baseLodash from './_baseLodash.js'; +import wrapperClone from './_wrapperClone.js'; /** * Creates a clone of the chain sequence planting `value` as the wrapped value. diff --git a/property.js b/property.js index 381ddfc94..45152aa46 100644 --- a/property.js +++ b/property.js @@ -1,7 +1,7 @@ -import baseProperty from './_baseProperty'; -import basePropertyDeep from './_basePropertyDeep'; -import isKey from './_isKey'; -import toKey from './_toKey'; +import baseProperty from './_baseProperty.js'; +import basePropertyDeep from './_basePropertyDeep.js'; +import isKey from './_isKey.js'; +import toKey from './_toKey.js'; /** * Creates a function that returns the value at `path` of a given object. diff --git a/propertyOf.js b/propertyOf.js index 8011aeec4..457c7591c 100644 --- a/propertyOf.js +++ b/propertyOf.js @@ -1,4 +1,4 @@ -import baseGet from './_baseGet'; +import baseGet from './_baseGet.js'; /** * The opposite of `_.property`; this method creates a function that returns diff --git a/pull.js b/pull.js index d84f3d37c..4bdf24a90 100644 --- a/pull.js +++ b/pull.js @@ -1,5 +1,5 @@ -import pullAll from './pullAll'; -import rest from './rest'; +import pullAll from './pullAll.js'; +import rest from './rest.js'; /** * Removes all given values from `array` using @@ -18,11 +18,11 @@ import rest from './rest'; * @returns {Array} Returns `array`. * @example * - * var array = [1, 2, 3, 1, 2, 3]; + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * - * _.pull(array, 2, 3); + * _.pull(array, 'a', 'c'); * console.log(array); - * // => [1, 1] + * // => ['b', 'b'] */ var pull = rest(pullAll); diff --git a/pullAll.js b/pullAll.js index b970d9f49..fe3a2b5af 100644 --- a/pullAll.js +++ b/pullAll.js @@ -1,4 +1,4 @@ -import basePullAll from './_basePullAll'; +import basePullAll from './_basePullAll.js'; /** * This method is like `_.pull` except that it accepts an array of values to remove. @@ -14,11 +14,11 @@ import basePullAll from './_basePullAll'; * @returns {Array} Returns `array`. * @example * - * var array = [1, 2, 3, 1, 2, 3]; + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * - * _.pullAll(array, [2, 3]); + * _.pullAll(array, ['a', 'c']); * console.log(array); - * // => [1, 1] + * // => ['b', 'b'] */ function pullAll(array, values) { return (array && array.length && values && values.length) diff --git a/pullAllBy.js b/pullAllBy.js index 87cda8161..c4c9a4417 100644 --- a/pullAllBy.js +++ b/pullAllBy.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import basePullAll from './_basePullAll'; +import baseIteratee from './_baseIteratee.js'; +import basePullAll from './_basePullAll.js'; /** * This method is like `_.pullAll` except that it accepts `iteratee` which is diff --git a/pullAllWith.js b/pullAllWith.js index 32fad1940..f60530dd4 100644 --- a/pullAllWith.js +++ b/pullAllWith.js @@ -1,4 +1,4 @@ -import basePullAll from './_basePullAll'; +import basePullAll from './_basePullAll.js'; /** * This method is like `_.pullAll` except that it accepts `comparator` which diff --git a/pullAt.js b/pullAt.js index 0ec25dc5e..7fb436cf0 100644 --- a/pullAt.js +++ b/pullAt.js @@ -1,10 +1,10 @@ -import arrayMap from './_arrayMap'; -import baseAt from './_baseAt'; -import baseFlatten from './_baseFlatten'; -import basePullAt from './_basePullAt'; -import compareAscending from './_compareAscending'; -import isIndex from './_isIndex'; -import rest from './rest'; +import arrayMap from './_arrayMap.js'; +import baseAt from './_baseAt.js'; +import baseFlatten from './_baseFlatten.js'; +import basePullAt from './_basePullAt.js'; +import compareAscending from './_compareAscending.js'; +import isIndex from './_isIndex.js'; +import rest from './rest.js'; /** * Removes elements from `array` corresponding to `indexes` and returns an @@ -21,14 +21,14 @@ import rest from './rest'; * @returns {Array} Returns the new array of removed elements. * @example * - * var array = [5, 10, 15, 20]; - * var evens = _.pullAt(array, 1, 3); + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); * * console.log(array); - * // => [5, 15] + * // => ['a', 'c'] * - * console.log(evens); - * // => [10, 20] + * console.log(pulled); + * // => ['b', 'd'] */ var pullAt = rest(function(array, indexes) { indexes = baseFlatten(indexes, 1); diff --git a/random.js b/random.js index ab376a071..5ebf0a094 100644 --- a/random.js +++ b/random.js @@ -1,6 +1,6 @@ -import baseRandom from './_baseRandom'; -import isIterateeCall from './_isIterateeCall'; -import toNumber from './toNumber'; +import baseRandom from './_baseRandom.js'; +import isIterateeCall from './_isIterateeCall.js'; +import toNumber from './toNumber.js'; /** Built-in method references without a dependency on `root`. */ var freeParseFloat = parseFloat; diff --git a/range.js b/range.js index e266bd277..71f26da82 100644 --- a/range.js +++ b/range.js @@ -1,4 +1,4 @@ -import createRange from './_createRange'; +import createRange from './_createRange.js'; /** * Creates an array of numbers (positive and/or negative) progressing from diff --git a/rangeRight.js b/rangeRight.js index f9707966d..3472513d5 100644 --- a/rangeRight.js +++ b/rangeRight.js @@ -1,4 +1,4 @@ -import createRange from './_createRange'; +import createRange from './_createRange.js'; /** * This method is like `_.range` except that it populates values in diff --git a/rearg.js b/rearg.js index caaa0328b..c58611c9e 100644 --- a/rearg.js +++ b/rearg.js @@ -1,6 +1,6 @@ -import baseFlatten from './_baseFlatten'; -import createWrapper from './_createWrapper'; -import rest from './rest'; +import baseFlatten from './_baseFlatten.js'; +import createWrapper from './_createWrapper.js'; +import rest from './rest.js'; /** Used to compose bitmasks for wrapper metadata. */ var REARG_FLAG = 256; @@ -22,7 +22,7 @@ var REARG_FLAG = 256; * * var rearged = _.rearg(function(a, b, c) { * return [a, b, c]; - * }, 2, 0, 1); + * }, [2, 0, 1]); * * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] diff --git a/reduce.js b/reduce.js index 21c47b20b..5dc6c1223 100644 --- a/reduce.js +++ b/reduce.js @@ -1,8 +1,8 @@ -import arrayReduce from './_arrayReduce'; -import baseEach from './_baseEach'; -import baseIteratee from './_baseIteratee'; -import baseReduce from './_baseReduce'; -import isArray from './isArray'; +import arrayReduce from './_arrayReduce.js'; +import baseEach from './_baseEach.js'; +import baseIteratee from './_baseIteratee.js'; +import baseReduce from './_baseReduce.js'; +import isArray from './isArray.js'; /** * Reduces `collection` to a value which is the accumulated result of running diff --git a/reduceRight.js b/reduceRight.js index 1e112a405..b0f5d82df 100644 --- a/reduceRight.js +++ b/reduceRight.js @@ -1,8 +1,8 @@ -import arrayReduceRight from './_arrayReduceRight'; -import baseEachRight from './_baseEachRight'; -import baseIteratee from './_baseIteratee'; -import baseReduce from './_baseReduce'; -import isArray from './isArray'; +import arrayReduceRight from './_arrayReduceRight.js'; +import baseEachRight from './_baseEachRight.js'; +import baseIteratee from './_baseIteratee.js'; +import baseReduce from './_baseReduce.js'; +import isArray from './isArray.js'; /** * This method is like `_.reduce` except that it iterates over elements of diff --git a/reject.js b/reject.js index a2d10fc17..e8bbed251 100644 --- a/reject.js +++ b/reject.js @@ -1,7 +1,7 @@ -import arrayFilter from './_arrayFilter'; -import baseFilter from './_baseFilter'; -import baseIteratee from './_baseIteratee'; -import isArray from './isArray'; +import arrayFilter from './_arrayFilter.js'; +import baseFilter from './_baseFilter.js'; +import baseIteratee from './_baseIteratee.js'; +import isArray from './isArray.js'; /** * The opposite of `_.filter`; this method returns the elements of `collection` diff --git a/remove.js b/remove.js index 11a3dc44b..de7fdd2b1 100644 --- a/remove.js +++ b/remove.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import basePullAt from './_basePullAt'; +import baseIteratee from './_baseIteratee.js'; +import basePullAt from './_basePullAt.js'; /** * Removes all elements from `array` that `predicate` returns truthy for diff --git a/repeat.js b/repeat.js index c32683497..353e98cc7 100644 --- a/repeat.js +++ b/repeat.js @@ -1,7 +1,7 @@ -import baseRepeat from './_baseRepeat'; -import isIterateeCall from './_isIterateeCall'; -import toInteger from './toInteger'; -import toString from './toString'; +import baseRepeat from './_baseRepeat.js'; +import isIterateeCall from './_isIterateeCall.js'; +import toInteger from './toInteger.js'; +import toString from './toString.js'; /** * Repeats the given string `n` times. diff --git a/replace.js b/replace.js index e6d4d72f4..68976c2fe 100644 --- a/replace.js +++ b/replace.js @@ -1,4 +1,4 @@ -import toString from './toString'; +import toString from './toString.js'; /** Used for built-in method references. */ var stringProto = String.prototype; diff --git a/rest.js b/rest.js index 1f4356834..136e71204 100644 --- a/rest.js +++ b/rest.js @@ -1,5 +1,5 @@ -import apply from './_apply'; -import toInteger from './toInteger'; +import apply from './_apply.js'; +import toInteger from './toInteger.js'; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; diff --git a/result.js b/result.js index fd977d903..eb44eea67 100644 --- a/result.js +++ b/result.js @@ -1,7 +1,7 @@ -import castPath from './_castPath'; -import isFunction from './isFunction'; -import isKey from './_isKey'; -import toKey from './_toKey'; +import castPath from './_castPath.js'; +import isFunction from './isFunction.js'; +import isKey from './_isKey.js'; +import toKey from './_toKey.js'; /** * This method is like `_.get` except that if the resolved value is a diff --git a/round.js b/round.js index 82d871a13..f4616dc29 100644 --- a/round.js +++ b/round.js @@ -1,4 +1,4 @@ -import createRound from './_createRound'; +import createRound from './_createRound.js'; /** * Computes `number` rounded to `precision`. diff --git a/sample.js b/sample.js index 5f77a82f1..94ec4e7c6 100644 --- a/sample.js +++ b/sample.js @@ -1,6 +1,6 @@ -import baseRandom from './_baseRandom'; -import isArrayLike from './isArrayLike'; -import values from './values'; +import baseRandom from './_baseRandom.js'; +import isArrayLike from './isArrayLike.js'; +import values from './values.js'; /** * Gets a random element from `collection`. diff --git a/sampleSize.js b/sampleSize.js index c65453e86..88226010f 100644 --- a/sampleSize.js +++ b/sampleSize.js @@ -1,8 +1,8 @@ -import baseClamp from './_baseClamp'; -import baseRandom from './_baseRandom'; -import isIterateeCall from './_isIterateeCall'; -import toArray from './toArray'; -import toInteger from './toInteger'; +import baseClamp from './_baseClamp.js'; +import baseRandom from './_baseRandom.js'; +import isIterateeCall from './_isIterateeCall.js'; +import toArray from './toArray.js'; +import toInteger from './toInteger.js'; /** * Gets `n` random elements at unique keys from `collection` up to the diff --git a/seq.default.js b/seq.default.js index b1f0ddeba..c7c320711 100644 --- a/seq.default.js +++ b/seq.default.js @@ -1,17 +1,17 @@ -import at from './wrapperAt'; -import chain from './chain'; -import commit from './commit'; -import lodash from './wrapperLodash'; -import next from './next'; -import plant from './plant'; -import reverse from './wrapperReverse'; -import tap from './tap'; -import thru from './thru'; -import toIterator from './toIterator'; -import toJSON from './toJSON'; -import value from './wrapperValue'; -import valueOf from './valueOf'; -import wrapperChain from './wrapperChain'; +import at from './wrapperAt.js'; +import chain from './chain.js'; +import commit from './commit.js'; +import lodash from './wrapperLodash.js'; +import next from './next.js'; +import plant from './plant.js'; +import reverse from './wrapperReverse.js'; +import tap from './tap.js'; +import thru from './thru.js'; +import toIterator from './toIterator.js'; +import toJSON from './toJSON.js'; +import value from './wrapperValue.js'; +import valueOf from './valueOf.js'; +import wrapperChain from './wrapperChain.js'; export default { at, chain, commit, lodash, next, diff --git a/seq.js b/seq.js index 2719ac61d..d4dca73fe 100644 --- a/seq.js +++ b/seq.js @@ -1,15 +1,15 @@ -export { default as at } from './wrapperAt'; -export { default as chain } from './chain'; -export { default as commit } from './commit'; -export { default as lodash } from './wrapperLodash'; -export { default as next } from './next'; -export { default as plant } from './plant'; -export { default as reverse } from './wrapperReverse'; -export { default as tap } from './tap'; -export { default as thru } from './thru'; -export { default as toIterator } from './toIterator'; -export { default as toJSON } from './toJSON'; -export { default as value } from './wrapperValue'; -export { default as valueOf } from './valueOf'; -export { default as wrapperChain } from './wrapperChain'; +export { default as at } from './wrapperAt.js'; +export { default as chain } from './chain.js'; +export { default as commit } from './commit.js'; +export { default as lodash } from './wrapperLodash.js'; +export { default as next } from './next.js'; +export { default as plant } from './plant.js'; +export { default as reverse } from './wrapperReverse.js'; +export { default as tap } from './tap.js'; +export { default as thru } from './thru.js'; +export { default as toIterator } from './toIterator.js'; +export { default as toJSON } from './toJSON.js'; +export { default as value } from './wrapperValue.js'; +export { default as valueOf } from './valueOf.js'; +export { default as wrapperChain } from './wrapperChain.js'; export { default as default } from './seq.default'; diff --git a/set.js b/set.js index 45a6d334c..15ed46e3b 100644 --- a/set.js +++ b/set.js @@ -1,4 +1,4 @@ -import baseSet from './_baseSet'; +import baseSet from './_baseSet.js'; /** * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, diff --git a/setWith.js b/setWith.js index 1df7be068..963fcd803 100644 --- a/setWith.js +++ b/setWith.js @@ -1,4 +1,4 @@ -import baseSet from './_baseSet'; +import baseSet from './_baseSet.js'; /** * This method is like `_.set` except that it accepts `customizer` which is diff --git a/shuffle.js b/shuffle.js index 934253f08..38b221aed 100644 --- a/shuffle.js +++ b/shuffle.js @@ -1,4 +1,4 @@ -import sampleSize from './sampleSize'; +import sampleSize from './sampleSize.js'; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295; diff --git a/size.js b/size.js index f298a48a5..1ee6384e3 100644 --- a/size.js +++ b/size.js @@ -1,9 +1,9 @@ -import getTag from './_getTag'; -import isArrayLike from './isArrayLike'; -import isObjectLike from './isObjectLike'; -import isString from './isString'; -import keys from './keys'; -import stringSize from './_stringSize'; +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. */ var mapTag = '[object Map]', diff --git a/slice.js b/slice.js index f62fbbb0d..f8ca0bdb3 100644 --- a/slice.js +++ b/slice.js @@ -1,6 +1,6 @@ -import baseSlice from './_baseSlice'; -import isIterateeCall from './_isIterateeCall'; -import toInteger from './toInteger'; +import baseSlice from './_baseSlice.js'; +import isIterateeCall from './_isIterateeCall.js'; +import toInteger from './toInteger.js'; /** * Creates a slice of `array` from `start` up to, but not including, `end`. diff --git a/snakeCase.js b/snakeCase.js index b74f1f7b2..83f163505 100644 --- a/snakeCase.js +++ b/snakeCase.js @@ -1,4 +1,4 @@ -import createCompounder from './_createCompounder'; +import createCompounder from './_createCompounder.js'; /** * Converts `string` to diff --git a/some.js b/some.js index b45361826..85f2afcb0 100644 --- a/some.js +++ b/some.js @@ -1,8 +1,8 @@ -import arraySome from './_arraySome'; -import baseIteratee from './_baseIteratee'; -import baseSome from './_baseSome'; -import isArray from './isArray'; -import isIterateeCall from './_isIterateeCall'; +import arraySome from './_arraySome.js'; +import baseIteratee from './_baseIteratee.js'; +import baseSome from './_baseSome.js'; +import isArray from './isArray.js'; +import isIterateeCall from './_isIterateeCall.js'; /** * Checks if `predicate` returns truthy for **any** element of `collection`. diff --git a/sortBy.js b/sortBy.js index bd0d132e0..48d5fa17d 100644 --- a/sortBy.js +++ b/sortBy.js @@ -1,9 +1,9 @@ -import baseFlatten from './_baseFlatten'; -import baseOrderBy from './_baseOrderBy'; -import isArray from './isArray'; -import isFlattenableIteratee from './_isFlattenableIteratee'; -import isIterateeCall from './_isIterateeCall'; -import rest from './rest'; +import baseFlatten from './_baseFlatten.js'; +import baseOrderBy from './_baseOrderBy.js'; +import isArray from './isArray.js'; +import isFlattenableIteratee from './_isFlattenableIteratee.js'; +import isIterateeCall from './_isIterateeCall.js'; +import rest from './rest.js'; /** * Creates an array of elements, sorted in ascending order by the results of diff --git a/sortedIndex.js b/sortedIndex.js index fd4ee43e8..5104d8dd1 100644 --- a/sortedIndex.js +++ b/sortedIndex.js @@ -1,4 +1,4 @@ -import baseSortedIndex from './_baseSortedIndex'; +import baseSortedIndex from './_baseSortedIndex.js'; /** * Uses a binary search to determine the lowest index at which `value` @@ -16,9 +16,6 @@ import baseSortedIndex from './_baseSortedIndex'; * * _.sortedIndex([30, 50], 40); * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 */ function sortedIndex(array, value) { return baseSortedIndex(array, value); diff --git a/sortedIndexBy.js b/sortedIndexBy.js index ab4d80965..87a07aae1 100644 --- a/sortedIndexBy.js +++ b/sortedIndexBy.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import baseSortedIndexBy from './_baseSortedIndexBy'; +import baseIteratee from './_baseIteratee.js'; +import baseSortedIndexBy from './_baseSortedIndexBy.js'; /** * This method is like `_.sortedIndex` except that it accepts `iteratee` @@ -18,13 +18,13 @@ import baseSortedIndexBy from './_baseSortedIndexBy'; * into `array`. * @example * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; + * var objects = [{ 'x': 4 }, { 'x': 5 }]; * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 * * // The `_.property` iteratee shorthand. - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); * // => 0 */ function sortedIndexBy(array, value, iteratee) { diff --git a/sortedIndexOf.js b/sortedIndexOf.js index f48bbf17f..d58d7b163 100644 --- a/sortedIndexOf.js +++ b/sortedIndexOf.js @@ -1,5 +1,5 @@ -import baseSortedIndex from './_baseSortedIndex'; -import eq from './eq'; +import baseSortedIndex from './_baseSortedIndex.js'; +import eq from './eq.js'; /** * This method is like `_.indexOf` except that it performs a binary @@ -14,8 +14,8 @@ import eq from './eq'; * @returns {number} Returns the index of the matched value, else `-1`. * @example * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 */ function sortedIndexOf(array, value) { var length = array ? array.length : 0; diff --git a/sortedLastIndex.js b/sortedLastIndex.js index 982b44b51..a9cdeee89 100644 --- a/sortedLastIndex.js +++ b/sortedLastIndex.js @@ -1,4 +1,4 @@ -import baseSortedIndex from './_baseSortedIndex'; +import baseSortedIndex from './_baseSortedIndex.js'; /** * This method is like `_.sortedIndex` except that it returns the highest @@ -15,8 +15,8 @@ import baseSortedIndex from './_baseSortedIndex'; * into `array`. * @example * - * _.sortedLastIndex([4, 5], 4); - * // => 1 + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 */ function sortedLastIndex(array, value) { return baseSortedIndex(array, value, true); diff --git a/sortedLastIndexBy.js b/sortedLastIndexBy.js index 6cc076a22..f45c380d9 100644 --- a/sortedLastIndexBy.js +++ b/sortedLastIndexBy.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import baseSortedIndexBy from './_baseSortedIndexBy'; +import baseIteratee from './_baseIteratee.js'; +import baseSortedIndexBy from './_baseSortedIndexBy.js'; /** * This method is like `_.sortedLastIndex` except that it accepts `iteratee` @@ -18,8 +18,13 @@ import baseSortedIndexBy from './_baseSortedIndexBy'; * into `array`. * @example * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * * // The `_.property` iteratee shorthand. - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); * // => 1 */ function sortedLastIndexBy(array, value, iteratee) { diff --git a/sortedLastIndexOf.js b/sortedLastIndexOf.js index fbbc52968..d59134708 100644 --- a/sortedLastIndexOf.js +++ b/sortedLastIndexOf.js @@ -1,5 +1,5 @@ -import baseSortedIndex from './_baseSortedIndex'; -import eq from './eq'; +import baseSortedIndex from './_baseSortedIndex.js'; +import eq from './eq.js'; /** * This method is like `_.lastIndexOf` except that it performs a binary @@ -14,7 +14,7 @@ import eq from './eq'; * @returns {number} Returns the index of the matched value, else `-1`. * @example * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); * // => 3 */ function sortedLastIndexOf(array, value) { diff --git a/sortedUniq.js b/sortedUniq.js index 6bd06a41b..f0d1c569c 100644 --- a/sortedUniq.js +++ b/sortedUniq.js @@ -1,4 +1,4 @@ -import baseSortedUniq from './_baseSortedUniq'; +import baseSortedUniq from './_baseSortedUniq.js'; /** * This method is like `_.uniq` except that it's designed and optimized diff --git a/sortedUniqBy.js b/sortedUniqBy.js index 990950e62..41fe08451 100644 --- a/sortedUniqBy.js +++ b/sortedUniqBy.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import baseSortedUniq from './_baseSortedUniq'; +import baseIteratee from './_baseIteratee.js'; +import baseSortedUniq from './_baseSortedUniq.js'; /** * This method is like `_.uniqBy` except that it's designed and optimized diff --git a/split.js b/split.js index 14ad5392b..4de901d1f 100644 --- a/split.js +++ b/split.js @@ -1,10 +1,10 @@ -import baseToString from './_baseToString'; -import castSlice from './_castSlice'; -import isIterateeCall from './_isIterateeCall'; -import isRegExp from './isRegExp'; -import reHasComplexSymbol from './_reHasComplexSymbol'; -import stringToArray from './_stringToArray'; -import toString from './toString'; +import baseToString from './_baseToString.js'; +import castSlice from './_castSlice.js'; +import isIterateeCall from './_isIterateeCall.js'; +import isRegExp from './isRegExp.js'; +import reHasComplexSymbol from './_reHasComplexSymbol.js'; +import stringToArray from './_stringToArray.js'; +import toString from './toString.js'; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295; diff --git a/spread.js b/spread.js index 94923335f..c2a33cadb 100644 --- a/spread.js +++ b/spread.js @@ -1,8 +1,8 @@ -import apply from './_apply'; -import arrayPush from './_arrayPush'; -import castSlice from './_castSlice'; -import rest from './rest'; -import toInteger from './toInteger'; +import apply from './_apply.js'; +import arrayPush from './_arrayPush.js'; +import castSlice from './_castSlice.js'; +import rest from './rest.js'; +import toInteger from './toInteger.js'; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; diff --git a/startCase.js b/startCase.js index 806119b05..17f9cde3c 100644 --- a/startCase.js +++ b/startCase.js @@ -1,5 +1,5 @@ -import createCompounder from './_createCompounder'; -import upperFirst from './upperFirst'; +import createCompounder from './_createCompounder.js'; +import upperFirst from './upperFirst.js'; /** * Converts `string` to diff --git a/startsWith.js b/startsWith.js index a8738450c..38fc0081c 100644 --- a/startsWith.js +++ b/startsWith.js @@ -1,7 +1,7 @@ -import baseClamp from './_baseClamp'; -import baseToString from './_baseToString'; -import toInteger from './toInteger'; -import toString from './toString'; +import baseClamp from './_baseClamp.js'; +import baseToString from './_baseToString.js'; +import toInteger from './toInteger.js'; +import toString from './toString.js'; /** * Checks if `string` starts with the given target string. diff --git a/string.default.js b/string.default.js index 5cc66f246..7a23a6431 100644 --- a/string.default.js +++ b/string.default.js @@ -1,34 +1,34 @@ -import camelCase from './camelCase'; -import capitalize from './capitalize'; -import deburr from './deburr'; -import endsWith from './endsWith'; -import escape from './escape'; -import escapeRegExp from './escapeRegExp'; -import kebabCase from './kebabCase'; -import lowerCase from './lowerCase'; -import lowerFirst from './lowerFirst'; -import pad from './pad'; -import padEnd from './padEnd'; -import padStart from './padStart'; -import parseInt from './parseInt'; -import repeat from './repeat'; -import replace from './replace'; -import snakeCase from './snakeCase'; -import split from './split'; -import startCase from './startCase'; -import startsWith from './startsWith'; -import template from './template'; -import templateSettings from './templateSettings'; -import toLower from './toLower'; -import toUpper from './toUpper'; -import trim from './trim'; -import trimEnd from './trimEnd'; -import trimStart from './trimStart'; -import truncate from './truncate'; -import unescape from './unescape'; -import upperCase from './upperCase'; -import upperFirst from './upperFirst'; -import words from './words'; +import camelCase from './camelCase.js'; +import capitalize from './capitalize.js'; +import deburr from './deburr.js'; +import endsWith from './endsWith.js'; +import escape from './escape.js'; +import escapeRegExp from './escapeRegExp.js'; +import kebabCase from './kebabCase.js'; +import lowerCase from './lowerCase.js'; +import lowerFirst from './lowerFirst.js'; +import pad from './pad.js'; +import padEnd from './padEnd.js'; +import padStart from './padStart.js'; +import parseInt from './parseInt.js'; +import repeat from './repeat.js'; +import replace from './replace.js'; +import snakeCase from './snakeCase.js'; +import split from './split.js'; +import startCase from './startCase.js'; +import startsWith from './startsWith.js'; +import template from './template.js'; +import templateSettings from './templateSettings.js'; +import toLower from './toLower.js'; +import toUpper from './toUpper.js'; +import trim from './trim.js'; +import trimEnd from './trimEnd.js'; +import trimStart from './trimStart.js'; +import truncate from './truncate.js'; +import unescape from './unescape.js'; +import upperCase from './upperCase.js'; +import upperFirst from './upperFirst.js'; +import words from './words.js'; export default { camelCase, capitalize, deburr, endsWith, escape, diff --git a/string.js b/string.js index 030db7a3f..8b9be91e0 100644 --- a/string.js +++ b/string.js @@ -1,32 +1,32 @@ -export { default as camelCase } from './camelCase'; -export { default as capitalize } from './capitalize'; -export { default as deburr } from './deburr'; -export { default as endsWith } from './endsWith'; -export { default as escape } from './escape'; -export { default as escapeRegExp } from './escapeRegExp'; -export { default as kebabCase } from './kebabCase'; -export { default as lowerCase } from './lowerCase'; -export { default as lowerFirst } from './lowerFirst'; -export { default as pad } from './pad'; -export { default as padEnd } from './padEnd'; -export { default as padStart } from './padStart'; -export { default as parseInt } from './parseInt'; -export { default as repeat } from './repeat'; -export { default as replace } from './replace'; -export { default as snakeCase } from './snakeCase'; -export { default as split } from './split'; -export { default as startCase } from './startCase'; -export { default as startsWith } from './startsWith'; -export { default as template } from './template'; -export { default as templateSettings } from './templateSettings'; -export { default as toLower } from './toLower'; -export { default as toUpper } from './toUpper'; -export { default as trim } from './trim'; -export { default as trimEnd } from './trimEnd'; -export { default as trimStart } from './trimStart'; -export { default as truncate } from './truncate'; -export { default as unescape } from './unescape'; -export { default as upperCase } from './upperCase'; -export { default as upperFirst } from './upperFirst'; -export { default as words } from './words'; +export { default as camelCase } from './camelCase.js'; +export { default as capitalize } from './capitalize.js'; +export { default as deburr } from './deburr.js'; +export { default as endsWith } from './endsWith.js'; +export { default as escape } from './escape.js'; +export { default as escapeRegExp } from './escapeRegExp.js'; +export { default as kebabCase } from './kebabCase.js'; +export { default as lowerCase } from './lowerCase.js'; +export { default as lowerFirst } from './lowerFirst.js'; +export { default as pad } from './pad.js'; +export { default as padEnd } from './padEnd.js'; +export { default as padStart } from './padStart.js'; +export { default as parseInt } from './parseInt.js'; +export { default as repeat } from './repeat.js'; +export { default as replace } from './replace.js'; +export { default as snakeCase } from './snakeCase.js'; +export { default as split } from './split.js'; +export { default as startCase } from './startCase.js'; +export { default as startsWith } from './startsWith.js'; +export { default as template } from './template.js'; +export { default as templateSettings } from './templateSettings.js'; +export { default as toLower } from './toLower.js'; +export { default as toUpper } from './toUpper.js'; +export { default as trim } from './trim.js'; +export { default as trimEnd } from './trimEnd.js'; +export { default as trimStart } from './trimStart.js'; +export { default as truncate } from './truncate.js'; +export { default as unescape } from './unescape.js'; +export { default as upperCase } from './upperCase.js'; +export { default as upperFirst } from './upperFirst.js'; +export { default as words } from './words.js'; export { default as default } from './string.default'; diff --git a/stubArray.js b/stubArray.js new file mode 100644 index 000000000..7de7be9a4 --- /dev/null +++ b/stubArray.js @@ -0,0 +1,23 @@ +/** + * A method that returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +export default stubArray; diff --git a/stubFalse.js b/stubFalse.js new file mode 100644 index 000000000..5598e0c9a --- /dev/null +++ b/stubFalse.js @@ -0,0 +1,18 @@ +/** + * A method that returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +export default stubFalse; diff --git a/stubObject.js b/stubObject.js new file mode 100644 index 000000000..5cc8d8ce4 --- /dev/null +++ b/stubObject.js @@ -0,0 +1,23 @@ +/** + * A method that returns a new empty object. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Object} Returns the new empty object. + * @example + * + * var objects = _.times(2, _.stubObject); + * + * console.log(objects); + * // => [{}, {}] + * + * console.log(objects[0] === objects[1]); + * // => false + */ +function stubObject() { + return {}; +} + +export default stubObject; diff --git a/stubString.js b/stubString.js new file mode 100644 index 000000000..5cc375d9a --- /dev/null +++ b/stubString.js @@ -0,0 +1,18 @@ +/** + * A method that returns an empty string. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {string} Returns the empty string. + * @example + * + * _.times(2, _.stubString); + * // => ['', ''] + */ +function stubString() { + return ''; +} + +export default stubString; diff --git a/stubTrue.js b/stubTrue.js new file mode 100644 index 000000000..ec604f78e --- /dev/null +++ b/stubTrue.js @@ -0,0 +1,18 @@ +/** + * A method that returns `true`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `true`. + * @example + * + * _.times(2, _.stubTrue); + * // => [true, true] + */ +function stubTrue() { + return true; +} + +export default stubTrue; diff --git a/subtract.js b/subtract.js index b9236aea9..c0a6a56b3 100644 --- a/subtract.js +++ b/subtract.js @@ -1,4 +1,4 @@ -import createMathOperation from './_createMathOperation'; +import createMathOperation from './_createMathOperation.js'; /** * Subtract two numbers. diff --git a/sum.js b/sum.js index 079c4e7aa..708254bb4 100644 --- a/sum.js +++ b/sum.js @@ -1,5 +1,5 @@ -import baseSum from './_baseSum'; -import identity from './identity'; +import baseSum from './_baseSum.js'; +import identity from './identity.js'; /** * Computes the sum of the values in `array`. diff --git a/sumBy.js b/sumBy.js index 0aba97f41..fdf093609 100644 --- a/sumBy.js +++ b/sumBy.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import baseSum from './_baseSum'; +import baseIteratee from './_baseIteratee.js'; +import baseSum from './_baseSum.js'; /** * This method is like `_.sum` except that it accepts `iteratee` which is diff --git a/tail.js b/tail.js index 905db6c0f..7d3f0d852 100644 --- a/tail.js +++ b/tail.js @@ -1,4 +1,4 @@ -import drop from './drop'; +import drop from './drop.js'; /** * Gets all but the first element of `array`. diff --git a/take.js b/take.js index 0f851561c..f8fef3101 100644 --- a/take.js +++ b/take.js @@ -1,5 +1,5 @@ -import baseSlice from './_baseSlice'; -import toInteger from './toInteger'; +import baseSlice from './_baseSlice.js'; +import toInteger from './toInteger.js'; /** * Creates a slice of `array` with `n` elements taken from the beginning. diff --git a/takeRight.js b/takeRight.js index 25554ca1d..c7ed8da89 100644 --- a/takeRight.js +++ b/takeRight.js @@ -1,5 +1,5 @@ -import baseSlice from './_baseSlice'; -import toInteger from './toInteger'; +import baseSlice from './_baseSlice.js'; +import toInteger from './toInteger.js'; /** * Creates a slice of `array` with `n` elements taken from the end. diff --git a/takeRightWhile.js b/takeRightWhile.js index 748e9721c..c4cf744ea 100644 --- a/takeRightWhile.js +++ b/takeRightWhile.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import baseWhile from './_baseWhile'; +import baseIteratee from './_baseIteratee.js'; +import baseWhile from './_baseWhile.js'; /** * Creates a slice of `array` with elements taken from the end. Elements are diff --git a/takeWhile.js b/takeWhile.js index 44f970e8c..41fc5fee3 100644 --- a/takeWhile.js +++ b/takeWhile.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import baseWhile from './_baseWhile'; +import baseIteratee from './_baseIteratee.js'; +import baseWhile from './_baseWhile.js'; /** * Creates a slice of `array` with elements taken from the beginning. Elements diff --git a/template.js b/template.js index 2a70593eb..9810eaa63 100644 --- a/template.js +++ b/template.js @@ -1,14 +1,14 @@ -import assignInDefaults from './_assignInDefaults'; -import assignInWith from './assignInWith'; -import attempt from './attempt'; -import baseValues from './_baseValues'; -import escapeStringChar from './_escapeStringChar'; -import isError from './isError'; -import isIterateeCall from './_isIterateeCall'; -import keys from './keys'; -import reInterpolate from './_reInterpolate'; -import templateSettings from './templateSettings'; -import toString from './toString'; +import assignInDefaults from './_assignInDefaults.js'; +import assignInWith from './assignInWith.js'; +import attempt from './attempt.js'; +import baseValues from './_baseValues.js'; +import escapeStringChar from './_escapeStringChar.js'; +import isError from './isError.js'; +import isIterateeCall from './_isIterateeCall.js'; +import keys from './keys.js'; +import reInterpolate from './_reInterpolate.js'; +import templateSettings from './templateSettings.js'; +import toString from './toString.js'; /** Used to match empty string literals in compiled template source. */ var reEmptyStringLeading = /\b__p \+= '';/g, diff --git a/templateSettings.js b/templateSettings.js index b310bdbda..ed9388448 100644 --- a/templateSettings.js +++ b/templateSettings.js @@ -1,7 +1,7 @@ -import escape from './escape'; -import reEscape from './_reEscape'; -import reEvaluate from './_reEvaluate'; -import reInterpolate from './_reInterpolate'; +import escape from './escape.js'; +import reEscape from './_reEscape.js'; +import reEvaluate from './_reEvaluate.js'; +import reInterpolate from './_reInterpolate.js'; /** * By default, the template delimiters used by lodash are like those in diff --git a/throttle.js b/throttle.js index 92616a8af..b9c089b5f 100644 --- a/throttle.js +++ b/throttle.js @@ -1,5 +1,5 @@ -import debounce from './debounce'; -import isObject from './isObject'; +import debounce from './debounce.js'; +import isObject from './isObject.js'; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; diff --git a/times.js b/times.js index ea404f5e2..4466e7004 100644 --- a/times.js +++ b/times.js @@ -1,6 +1,6 @@ -import baseIteratee from './_baseIteratee'; -import baseTimes from './_baseTimes'; -import toInteger from './toInteger'; +import baseIteratee from './_baseIteratee.js'; +import baseTimes from './_baseTimes.js'; +import toInteger from './toInteger.js'; /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; @@ -27,8 +27,8 @@ var nativeMin = Math.min; * _.times(3, String); * // => ['0', '1', '2'] * - * _.times(4, _.constant(true)); - * // => [true, true, true, true] + * _.times(4, _.constant(0)); + * // => [0, 0, 0, 0] */ function times(n, iteratee) { n = toInteger(n); diff --git a/toArray.js b/toArray.js index 1dd27ee67..09a774813 100644 --- a/toArray.js +++ b/toArray.js @@ -1,13 +1,13 @@ -import Symbol from './_Symbol'; -import copyArray from './_copyArray'; -import getTag from './_getTag'; -import isArrayLike from './isArrayLike'; -import isString from './isString'; -import iteratorToArray from './_iteratorToArray'; -import mapToArray from './_mapToArray'; -import setToArray from './_setToArray'; -import stringToArray from './_stringToArray'; -import values from './values'; +import Symbol from './_Symbol.js'; +import copyArray from './_copyArray.js'; +import getTag from './_getTag.js'; +import isArrayLike from './isArrayLike.js'; +import isString from './isString.js'; +import iteratorToArray from './_iteratorToArray.js'; +import mapToArray from './_mapToArray.js'; +import setToArray from './_setToArray.js'; +import stringToArray from './_stringToArray.js'; +import values from './values.js'; /** `Object#toString` result references. */ var mapTag = '[object Map]', diff --git a/toFinite.js b/toFinite.js index d0e85b46a..ac06b7c99 100644 --- a/toFinite.js +++ b/toFinite.js @@ -1,4 +1,4 @@ -import toNumber from './toNumber'; +import toNumber from './toNumber.js'; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, diff --git a/toInteger.js b/toInteger.js index 1bb0c9f9b..b51a9d0ba 100644 --- a/toInteger.js +++ b/toInteger.js @@ -1,9 +1,9 @@ -import toFinite from './toFinite'; +import toFinite from './toFinite.js'; /** * Converts `value` to an integer. * - * **Note:** This function is loosely based on + * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). * * @static diff --git a/toJSON.js b/toJSON.js index bca71bc8e..089af9268 100644 --- a/toJSON.js +++ b/toJSON.js @@ -1 +1 @@ -export { default } from './wrapperValue' +export { default } from './wrapperValue.js' diff --git a/toLength.js b/toLength.js index 73a2e2ff9..b10b3b90f 100644 --- a/toLength.js +++ b/toLength.js @@ -1,5 +1,5 @@ -import baseClamp from './_baseClamp'; -import toInteger from './toInteger'; +import baseClamp from './_baseClamp.js'; +import toInteger from './toInteger.js'; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295; diff --git a/toLower.js b/toLower.js index 7713785b7..d7c75cdfc 100644 --- a/toLower.js +++ b/toLower.js @@ -1,4 +1,4 @@ -import toString from './toString'; +import toString from './toString.js'; /** * Converts `string`, as a whole, to lower case just like diff --git a/toNumber.js b/toNumber.js index 4ce009e64..55609a814 100644 --- a/toNumber.js +++ b/toNumber.js @@ -1,6 +1,6 @@ -import isFunction from './isFunction'; -import isObject from './isObject'; -import isSymbol from './isSymbol'; +import isFunction from './isFunction.js'; +import isObject from './isObject.js'; +import isSymbol from './isSymbol.js'; /** Used as references for various `Number` constants. */ var NAN = 0 / 0; diff --git a/toPairs.js b/toPairs.js index 434d03999..d3e0a2ef6 100644 --- a/toPairs.js +++ b/toPairs.js @@ -1,5 +1,5 @@ -import createToPairs from './_createToPairs'; -import keys from './keys'; +import createToPairs from './_createToPairs.js'; +import keys from './keys.js'; /** * Creates an array of own enumerable string keyed-value pairs for `object` diff --git a/toPairsIn.js b/toPairsIn.js index d0a2ed4d5..0d46b45f8 100644 --- a/toPairsIn.js +++ b/toPairsIn.js @@ -1,5 +1,5 @@ -import createToPairs from './_createToPairs'; -import keysIn from './keysIn'; +import createToPairs from './_createToPairs.js'; +import keysIn from './keysIn.js'; /** * Creates an array of own and inherited enumerable string keyed-value pairs diff --git a/toPath.js b/toPath.js index dc277f4cc..55ab01c52 100644 --- a/toPath.js +++ b/toPath.js @@ -1,9 +1,9 @@ -import arrayMap from './_arrayMap'; -import copyArray from './_copyArray'; -import isArray from './isArray'; -import isSymbol from './isSymbol'; -import stringToPath from './_stringToPath'; -import toKey from './_toKey'; +import arrayMap from './_arrayMap.js'; +import copyArray from './_copyArray.js'; +import isArray from './isArray.js'; +import isSymbol from './isSymbol.js'; +import stringToPath from './_stringToPath.js'; +import toKey from './_toKey.js'; /** * Converts `value` to a property path array. @@ -21,15 +21,6 @@ import toKey from './_toKey'; * * _.toPath('a[0].b.c'); * // => ['a', '0', 'b', 'c'] - * - * var path = ['a', 'b', 'c'], - * newPath = _.toPath(path); - * - * console.log(newPath); - * // => ['a', 'b', 'c'] - * - * console.log(path === newPath); - * // => false */ function toPath(value) { if (isArray(value)) { diff --git a/toPlainObject.js b/toPlainObject.js index a9ec333a9..b4e9129ac 100644 --- a/toPlainObject.js +++ b/toPlainObject.js @@ -1,5 +1,5 @@ -import copyObject from './_copyObject'; -import keysIn from './keysIn'; +import copyObject from './_copyObject.js'; +import keysIn from './keysIn.js'; /** * Converts `value` to a plain object flattening inherited enumerable string diff --git a/toSafeInteger.js b/toSafeInteger.js index 88cc90651..7dba63c9a 100644 --- a/toSafeInteger.js +++ b/toSafeInteger.js @@ -1,5 +1,5 @@ -import baseClamp from './_baseClamp'; -import toInteger from './toInteger'; +import baseClamp from './_baseClamp.js'; +import toInteger from './toInteger.js'; /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; diff --git a/toString.js b/toString.js index 6fb03c3b5..3f0bc49d9 100644 --- a/toString.js +++ b/toString.js @@ -1,4 +1,4 @@ -import baseToString from './_baseToString'; +import baseToString from './_baseToString.js'; /** * Converts `value` to a string. An empty string is returned for `null` diff --git a/toUpper.js b/toUpper.js index 5435d0d2e..6ec73fb05 100644 --- a/toUpper.js +++ b/toUpper.js @@ -1,4 +1,4 @@ -import toString from './toString'; +import toString from './toString.js'; /** * Converts `string`, as a whole, to upper case just like diff --git a/transform.js b/transform.js index f681d9659..2ea561aad 100644 --- a/transform.js +++ b/transform.js @@ -1,26 +1,27 @@ -import arrayEach from './_arrayEach'; -import baseCreate from './_baseCreate'; -import baseForOwn from './_baseForOwn'; -import baseIteratee from './_baseIteratee'; -import getPrototype from './_getPrototype'; -import isArray from './isArray'; -import isFunction from './isFunction'; -import isObject from './isObject'; -import isTypedArray from './isTypedArray'; +import arrayEach from './_arrayEach.js'; +import baseCreate from './_baseCreate.js'; +import baseForOwn from './_baseForOwn.js'; +import baseIteratee from './_baseIteratee.js'; +import getPrototype from './_getPrototype.js'; +import isArray from './isArray.js'; +import isFunction from './isFunction.js'; +import isObject from './isObject.js'; +import isTypedArray from './isTypedArray.js'; /** * An alternative to `_.reduce`; this method transforms `object` to a new * `accumulator` object which is the result of running each of its own * enumerable string keyed properties thru `iteratee`, with each invocation - * potentially mutating the `accumulator` object. The iteratee is invoked - * with four arguments: (accumulator, value, key, object). Iteratee functions - * may exit iteration early by explicitly returning `false`. + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 1.3.0 * @category Object - * @param {Array|Object} object The object to iterate over. + * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The custom accumulator value. * @returns {*} Returns the accumulated value. diff --git a/trim.js b/trim.js index b1eceec22..11ec4d7d3 100644 --- a/trim.js +++ b/trim.js @@ -1,9 +1,9 @@ -import baseToString from './_baseToString'; -import castSlice from './_castSlice'; -import charsEndIndex from './_charsEndIndex'; -import charsStartIndex from './_charsStartIndex'; -import stringToArray from './_stringToArray'; -import toString from './toString'; +import baseToString from './_baseToString.js'; +import castSlice from './_castSlice.js'; +import charsEndIndex from './_charsEndIndex.js'; +import charsStartIndex from './_charsStartIndex.js'; +import stringToArray from './_stringToArray.js'; +import toString from './toString.js'; /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g; diff --git a/trimEnd.js b/trimEnd.js index 5c90502b4..4215af3d4 100644 --- a/trimEnd.js +++ b/trimEnd.js @@ -1,8 +1,8 @@ -import baseToString from './_baseToString'; -import castSlice from './_castSlice'; -import charsEndIndex from './_charsEndIndex'; -import stringToArray from './_stringToArray'; -import toString from './toString'; +import baseToString from './_baseToString.js'; +import castSlice from './_castSlice.js'; +import charsEndIndex from './_charsEndIndex.js'; +import stringToArray from './_stringToArray.js'; +import toString from './toString.js'; /** Used to match leading and trailing whitespace. */ var reTrimEnd = /\s+$/; diff --git a/trimStart.js b/trimStart.js index 89df08b5f..aa00c50f3 100644 --- a/trimStart.js +++ b/trimStart.js @@ -1,8 +1,8 @@ -import baseToString from './_baseToString'; -import castSlice from './_castSlice'; -import charsStartIndex from './_charsStartIndex'; -import stringToArray from './_stringToArray'; -import toString from './toString'; +import baseToString from './_baseToString.js'; +import castSlice from './_castSlice.js'; +import charsStartIndex from './_charsStartIndex.js'; +import stringToArray from './_stringToArray.js'; +import toString from './toString.js'; /** Used to match leading and trailing whitespace. */ var reTrimStart = /^\s+/; diff --git a/truncate.js b/truncate.js index 593c9369b..0c3082c51 100644 --- a/truncate.js +++ b/truncate.js @@ -1,12 +1,12 @@ -import baseToString from './_baseToString'; -import castSlice from './_castSlice'; -import isObject from './isObject'; -import isRegExp from './isRegExp'; -import reHasComplexSymbol from './_reHasComplexSymbol'; -import stringSize from './_stringSize'; -import stringToArray from './_stringToArray'; -import toInteger from './toInteger'; -import toString from './toString'; +import baseToString from './_baseToString.js'; +import castSlice from './_castSlice.js'; +import isObject from './isObject.js'; +import isRegExp from './isRegExp.js'; +import reHasComplexSymbol from './_reHasComplexSymbol.js'; +import stringSize from './_stringSize.js'; +import stringToArray from './_stringToArray.js'; +import toInteger from './toInteger.js'; +import toString from './toString.js'; /** Used as default options for `_.truncate`. */ var DEFAULT_TRUNC_LENGTH = 30, diff --git a/unary.js b/unary.js index d8dd210c9..cdb59ffb5 100644 --- a/unary.js +++ b/unary.js @@ -1,4 +1,4 @@ -import ary from './ary'; +import ary from './ary.js'; /** * Creates a function that accepts up to one argument, ignoring any diff --git a/unescape.js b/unescape.js index 07e207047..3f7acda10 100644 --- a/unescape.js +++ b/unescape.js @@ -1,5 +1,5 @@ -import toString from './toString'; -import unescapeHtmlChar from './_unescapeHtmlChar'; +import toString from './toString.js'; +import unescapeHtmlChar from './_unescapeHtmlChar.js'; /** Used to match HTML entities and HTML characters. */ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, diff --git a/union.js b/union.js index 6e23eed49..3b019f6d0 100644 --- a/union.js +++ b/union.js @@ -1,7 +1,7 @@ -import baseFlatten from './_baseFlatten'; -import baseUniq from './_baseUniq'; -import isArrayLikeObject from './isArrayLikeObject'; -import rest from './rest'; +import baseFlatten from './_baseFlatten.js'; +import baseUniq from './_baseUniq.js'; +import isArrayLikeObject from './isArrayLikeObject.js'; +import rest from './rest.js'; /** * Creates an array of unique values, in order, from all given arrays using @@ -16,8 +16,8 @@ import rest from './rest'; * @returns {Array} Returns the new array of combined values. * @example * - * _.union([2, 1], [4, 2], [1, 2]); - * // => [2, 1, 4] + * _.union([2], [1, 2]); + * // => [2, 1] */ var union = rest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); diff --git a/unionBy.js b/unionBy.js index 11c1afe15..2de20dafc 100644 --- a/unionBy.js +++ b/unionBy.js @@ -1,9 +1,9 @@ -import baseFlatten from './_baseFlatten'; -import baseIteratee from './_baseIteratee'; -import baseUniq from './_baseUniq'; -import isArrayLikeObject from './isArrayLikeObject'; -import last from './last'; -import rest from './rest'; +import baseFlatten from './_baseFlatten.js'; +import baseIteratee from './_baseIteratee.js'; +import baseUniq from './_baseUniq.js'; +import isArrayLikeObject from './isArrayLikeObject.js'; +import last from './last.js'; +import rest from './rest.js'; /** * This method is like `_.union` except that it accepts `iteratee` which is @@ -21,8 +21,8 @@ import rest from './rest'; * @returns {Array} Returns the new array of combined values. * @example * - * _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1, 1.2, 4.3] + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); diff --git a/unionWith.js b/unionWith.js index 16a8197b1..5c84b0a4b 100644 --- a/unionWith.js +++ b/unionWith.js @@ -1,8 +1,8 @@ -import baseFlatten from './_baseFlatten'; -import baseUniq from './_baseUniq'; -import isArrayLikeObject from './isArrayLikeObject'; -import last from './last'; -import rest from './rest'; +import baseFlatten from './_baseFlatten.js'; +import baseUniq from './_baseUniq.js'; +import isArrayLikeObject from './isArrayLikeObject.js'; +import last from './last.js'; +import rest from './rest.js'; /** * This method is like `_.union` except that it accepts `comparator` which diff --git a/uniq.js b/uniq.js index 235a767cb..66e3de525 100644 --- a/uniq.js +++ b/uniq.js @@ -1,4 +1,4 @@ -import baseUniq from './_baseUniq'; +import baseUniq from './_baseUniq.js'; /** * Creates a duplicate-free version of an array, using diff --git a/uniqBy.js b/uniqBy.js index 789a91d1a..11aaafc0a 100644 --- a/uniqBy.js +++ b/uniqBy.js @@ -1,5 +1,5 @@ -import baseIteratee from './_baseIteratee'; -import baseUniq from './_baseUniq'; +import baseIteratee from './_baseIteratee.js'; +import baseUniq from './_baseUniq.js'; /** * This method is like `_.uniq` except that it accepts `iteratee` which is diff --git a/uniqWith.js b/uniqWith.js index 87a48de09..e72388d9a 100644 --- a/uniqWith.js +++ b/uniqWith.js @@ -1,4 +1,4 @@ -import baseUniq from './_baseUniq'; +import baseUniq from './_baseUniq.js'; /** * This method is like `_.uniq` except that it accepts `comparator` which @@ -14,7 +14,7 @@ import baseUniq from './_baseUniq'; * @returns {Array} Returns the new duplicate free array. * @example * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.uniqWith(objects, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] diff --git a/uniqueId.js b/uniqueId.js index 9684ede3d..d775c7e44 100644 --- a/uniqueId.js +++ b/uniqueId.js @@ -1,4 +1,4 @@ -import toString from './toString'; +import toString from './toString.js'; /** Used to generate unique IDs. */ var idCounter = 0; diff --git a/unset.js b/unset.js index 5c2aa10c7..627feefaa 100644 --- a/unset.js +++ b/unset.js @@ -1,4 +1,4 @@ -import baseUnset from './_baseUnset'; +import baseUnset from './_baseUnset.js'; /** * Removes the property at `path` of `object`. diff --git a/unzip.js b/unzip.js index ca05ed827..7e09d1c93 100644 --- a/unzip.js +++ b/unzip.js @@ -1,8 +1,8 @@ -import arrayFilter from './_arrayFilter'; -import arrayMap from './_arrayMap'; -import baseProperty from './_baseProperty'; -import baseTimes from './_baseTimes'; -import isArrayLikeObject from './isArrayLikeObject'; +import arrayFilter from './_arrayFilter.js'; +import arrayMap from './_arrayMap.js'; +import baseProperty from './_baseProperty.js'; +import baseTimes from './_baseTimes.js'; +import isArrayLikeObject from './isArrayLikeObject.js'; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; diff --git a/unzipWith.js b/unzipWith.js index 86de50289..c588d08bc 100644 --- a/unzipWith.js +++ b/unzipWith.js @@ -1,6 +1,6 @@ -import apply from './_apply'; -import arrayMap from './_arrayMap'; -import unzip from './unzip'; +import apply from './_apply.js'; +import arrayMap from './_arrayMap.js'; +import unzip from './unzip.js'; /** * This method is like `_.unzip` except that it accepts `iteratee` to specify diff --git a/update.js b/update.js index ec4bbe332..c4b10036b 100644 --- a/update.js +++ b/update.js @@ -1,5 +1,5 @@ -import baseUpdate from './_baseUpdate'; -import castFunction from './_castFunction'; +import baseUpdate from './_baseUpdate.js'; +import castFunction from './_castFunction.js'; /** * This method is like `_.set` except that accepts `updater` to produce the diff --git a/updateWith.js b/updateWith.js index 528ef2f4b..190b092b8 100644 --- a/updateWith.js +++ b/updateWith.js @@ -1,5 +1,5 @@ -import baseUpdate from './_baseUpdate'; -import castFunction from './_castFunction'; +import baseUpdate from './_baseUpdate.js'; +import castFunction from './_castFunction.js'; /** * This method is like `_.update` except that it accepts `customizer` which is diff --git a/upperCase.js b/upperCase.js index 1552f3887..b5cf8578b 100644 --- a/upperCase.js +++ b/upperCase.js @@ -1,4 +1,4 @@ -import createCompounder from './_createCompounder'; +import createCompounder from './_createCompounder.js'; /** * Converts `string`, as space separated words, to upper case. diff --git a/upperFirst.js b/upperFirst.js index cc4372b98..cb288a54b 100644 --- a/upperFirst.js +++ b/upperFirst.js @@ -1,4 +1,4 @@ -import createCaseFirst from './_createCaseFirst'; +import createCaseFirst from './_createCaseFirst.js'; /** * Converts the first character of `string` to upper case. diff --git a/util.default.js b/util.default.js index d2b93e508..7a399506d 100644 --- a/util.default.js +++ b/util.default.js @@ -1,35 +1,41 @@ -import attempt from './attempt'; -import bindAll from './bindAll'; -import cond from './cond'; -import conforms from './conforms'; -import constant from './constant'; -import flow from './flow'; -import flowRight from './flowRight'; -import identity from './identity'; -import iteratee from './iteratee'; -import matches from './matches'; -import matchesProperty from './matchesProperty'; -import method from './method'; -import methodOf from './methodOf'; -import mixin from './mixin'; -import noop from './noop'; -import nthArg from './nthArg'; -import over from './over'; -import overEvery from './overEvery'; -import overSome from './overSome'; -import property from './property'; -import propertyOf from './propertyOf'; -import range from './range'; -import rangeRight from './rangeRight'; -import times from './times'; -import toPath from './toPath'; -import uniqueId from './uniqueId'; +import attempt from './attempt.js'; +import bindAll from './bindAll.js'; +import cond from './cond.js'; +import conforms from './conforms.js'; +import constant from './constant.js'; +import flow from './flow.js'; +import flowRight from './flowRight.js'; +import identity from './identity.js'; +import iteratee from './iteratee.js'; +import matches from './matches.js'; +import matchesProperty from './matchesProperty.js'; +import method from './method.js'; +import methodOf from './methodOf.js'; +import mixin from './mixin.js'; +import noop from './noop.js'; +import nthArg from './nthArg.js'; +import over from './over.js'; +import overEvery from './overEvery.js'; +import overSome from './overSome.js'; +import property from './property.js'; +import propertyOf from './propertyOf.js'; +import range from './range.js'; +import rangeRight from './rangeRight.js'; +import stubArray from './stubArray.js'; +import stubFalse from './stubFalse.js'; +import stubObject from './stubObject.js'; +import stubString from './stubString.js'; +import stubTrue from './stubTrue.js'; +import times from './times.js'; +import toPath from './toPath.js'; +import uniqueId from './uniqueId.js'; export default { attempt, bindAll, cond, conforms, constant, flow, flowRight, identity, iteratee, matches, matchesProperty, method, methodOf, mixin, noop, nthArg, over, overEvery, overSome, property, - propertyOf, range, rangeRight, times, toPath, + propertyOf, range, rangeRight, stubArray, stubFalse, + stubObject, stubString, stubTrue, times, toPath, uniqueId }; diff --git a/util.js b/util.js index 21aea586c..1ea853117 100644 --- a/util.js +++ b/util.js @@ -1,27 +1,32 @@ -export { default as attempt } from './attempt'; -export { default as bindAll } from './bindAll'; -export { default as cond } from './cond'; -export { default as conforms } from './conforms'; -export { default as constant } from './constant'; -export { default as flow } from './flow'; -export { default as flowRight } from './flowRight'; -export { default as identity } from './identity'; -export { default as iteratee } from './iteratee'; -export { default as matches } from './matches'; -export { default as matchesProperty } from './matchesProperty'; -export { default as method } from './method'; -export { default as methodOf } from './methodOf'; -export { default as mixin } from './mixin'; -export { default as noop } from './noop'; -export { default as nthArg } from './nthArg'; -export { default as over } from './over'; -export { default as overEvery } from './overEvery'; -export { default as overSome } from './overSome'; -export { default as property } from './property'; -export { default as propertyOf } from './propertyOf'; -export { default as range } from './range'; -export { default as rangeRight } from './rangeRight'; -export { default as times } from './times'; -export { default as toPath } from './toPath'; -export { default as uniqueId } from './uniqueId'; +export { default as attempt } from './attempt.js'; +export { default as bindAll } from './bindAll.js'; +export { default as cond } from './cond.js'; +export { default as conforms } from './conforms.js'; +export { default as constant } from './constant.js'; +export { default as flow } from './flow.js'; +export { default as flowRight } from './flowRight.js'; +export { default as identity } from './identity.js'; +export { default as iteratee } from './iteratee.js'; +export { default as matches } from './matches.js'; +export { default as matchesProperty } from './matchesProperty.js'; +export { default as method } from './method.js'; +export { default as methodOf } from './methodOf.js'; +export { default as mixin } from './mixin.js'; +export { default as noop } from './noop.js'; +export { default as nthArg } from './nthArg.js'; +export { default as over } from './over.js'; +export { default as overEvery } from './overEvery.js'; +export { default as overSome } from './overSome.js'; +export { default as property } from './property.js'; +export { default as propertyOf } from './propertyOf.js'; +export { default as range } from './range.js'; +export { default as rangeRight } from './rangeRight.js'; +export { default as stubArray } from './stubArray.js'; +export { default as stubFalse } from './stubFalse.js'; +export { default as stubObject } from './stubObject.js'; +export { default as stubString } from './stubString.js'; +export { default as stubTrue } from './stubTrue.js'; +export { default as times } from './times.js'; +export { default as toPath } from './toPath.js'; +export { default as uniqueId } from './uniqueId.js'; export { default as default } from './util.default'; diff --git a/value.js b/value.js index bca71bc8e..089af9268 100644 --- a/value.js +++ b/value.js @@ -1 +1 @@ -export { default } from './wrapperValue' +export { default } from './wrapperValue.js' diff --git a/valueOf.js b/valueOf.js index bca71bc8e..089af9268 100644 --- a/valueOf.js +++ b/valueOf.js @@ -1 +1 @@ -export { default } from './wrapperValue' +export { default } from './wrapperValue.js' diff --git a/values.js b/values.js index 458273c3c..d693d7d42 100644 --- a/values.js +++ b/values.js @@ -1,5 +1,5 @@ -import baseValues from './_baseValues'; -import keys from './keys'; +import baseValues from './_baseValues.js'; +import keys from './keys.js'; /** * Creates an array of the own enumerable string keyed property values of `object`. diff --git a/valuesIn.js b/valuesIn.js index c88d0f852..1988fdda0 100644 --- a/valuesIn.js +++ b/valuesIn.js @@ -1,5 +1,5 @@ -import baseValues from './_baseValues'; -import keysIn from './keysIn'; +import baseValues from './_baseValues.js'; +import keysIn from './keysIn.js'; /** * Creates an array of the own and inherited enumerable string keyed property diff --git a/without.js b/without.js index 055bbdf3b..16aa304c4 100644 --- a/without.js +++ b/without.js @@ -1,6 +1,6 @@ -import baseDifference from './_baseDifference'; -import isArrayLikeObject from './isArrayLikeObject'; -import rest from './rest'; +import baseDifference from './_baseDifference.js'; +import isArrayLikeObject from './isArrayLikeObject.js'; +import rest from './rest.js'; /** * Creates an array excluding all given values using @@ -17,7 +17,7 @@ import rest from './rest'; * @see _.difference, _.xor * @example * - * _.without([1, 2, 1, 3], 1, 2); + * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ var without = rest(function(array, values) { diff --git a/words.js b/words.js index 1cf295e02..9edf1b217 100644 --- a/words.js +++ b/words.js @@ -1,4 +1,4 @@ -import toString from './toString'; +import toString from './toString.js'; /** Used to match non-compound words composed of alphanumeric characters. */ var reBasicWord = /[a-zA-Z0-9]+/g; diff --git a/wrap.js b/wrap.js index 092811470..a43387fc4 100644 --- a/wrap.js +++ b/wrap.js @@ -1,5 +1,5 @@ -import identity from './identity'; -import partial from './partial'; +import identity from './identity.js'; +import partial from './partial.js'; /** * Creates a function that provides `value` to the wrapper function as its diff --git a/wrapperAt.js b/wrapperAt.js index bc82ec1b9..cead5d9c5 100644 --- a/wrapperAt.js +++ b/wrapperAt.js @@ -1,10 +1,10 @@ -import LazyWrapper from './_LazyWrapper'; -import LodashWrapper from './_LodashWrapper'; -import baseAt from './_baseAt'; -import baseFlatten from './_baseFlatten'; -import isIndex from './_isIndex'; -import rest from './rest'; -import thru from './thru'; +import LazyWrapper from './_LazyWrapper.js'; +import LodashWrapper from './_LodashWrapper.js'; +import baseAt from './_baseAt.js'; +import baseFlatten from './_baseFlatten.js'; +import isIndex from './_isIndex.js'; +import rest from './rest.js'; +import thru from './thru.js'; /** * This method is the wrapper version of `_.at`. @@ -21,9 +21,6 @@ import thru from './thru'; * * _(object).at(['a[0].b.c', 'a[1]']).value(); * // => [3, 4] - * - * _(['a', 'b', 'c']).at(0, 2).value(); - * // => ['a', 'c'] */ var wrapperAt = rest(function(paths) { paths = baseFlatten(paths, 1); diff --git a/wrapperChain.js b/wrapperChain.js index bfb7c5cc5..2bba4396a 100644 --- a/wrapperChain.js +++ b/wrapperChain.js @@ -1,4 +1,4 @@ -import chain from './chain'; +import chain from './chain.js'; /** * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. diff --git a/wrapperLodash.js b/wrapperLodash.js index 838eac692..44771ec2a 100644 --- a/wrapperLodash.js +++ b/wrapperLodash.js @@ -1,9 +1,9 @@ -import LazyWrapper from './_LazyWrapper'; -import LodashWrapper from './_LodashWrapper'; -import baseLodash from './_baseLodash'; -import isArray from './isArray'; -import isObjectLike from './isObjectLike'; -import wrapperClone from './_wrapperClone'; +import LazyWrapper from './_LazyWrapper.js'; +import LodashWrapper from './_LodashWrapper.js'; +import baseLodash from './_baseLodash.js'; +import isArray from './isArray.js'; +import isObjectLike from './isObjectLike.js'; +import wrapperClone from './_wrapperClone.js'; /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -86,19 +86,21 @@ var hasOwnProperty = objectProto.hasOwnProperty; * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, * `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, * `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, - * `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, - * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, - * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, - * `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, - * `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`, - * `noConflict`, `noop`, `now`, `nth`, `pad`, `padEnd`, `padStart`, `parseInt`, - * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, - * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, - * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, - * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toFinite`, - * `toInteger`, `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, - * `toString`, `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, - * `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words` + * `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` * * @name _ * @constructor diff --git a/wrapperReverse.js b/wrapperReverse.js index bd93a2872..0cc824260 100644 --- a/wrapperReverse.js +++ b/wrapperReverse.js @@ -1,7 +1,7 @@ -import LazyWrapper from './_LazyWrapper'; -import LodashWrapper from './_LodashWrapper'; -import reverse from './reverse'; -import thru from './thru'; +import LazyWrapper from './_LazyWrapper.js'; +import LodashWrapper from './_LodashWrapper.js'; +import reverse from './reverse.js'; +import thru from './thru.js'; /** * This method is the wrapper version of `_.reverse`. diff --git a/wrapperValue.js b/wrapperValue.js index 99c38877c..b70023038 100644 --- a/wrapperValue.js +++ b/wrapperValue.js @@ -1,4 +1,4 @@ -import baseWrapperValue from './_baseWrapperValue'; +import baseWrapperValue from './_baseWrapperValue.js'; /** * Executes the chain sequence to resolve the unwrapped value. diff --git a/xor.js b/xor.js index 0c9aafa8e..f107736e7 100644 --- a/xor.js +++ b/xor.js @@ -1,7 +1,7 @@ -import arrayFilter from './_arrayFilter'; -import baseXor from './_baseXor'; -import isArrayLikeObject from './isArrayLikeObject'; -import rest from './rest'; +import arrayFilter from './_arrayFilter.js'; +import baseXor from './_baseXor.js'; +import isArrayLikeObject from './isArrayLikeObject.js'; +import rest from './rest.js'; /** * Creates an array of unique values that is the @@ -18,8 +18,8 @@ import rest from './rest'; * @see _.difference, _.without * @example * - * _.xor([2, 1], [4, 2]); - * // => [1, 4] + * _.xor([2, 1], [2, 3]); + * // => [1, 3] */ var xor = rest(function(arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)); diff --git a/xorBy.js b/xorBy.js index 51047f0ca..7d4f7c6ba 100644 --- a/xorBy.js +++ b/xorBy.js @@ -1,9 +1,9 @@ -import arrayFilter from './_arrayFilter'; -import baseIteratee from './_baseIteratee'; -import baseXor from './_baseXor'; -import isArrayLikeObject from './isArrayLikeObject'; -import last from './last'; -import rest from './rest'; +import arrayFilter from './_arrayFilter.js'; +import baseIteratee from './_baseIteratee.js'; +import baseXor from './_baseXor.js'; +import isArrayLikeObject from './isArrayLikeObject.js'; +import last from './last.js'; +import rest from './rest.js'; /** * This method is like `_.xor` except that it accepts `iteratee` which is @@ -21,8 +21,8 @@ import rest from './rest'; * @returns {Array} Returns the new array of filtered values. * @example * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] * * // The `_.property` iteratee shorthand. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); diff --git a/xorWith.js b/xorWith.js index 92dcd4e5e..95a5fa20c 100644 --- a/xorWith.js +++ b/xorWith.js @@ -1,8 +1,8 @@ -import arrayFilter from './_arrayFilter'; -import baseXor from './_baseXor'; -import isArrayLikeObject from './isArrayLikeObject'; -import last from './last'; -import rest from './rest'; +import arrayFilter from './_arrayFilter.js'; +import baseXor from './_baseXor.js'; +import isArrayLikeObject from './isArrayLikeObject.js'; +import last from './last.js'; +import rest from './rest.js'; /** * This method is like `_.xor` except that it accepts `comparator` which is diff --git a/zip.js b/zip.js index feec40589..05357fe48 100644 --- a/zip.js +++ b/zip.js @@ -1,5 +1,5 @@ -import rest from './rest'; -import unzip from './unzip'; +import rest from './rest.js'; +import unzip from './unzip.js'; /** * Creates an array of grouped elements, the first of which contains the diff --git a/zipObject.js b/zipObject.js index 2faa0d01e..ac7c9f92d 100644 --- a/zipObject.js +++ b/zipObject.js @@ -1,5 +1,5 @@ -import assignValue from './_assignValue'; -import baseZipObject from './_baseZipObject'; +import assignValue from './_assignValue.js'; +import baseZipObject from './_baseZipObject.js'; /** * This method is like `_.fromPairs` except that it accepts two arrays, diff --git a/zipObjectDeep.js b/zipObjectDeep.js index d023b6064..a44e6c220 100644 --- a/zipObjectDeep.js +++ b/zipObjectDeep.js @@ -1,5 +1,5 @@ -import baseSet from './_baseSet'; -import baseZipObject from './_baseZipObject'; +import baseSet from './_baseSet.js'; +import baseZipObject from './_baseZipObject.js'; /** * This method is like `_.zipObject` except that it supports property paths. diff --git a/zipWith.js b/zipWith.js index 25bf2e216..85c9fe558 100644 --- a/zipWith.js +++ b/zipWith.js @@ -1,5 +1,5 @@ -import rest from './rest'; -import unzipWith from './unzipWith'; +import rest from './rest.js'; +import unzipWith from './unzipWith.js'; /** * This method is like `_.zip` except that it accepts `iteratee` to specify