From 6cb3460fcefe66cb96e55b82c6febd2153c992cc Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 4 Feb 2017 23:50:10 -0800 Subject: [PATCH] Remove semicolons. --- .internal/Hash.js | 42 +++--- .internal/ListCache.js | 56 +++---- .internal/MapCache.js | 48 +++--- .internal/SetCache.js | 22 +-- .internal/Stack.js | 46 +++--- .internal/addMapEntry.js | 6 +- .internal/addSetEntry.js | 6 +- .internal/apply.js | 12 +- .internal/arrayEach.js | 10 +- .internal/arrayEachRight.js | 8 +- .internal/arrayEvery.js | 10 +- .internal/arrayFilter.js | 16 +- .internal/arrayIncludes.js | 8 +- .internal/arrayIncludesWith.js | 10 +- .internal/arrayLikeKeys.js | 32 ++-- .internal/arrayMap.js | 12 +- .internal/arrayPush.js | 12 +- .internal/arrayReduce.js | 12 +- .internal/arrayReduceRight.js | 10 +- .internal/arraySample.js | 8 +- .internal/arraySampleSize.js | 10 +- .internal/arrayShuffle.js | 8 +- .internal/arraySome.js | 10 +- .internal/asciiSize.js | 4 +- .internal/asciiToArray.js | 4 +- .internal/asciiWords.js | 6 +- .internal/assignMergeValue.js | 8 +- .internal/assignValue.js | 12 +- .internal/assocIndexOf.js | 10 +- .internal/baseAssign.js | 8 +- .internal/baseAssignIn.js | 8 +- .internal/baseAssignValue.js | 6 +- .internal/baseAt.js | 16 +- .internal/baseClamp.js | 8 +- .internal/baseClone.js | 212 +++++++++++++-------------- .internal/baseConforms.js | 10 +- .internal/baseConformsTo.js | 18 +-- .internal/baseCreate.js | 6 +- .internal/baseDifference.js | 56 +++---- .internal/baseEach.js | 8 +- .internal/baseEachRight.js | 8 +- .internal/baseEvery.js | 14 +- .internal/baseFill.js | 22 +-- .internal/baseFilter.js | 12 +- .internal/baseFindIndex.js | 10 +- .internal/baseFindKey.js | 12 +- .internal/baseFlatten.js | 24 +-- .internal/baseFor.js | 6 +- .internal/baseForOwn.js | 8 +- .internal/baseForOwnRight.js | 8 +- .internal/baseForRight.js | 6 +- .internal/baseFunctions.js | 8 +- .internal/baseGet.js | 16 +- .internal/baseGetTag.js | 16 +- .internal/baseHas.js | 6 +- .internal/baseHasIn.js | 4 +- .internal/baseInRange.js | 8 +- .internal/baseIndexOf.js | 10 +- .internal/baseIndexOfWith.js | 10 +- .internal/baseIntersection.js | 62 ++++---- .internal/baseIsEqual.js | 12 +- .internal/baseIsEqualDeep.js | 72 ++++----- .internal/baseIsMatch.js | 46 +++--- .internal/baseIsNaN.js | 4 +- .internal/baseKeys.js | 16 +- .internal/baseKeysIn.js | 20 +-- .internal/baseMap.js | 16 +- .internal/baseMatches.js | 14 +- .internal/baseMatchesProperty.js | 28 ++-- .internal/baseMerge.js | 28 ++-- .internal/baseMergeDeep.js | 80 +++++----- .internal/baseNth.js | 12 +- .internal/baseOrderBy.js | 24 +-- .internal/basePick.js | 8 +- .internal/basePickBy.js | 22 +-- .internal/baseProperty.js | 4 +- .internal/basePropertyDeep.js | 6 +- .internal/basePropertyOf.js | 4 +- .internal/basePullAll.js | 36 ++--- .internal/basePullAt.js | 24 +-- .internal/baseRandom.js | 4 +- .internal/baseRange.js | 18 +-- .internal/baseReduce.js | 8 +- .internal/baseRepeat.js | 20 +-- .internal/baseSample.js | 8 +- .internal/baseSampleSize.js | 12 +- .internal/baseSet.js | 40 ++--- .internal/baseSetToString.js | 8 +- .internal/baseShuffle.js | 8 +- .internal/baseSlice.js | 20 +-- .internal/baseSome.js | 14 +- .internal/baseSortBy.js | 10 +- .internal/baseSortedIndex.js | 28 ++-- .internal/baseSortedIndexBy.js | 58 ++++---- .internal/baseSortedUniq.js | 22 +-- .internal/baseSum.js | 14 +- .internal/baseTimes.js | 10 +- .internal/baseToNumber.js | 12 +- .internal/baseToString.js | 22 +-- .internal/baseUniq.js | 64 ++++---- .internal/baseUnset.js | 16 +- .internal/baseUpdate.js | 8 +- .internal/baseValues.js | 6 +- .internal/baseWhile.js | 10 +- .internal/baseWrapperValue.js | 14 +- .internal/baseXor.js | 24 +-- .internal/baseZipObject.js | 16 +- .internal/cacheHas.js | 4 +- .internal/castArrayLikeObject.js | 6 +- .internal/castPath.js | 12 +- .internal/castSlice.js | 10 +- .internal/charsEndIndex.js | 8 +- .internal/charsStartIndex.js | 10 +- .internal/cloneArrayBuffer.js | 8 +- .internal/cloneBuffer.js | 22 +-- .internal/cloneDataView.js | 8 +- .internal/cloneMap.js | 14 +- .internal/cloneRegExp.js | 10 +- .internal/cloneSet.js | 14 +- .internal/cloneSymbol.js | 6 +- .internal/cloneTypedArray.js | 8 +- .internal/compareAscending.js | 26 ++-- .internal/compareMultiple.js | 24 +-- .internal/composeArgs.js | 28 ++-- .internal/composeArgsRight.js | 32 ++-- .internal/copyArray.js | 12 +- .internal/copyObject.js | 26 ++-- .internal/copySymbols.js | 8 +- .internal/copySymbolsIn.js | 8 +- .internal/countHolders.js | 10 +- .internal/createCaseFirst.js | 22 +-- .internal/createCompounder.js | 12 +- .internal/createCtor.js | 30 ++-- .internal/createMathOperation.js | 28 ++-- .internal/createPadding.js | 26 ++-- .internal/createRange.js | 24 +-- .internal/createRound.js | 26 ++-- .internal/createSet.js | 8 +- .internal/customDefaultsAssignIn.js | 12 +- .internal/customDefaultsMerge.js | 14 +- .internal/deburrLetter.js | 8 +- .internal/equalArrays.js | 64 ++++---- .internal/equalByTag.js | 82 +++++------ .internal/equalObjects.js | 68 ++++----- .internal/freeGlobal.js | 4 +- .internal/getAllKeys.js | 10 +- .internal/getAllKeysIn.js | 10 +- .internal/getHolder.js | 6 +- .internal/getMatchData.js | 18 +-- .internal/getRawTag.js | 28 ++-- .internal/getSymbols.js | 18 +-- .internal/getSymbolsIn.js | 20 +-- .internal/getTag.js | 50 +++---- .internal/hasPath.js | 34 ++--- .internal/hasUnicode.js | 20 +-- .internal/hasUnicodeWord.js | 6 +- .internal/initCloneArray.js | 14 +- .internal/initCloneByTag.js | 74 +++++----- .internal/initCloneObject.js | 8 +- .internal/isFlattenable.js | 8 +- .internal/isIndex.js | 10 +- .internal/isIterateeCall.js | 18 +-- .internal/isKey.js | 16 +- .internal/isPrototype.js | 10 +- .internal/isStrictComparable.js | 6 +- .internal/iteratorToArray.js | 10 +- .internal/mapToArray.js | 12 +- .internal/matchesStrictComparable.js | 8 +- .internal/memoizeCapped.js | 16 +- .internal/mergeData.js | 72 ++++----- .internal/metaMap.js | 2 +- .internal/nativeKeys.js | 4 +- .internal/nativeKeysIn.js | 8 +- .internal/nodeUtil.js | 16 +- .internal/objectToString.js | 6 +- .internal/parent.js | 8 +- .internal/reEscape.js | 4 +- .internal/reEvaluate.js | 4 +- .internal/reInterpolate.js | 4 +- .internal/reorder.js | 20 +-- .internal/replaceHolders.js | 20 +-- .internal/root.js | 8 +- .internal/setToArray.js | 12 +- .internal/setToPairs.js | 10 +- .internal/setToString.js | 8 +- .internal/shuffleSelf.js | 24 +-- .internal/strictIndexOf.js | 10 +- .internal/strictLastIndexOf.js | 8 +- .internal/stringSize.js | 10 +- .internal/stringToArray.js | 10 +- .internal/stringToPath.js | 22 +-- .internal/toKey.js | 12 +- .internal/toSource.js | 10 +- .internal/unicodeSize.js | 48 +++--- .internal/unicodeToArray.js | 44 +++--- .internal/unicodeWords.js | 84 +++++------ add.js | 8 +- after.js | 20 +-- ary.js | 14 +- assignWith.js | 18 +-- at.js | 10 +- attempt.js | 14 +- before.js | 20 +-- bindKey.js | 44 +++--- camelCase.js | 18 +-- capitalize.js | 10 +- castArray.js | 24 +-- ceil.js | 12 +- chunk.js | 34 ++--- clamp.js | 20 +-- clone.js | 14 +- cloneDeep.js | 16 +- cloneDeepWith.js | 22 +-- cloneWith.js | 22 +-- compact.js | 18 +-- concat.js | 18 +-- cond.js | 30 ++-- conforms.js | 14 +- conformsTo.js | 14 +- countBy.js | 18 +-- create.js | 22 +-- curry.js | 30 ++-- curryRight.js | 30 ++-- debounce.js | 124 ++++++++-------- deburr.js | 26 ++-- defaultTo.js | 8 +- defaults.js | 14 +- defaultsDeep.js | 14 +- defer.js | 8 +- delay.js | 10 +- difference.js | 12 +- differenceBy.js | 18 +-- differenceWith.js | 20 +-- divide.js | 8 +- drop.js | 22 +-- dropRight.js | 24 +-- dropRightWhile.js | 10 +- dropWhile.js | 10 +- each.js | 2 +- eachRight.js | 2 +- endsWith.js | 30 ++-- eq.js | 18 +-- eqDeep.js | 14 +- escape.js | 28 ++-- escapeRegExp.js | 14 +- every.js | 16 +- filter.js | 14 +- find.js | 12 +- findKey.js | 12 +- findLast.js | 10 +- findLastIndex.js | 26 ++-- findLastKey.js | 12 +- first.js | 2 +- flatMap.js | 12 +- flatMapDeep.js | 14 +- flatMapDepth.js | 16 +- flatten.js | 10 +- flattenDeep.js | 12 +- flattenDepth.js | 20 +-- flip.js | 12 +- floor.js | 12 +- flow.js | 24 +-- flowRight.js | 12 +- forEach.js | 14 +- forEachRight.js | 12 +- forOwn.js | 16 +- forOwnRight.js | 16 +- fromPairs.js | 18 +-- functions.js | 16 +- get.js | 16 +- groupBy.js | 18 +-- gt.js | 16 +- gte.js | 16 +- has.js | 20 +-- hasIn.js | 18 +-- head.js | 8 +- inRange.js | 34 ++--- indexOf.js | 22 +-- initial.js | 10 +- intersection.js | 14 +- intersectionBy.js | 22 +-- intersectionWith.js | 26 ++-- invert.js | 16 +- invertBy.js | 22 +-- invoke.js | 24 +-- invokeMap.js | 26 ++-- isArguments.js | 12 +- isArrayBuffer.js | 16 +- isArrayLike.js | 16 +- isArrayLikeObject.js | 16 +- isBoolean.js | 12 +- isBuffer.js | 22 +-- isDate.js | 16 +- isElement.js | 12 +- isEmpty.js | 42 +++--- isEqualWith.js | 20 +-- isError.js | 18 +-- isFunction.js | 16 +- isLength.js | 14 +- isMap.js | 16 +- isMatch.js | 14 +- isMatchWith.js | 20 +-- isNative.js | 24 +-- isNil.js | 10 +- isNull.js | 8 +- isNumber.js | 16 +- isObject.js | 14 +- isObjectLike.js | 12 +- isPlainObject.js | 32 ++-- isRegExp.js | 16 +- isSet.js | 16 +- isString.js | 12 +- isSymbol.js | 12 +- isTypedArray.js | 20 +-- isUndefined.js | 8 +- isWeakMap.js | 12 +- isWeakSet.js | 12 +- join.js | 8 +- kebabCase.js | 12 +- keyBy.js | 12 +- keys.js | 20 +-- last.js | 8 +- lastIndexOf.js | 30 ++-- lowerCase.js | 12 +- lowerFirst.js | 10 +- lt.js | 16 +- lte.js | 16 +- map.js | 16 +- mapKeys.js | 20 +-- mapValues.js | 18 +-- matches.js | 14 +- matchesProperty.js | 14 +- maxBy.js | 26 ++-- mean.js | 10 +- meanBy.js | 14 +- memoize.js | 46 +++--- merge.js | 16 +- mergeWith.js | 18 +-- method.js | 12 +- methodOf.js | 16 +- minBy.js | 26 ++-- multiply.js | 8 +- negate.js | 12 +- nth.js | 16 +- nthArg.js | 18 +-- once.js | 12 +- orderBy.js | 18 +-- over.js | 16 +- overArgs.js | 26 ++-- overEvery.js | 20 +-- overSome.js | 20 +-- pad.js | 32 ++-- padEnd.js | 24 +-- padStart.js | 24 +-- parseInt.js | 20 +-- partition.js | 10 +- pick.js | 10 +- pickBy.js | 18 +-- property.js | 18 +-- propertyOf.js | 16 +- pull.js | 12 +- pullAll.js | 12 +- pullAllBy.js | 12 +- pullAllWith.js | 12 +- pullAt.js | 28 ++-- random.js | 56 +++---- range.js | 20 +-- rangeRight.js | 20 +-- rearg.js | 12 +- reduce.js | 22 +-- reduceRight.js | 18 +-- reject.js | 18 +-- remove.js | 32 ++-- repeat.js | 22 +-- replace.js | 12 +- result.js | 38 ++--- reverse.js | 12 +- round.js | 12 +- sample.js | 12 +- sampleSize.js | 22 +-- set.js | 16 +- setWith.js | 12 +- shuffle.js | 12 +- size.js | 32 ++-- slice.js | 22 +-- snakeCase.js | 12 +- some.js | 16 +- sortedIndex.js | 8 +- sortedIndexBy.js | 10 +- sortedIndexOf.js | 16 +- sortedLastIndex.js | 8 +- sortedLastIndexBy.js | 10 +- sortedLastIndexOf.js | 16 +- sortedUniq.js | 8 +- sortedUniqBy.js | 8 +- split.js | 34 ++--- spread.js | 34 ++--- startCase.js | 14 +- startsWith.js | 24 +-- subtract.js | 8 +- sum.js | 10 +- sumBy.js | 10 +- tail.js | 10 +- take.js | 20 +-- takeRight.js | 24 +-- takeRightWhile.js | 10 +- takeWhile.js | 10 +- template.js | 164 ++++++++++----------- templateSettings.js | 12 +- throttle.js | 26 ++-- times.js | 34 ++--- toArray.js | 46 +++--- toFinite.js | 26 ++-- toInteger.js | 18 +-- toLength.js | 18 +-- toLower.js | 12 +- toNumber.js | 42 +++--- toPath.js | 22 +-- toPlainObject.js | 18 +-- toSafeInteger.js | 18 +-- toString.js | 12 +- toUpper.js | 12 +- transform.js | 44 +++--- trim.js | 38 ++--- trimEnd.js | 32 ++-- trimStart.js | 32 ++-- truncate.js | 88 +++++------ unescape.js | 30 ++-- union.js | 12 +- unionBy.js | 18 +-- unionWith.js | 22 +-- uniq.js | 8 +- uniqBy.js | 8 +- uniqWith.js | 12 +- uniqueId.js | 14 +- unset.js | 20 +-- unzip.js | 30 ++-- unzipWith.js | 18 +-- update.js | 16 +- updateWith.js | 12 +- upperCase.js | 12 +- upperFirst.js | 10 +- values.js | 18 +-- without.js | 10 +- words.js | 22 +-- xor.js | 12 +- xorBy.js | 18 +-- xorWith.js | 22 +-- zip.js | 8 +- zipObject.js | 10 +- zipObjectDeep.js | 10 +- zipWith.js | 14 +- 452 files changed, 4262 insertions(+), 4262 deletions(-) diff --git a/.internal/Hash.js b/.internal/Hash.js index d51f371f46..88bec5e093 100644 --- a/.internal/Hash.js +++ b/.internal/Hash.js @@ -1,5 +1,5 @@ /** Used to stand-in for `undefined` hash values. */ -const HASH_UNDEFINED = '__lodash_hash_undefined__'; +const HASH_UNDEFINED = '__lodash_hash_undefined__' class Hash { @@ -11,13 +11,13 @@ class Hash { * @param {Array} [entries] The key-value pairs to cache. */ constructor(entries) { - let index = -1; - const length = entries == null ? 0 : entries.length; + let index = -1 + const length = entries == null ? 0 : entries.length - this.clear(); + this.clear() while (++index < length) { - const entry = entries[index]; - this.set(entry[0], entry[1]); + const entry = entries[index] + this.set(entry[0], entry[1]) } } @@ -27,8 +27,8 @@ class Hash { * @memberOf Hash */ clear() { - this.__data__ = Object.create(null); - this.size = 0; + this.__data__ = Object.create(null) + this.size = 0 } /** @@ -40,9 +40,9 @@ class Hash { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ delete(key) { - const result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; + const result = this.has(key) && delete this.__data__[key] + this.size -= result ? 1 : 0 + return result } /** @@ -53,9 +53,9 @@ class Hash { * @returns {*} Returns the entry value. */ get(key) { - const data = this.__data__; - const result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; + const data = this.__data__ + const result = data[key] + return result === HASH_UNDEFINED ? undefined : result } /** @@ -66,8 +66,8 @@ class Hash { * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ has(key) { - const data = this.__data__; - return data[key] !== undefined; + const data = this.__data__ + return data[key] !== undefined } /** @@ -79,11 +79,11 @@ class Hash { * @returns {Object} Returns the hash instance. */ set(key, value) { - const data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = value === undefined ? HASH_UNDEFINED : value; - return this; + const data = this.__data__ + this.size += this.has(key) ? 0 : 1 + data[key] = value === undefined ? HASH_UNDEFINED : value + return this } } -export default Hash; +export default Hash diff --git a/.internal/ListCache.js b/.internal/ListCache.js index 03e588d37e..755fb13639 100644 --- a/.internal/ListCache.js +++ b/.internal/ListCache.js @@ -1,7 +1,7 @@ -import assocIndexOf from './assocIndexOf.js'; +import assocIndexOf from './assocIndexOf.js' /** Built-in value references. */ -const splice = Array.prototype.splice; +const splice = Array.prototype.splice class ListCache { @@ -13,13 +13,13 @@ class ListCache { * @param {Array} [entries] The key-value pairs to cache. */ constructor(entries) { - let index = -1; - const length = entries == null ? 0 : entries.length; + let index = -1 + const length = entries == null ? 0 : entries.length - this.clear(); + this.clear() while (++index < length) { - const entry = entries[index]; - this.set(entry[0], entry[1]); + const entry = entries[index] + this.set(entry[0], entry[1]) } } @@ -29,8 +29,8 @@ class ListCache { * @memberOf ListCache */ clear() { - this.__data__ = []; - this.size = 0; + this.__data__ = [] + this.size = 0 } /** @@ -41,20 +41,20 @@ class ListCache { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ delete(key) { - const data = this.__data__; - const index = assocIndexOf(data, key); + const data = this.__data__ + const index = assocIndexOf(data, key) if (index < 0) { - return false; + return false } - const lastIndex = data.length - 1; + const lastIndex = data.length - 1 if (index == lastIndex) { - data.pop(); + data.pop() } else { - splice.call(data, index, 1); + splice.call(data, index, 1) } - --this.size; - return true; + --this.size + return true } /** @@ -65,9 +65,9 @@ class ListCache { * @returns {*} Returns the entry value. */ get(key) { - const data = this.__data__; - const index = assocIndexOf(data, key); - return index < 0 ? undefined : data[index][1]; + const data = this.__data__ + const index = assocIndexOf(data, key) + return index < 0 ? undefined : data[index][1] } /** @@ -78,7 +78,7 @@ class ListCache { * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ has(key) { - return assocIndexOf(this.__data__, key) > -1; + return assocIndexOf(this.__data__, key) > -1 } /** @@ -90,17 +90,17 @@ class ListCache { * @returns {Object} Returns the list cache instance. */ set(key, value) { - const data = this.__data__; - const index = assocIndexOf(data, key); + const data = this.__data__ + const index = assocIndexOf(data, key) if (index < 0) { - ++this.size; - data.push([key, value]); + ++this.size + data.push([key, value]) } else { - data[index][1] = value; + data[index][1] = value } - return this; + return this } } -export default ListCache; +export default ListCache diff --git a/.internal/MapCache.js b/.internal/MapCache.js index 122ae9b24d..0a78682f46 100644 --- a/.internal/MapCache.js +++ b/.internal/MapCache.js @@ -1,6 +1,6 @@ -import Hash from './Hash.js'; -import ListCache from './ListCache.js'; +import Hash from './Hash.js' +import ListCache from './ListCache.js' /** * Gets the data for `map`. @@ -11,10 +11,10 @@ import ListCache from './ListCache.js'; * @returns {*} Returns the map data. */ function getMapData({ __data__ }, key) { - const data = __data__; + const data = __data__ return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; + : data.map } /** @@ -25,10 +25,10 @@ function getMapData({ __data__ }, key) { * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { - const type = typeof value; + const type = typeof value return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') - : (value === null); + : (value === null) } class MapCache { @@ -41,13 +41,13 @@ class MapCache { * @param {Array} [entries] The key-value pairs to cache. */ constructor(entries) { - let index = -1; - const length = entries == null ? 0 : entries.length; + let index = -1 + const length = entries == null ? 0 : entries.length - this.clear(); + this.clear() while (++index < length) { - const entry = entries[index]; - this.set(entry[0], entry[1]); + const entry = entries[index] + this.set(entry[0], entry[1]) } } @@ -57,12 +57,12 @@ class MapCache { * @memberOf MapCache */ clear() { - this.size = 0; + this.size = 0 this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash - }; + } } /** @@ -73,9 +73,9 @@ class MapCache { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ delete(key) { - const result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; + const result = getMapData(this, key)['delete'](key) + this.size -= result ? 1 : 0 + return result } /** @@ -86,7 +86,7 @@ class MapCache { * @returns {*} Returns the entry value. */ get(key) { - return getMapData(this, key).get(key); + return getMapData(this, key).get(key) } /** @@ -97,7 +97,7 @@ class MapCache { * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ has(key) { - return getMapData(this, key).has(key); + return getMapData(this, key).has(key) } /** @@ -109,13 +109,13 @@ class MapCache { * @returns {Object} Returns the map cache instance. */ set(key, value) { - const data = getMapData(this, key); - const size = data.size; + const data = getMapData(this, key) + const size = data.size - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; + data.set(key, value) + this.size += data.size == size ? 0 : 1 + return this } } -export default MapCache; +export default MapCache diff --git a/.internal/SetCache.js b/.internal/SetCache.js index 98545532c7..0c823aec8d 100644 --- a/.internal/SetCache.js +++ b/.internal/SetCache.js @@ -1,7 +1,7 @@ -import MapCache from './MapCache.js'; +import MapCache from './MapCache.js' /** Used to stand-in for `undefined` hash values. */ -const HASH_UNDEFINED = '__lodash_hash_undefined__'; +const HASH_UNDEFINED = '__lodash_hash_undefined__' class SetCache { @@ -13,12 +13,12 @@ class SetCache { * @param {Array} [values] The values to cache. */ constructor(values) { - let index = -1; - const length = values == null ? 0 : values.length; + let index = -1 + const length = values == null ? 0 : values.length - this.__data__ = new MapCache; + this.__data__ = new MapCache while (++index < length) { - this.add(values[index]); + this.add(values[index]) } } @@ -31,8 +31,8 @@ class SetCache { * @returns {Object} Returns the cache instance. */ add(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; + this.__data__.set(value, HASH_UNDEFINED) + return this } /** @@ -43,10 +43,10 @@ class SetCache { * @returns {number} Returns `true` if `value` is found, else `false`. */ has(value) { - return this.__data__.has(value); + return this.__data__.has(value) } } -SetCache.prototype.push = SetCache.prototype.add; +SetCache.prototype.push = SetCache.prototype.add -export default SetCache; +export default SetCache diff --git a/.internal/Stack.js b/.internal/Stack.js index af9e0742e8..e5f4ce94ff 100644 --- a/.internal/Stack.js +++ b/.internal/Stack.js @@ -1,8 +1,8 @@ -import ListCache from './ListCache.js'; -import MapCache from './MapCache.js'; +import ListCache from './ListCache.js' +import MapCache from './MapCache.js' /** Used as the size to enable large array optimizations. */ -const LARGE_ARRAY_SIZE = 200; +const LARGE_ARRAY_SIZE = 200 class Stack { @@ -14,8 +14,8 @@ class Stack { * @param {Array} [entries] The key-value pairs to cache. */ constructor(entries) { - const data = this.__data__ = new ListCache(entries); - this.size = data.size; + const data = this.__data__ = new ListCache(entries) + this.size = data.size } /** @@ -24,8 +24,8 @@ class Stack { * @memberOf Stack */ clear() { - this.__data__ = new ListCache; - this.size = 0; + this.__data__ = new ListCache + this.size = 0 } /** @@ -36,11 +36,11 @@ class Stack { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ delete(key) { - const data = this.__data__; - const result = data['delete'](key); + const data = this.__data__ + const result = data['delete'](key) - this.size = data.size; - return result; + this.size = data.size + return result } /** @@ -51,7 +51,7 @@ class Stack { * @returns {*} Returns the entry value. */ get(key) { - return this.__data__.get(key); + return this.__data__.get(key) } /** @@ -62,7 +62,7 @@ class Stack { * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ has(key) { - return this.__data__.has(key); + return this.__data__.has(key) } /** @@ -74,20 +74,20 @@ class Stack { * @returns {Object} Returns the stack cache instance. */ set(key, value) { - let data = this.__data__; + let data = this.__data__ if (data instanceof ListCache) { - const pairs = data.__data__; + const pairs = data.__data__ if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; + pairs.push([key, value]) + this.size = ++data.size + return this } - data = this.__data__ = new MapCache(pairs); + data = this.__data__ = new MapCache(pairs) } - data.set(key, value); - this.size = data.size; - return this; + data.set(key, value) + this.size = data.size + return this } } -export default Stack; +export default Stack diff --git a/.internal/addMapEntry.js b/.internal/addMapEntry.js index 33f57a259f..34f504d9d4 100644 --- a/.internal/addMapEntry.js +++ b/.internal/addMapEntry.js @@ -8,8 +8,8 @@ */ function addMapEntry(map, pair) { // Don't return `map.set` because it's not chainable in IE 11. - map.set(pair[0], pair[1]); - return map; + map.set(pair[0], pair[1]) + return map } -export default addMapEntry; +export default addMapEntry diff --git a/.internal/addSetEntry.js b/.internal/addSetEntry.js index c02b5ccf71..cfe3474392 100644 --- a/.internal/addSetEntry.js +++ b/.internal/addSetEntry.js @@ -8,8 +8,8 @@ */ function addSetEntry(set, value) { // Don't return `set.add` because it's not chainable in IE 11. - set.add(value); - return set; + set.add(value) + return set } -export default addSetEntry; +export default addSetEntry diff --git a/.internal/apply.js b/.internal/apply.js index a92f5a88c4..45295ac6ee 100644 --- a/.internal/apply.js +++ b/.internal/apply.js @@ -10,12 +10,12 @@ */ function apply(func, thisArg, args) { switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); + case 0: return func.call(thisArg) + case 1: return func.call(thisArg, args[0]) + case 2: return func.call(thisArg, args[0], args[1]) + case 3: return func.call(thisArg, args[0], args[1], args[2]) } - return func.apply(thisArg, args); + return func.apply(thisArg, args) } -export default apply; +export default apply diff --git a/.internal/arrayEach.js b/.internal/arrayEach.js index 64e102b7b6..3fb1db4f32 100644 --- a/.internal/arrayEach.js +++ b/.internal/arrayEach.js @@ -7,15 +7,15 @@ * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { - let index = -1; - const length = array == null ? 0 : array.length; + let index = -1 + const length = array == null ? 0 : array.length while (++index < length) { if (iteratee(array[index], index, array) === false) { - break; + break } } - return array; + return array } -export default arrayEach; +export default arrayEach diff --git a/.internal/arrayEachRight.js b/.internal/arrayEachRight.js index fce2e67bb1..1adf853d9c 100644 --- a/.internal/arrayEachRight.js +++ b/.internal/arrayEachRight.js @@ -7,14 +7,14 @@ * @returns {Array} Returns `array`. */ function arrayEachRight(array, iteratee) { - let length = array == null ? 0 : array.length; + let length = array == null ? 0 : array.length while (length--) { if (iteratee(array[length], length, array) === false) { - break; + break } } - return array; + return array } -export default arrayEachRight; +export default arrayEachRight diff --git a/.internal/arrayEvery.js b/.internal/arrayEvery.js index d1dd7b0040..bc4595483e 100644 --- a/.internal/arrayEvery.js +++ b/.internal/arrayEvery.js @@ -8,15 +8,15 @@ * else `false`. */ function arrayEvery(array, predicate) { - let index = -1; - const length = array == null ? 0 : array.length; + let index = -1 + const length = array == null ? 0 : array.length while (++index < length) { if (!predicate(array[index], index, array)) { - return false; + return false } } - return true; + return true } -export default arrayEvery; +export default arrayEvery diff --git a/.internal/arrayFilter.js b/.internal/arrayFilter.js index 05e6c41e1d..b2bfab18a9 100644 --- a/.internal/arrayFilter.js +++ b/.internal/arrayFilter.js @@ -7,18 +7,18 @@ * @returns {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { - let index = -1; - let resIndex = 0; - const length = array == null ? 0 : array.length; - const result = []; + let index = -1 + let resIndex = 0 + const length = array == null ? 0 : array.length + const result = [] while (++index < length) { - const value = array[index]; + const value = array[index] if (predicate(value, index, array)) { - result[resIndex++] = value; + result[resIndex++] = value } } - return result; + return result } -export default arrayFilter; +export default arrayFilter diff --git a/.internal/arrayIncludes.js b/.internal/arrayIncludes.js index 96a563b340..caec69802e 100644 --- a/.internal/arrayIncludes.js +++ b/.internal/arrayIncludes.js @@ -1,4 +1,4 @@ -import baseIndexOf from './baseIndexOf.js'; +import baseIndexOf from './baseIndexOf.js' /** * A specialized version of `includes` for arrays without support for @@ -10,8 +10,8 @@ import baseIndexOf from './baseIndexOf.js'; * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { - const length = array == null ? 0 : array.length; - return !!length && baseIndexOf(array, value, 0) > -1; + const length = array == null ? 0 : array.length + return !!length && baseIndexOf(array, value, 0) > -1 } -export default arrayIncludes; +export default arrayIncludes diff --git a/.internal/arrayIncludesWith.js b/.internal/arrayIncludesWith.js index 2fb367414c..64c54134a0 100644 --- a/.internal/arrayIncludesWith.js +++ b/.internal/arrayIncludesWith.js @@ -8,15 +8,15 @@ * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { - let index = -1; - const length = array == null ? 0 : array.length; + let index = -1 + const length = array == null ? 0 : array.length while (++index < length) { if (comparator(value, array[index])) { - return true; + return true } } - return false; + return false } -export default arrayIncludesWith; +export default arrayIncludesWith diff --git a/.internal/arrayLikeKeys.js b/.internal/arrayLikeKeys.js index 2f664304b4..f926127c78 100644 --- a/.internal/arrayLikeKeys.js +++ b/.internal/arrayLikeKeys.js @@ -1,11 +1,11 @@ -import baseTimes from './baseTimes.js'; -import isArguments from '../isArguments.js'; -import isBuffer from '../isBuffer.js'; -import isIndex from './isIndex.js'; -import isTypedArray from '../isTypedArray.js'; +import baseTimes from './baseTimes.js' +import isArguments from '../isArguments.js' +import isBuffer from '../isBuffer.js' +import isIndex from './isIndex.js' +import isTypedArray from '../isTypedArray.js' /** Used to check objects for own properties. */ -const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwnProperty = Object.prototype.hasOwnProperty /** * Creates an array of the enumerable property names of the array-like `value`. @@ -16,13 +16,13 @@ const hasOwnProperty = Object.prototype.hasOwnProperty; * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { - const isArr = Array.isArray(value); - const isArg = !isArr && isArguments(value); - const isBuff = !isArr && !isArg && isBuffer(value); - const isType = !isArr && !isArg && !isBuff && isTypedArray(value); - const skipIndexes = isArr || isArg || isBuff || isType; - const result = skipIndexes ? baseTimes(value.length, String) : []; - const length = result.length; + const isArr = Array.isArray(value) + const isArg = !isArr && isArguments(value) + const isBuff = !isArr && !isArg && isBuffer(value) + const isType = !isArr && !isArg && !isBuff && isTypedArray(value) + const skipIndexes = isArr || isArg || isBuff || isType + const result = skipIndexes ? baseTimes(value.length, String) : [] + const length = result.length for (const key in value) { if ((inherited || hasOwnProperty.call(value, key)) && @@ -35,10 +35,10 @@ function arrayLikeKeys(value, inherited) { (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || // Skip index properties. isIndex(key, length)) ))) { - result.push(key); + result.push(key) } } - return result; + return result } -export default arrayLikeKeys; +export default arrayLikeKeys diff --git a/.internal/arrayMap.js b/.internal/arrayMap.js index fff479783d..60f33a953a 100644 --- a/.internal/arrayMap.js +++ b/.internal/arrayMap.js @@ -7,14 +7,14 @@ * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { - let index = -1; - const length = array == null ? 0 : array.length; - const result = Array(length); + let index = -1 + const length = array == null ? 0 : array.length + const result = Array(length) while (++index < length) { - result[index] = iteratee(array[index], index, array); + result[index] = iteratee(array[index], index, array) } - return result; + return result } -export default arrayMap; +export default arrayMap diff --git a/.internal/arrayPush.js b/.internal/arrayPush.js index fec702a093..cd09d83ab8 100644 --- a/.internal/arrayPush.js +++ b/.internal/arrayPush.js @@ -7,14 +7,14 @@ * @returns {Array} Returns `array`. */ function arrayPush(array, values) { - let index = -1; - const length = values.length; - const offset = array.length; + let index = -1 + const length = values.length + const offset = array.length while (++index < length) { - array[offset + index] = values[index]; + array[offset + index] = values[index] } - return array; + return array } -export default arrayPush; +export default arrayPush diff --git a/.internal/arrayReduce.js b/.internal/arrayReduce.js index 70d63df52c..4078f3c2ee 100644 --- a/.internal/arrayReduce.js +++ b/.internal/arrayReduce.js @@ -10,16 +10,16 @@ * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { - let index = -1; - const length = array == null ? 0 : array.length; + let index = -1 + const length = array == null ? 0 : array.length if (initAccum && length) { - accumulator = array[++index]; + accumulator = array[++index] } while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); + accumulator = iteratee(accumulator, array[index], index, array) } - return accumulator; + return accumulator } -export default arrayReduce; +export default arrayReduce diff --git a/.internal/arrayReduceRight.js b/.internal/arrayReduceRight.js index 89a1950293..34406af00a 100644 --- a/.internal/arrayReduceRight.js +++ b/.internal/arrayReduceRight.js @@ -10,14 +10,14 @@ * @returns {*} Returns the accumulated value. */ function arrayReduceRight(array, iteratee, accumulator, initAccum) { - let length = array == null ? 0 : array.length; + let length = array == null ? 0 : array.length if (initAccum && length) { - accumulator = array[--length]; + accumulator = array[--length] } while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); + accumulator = iteratee(accumulator, array[length], length, array) } - return accumulator; + return accumulator } -export default arrayReduceRight; +export default arrayReduceRight diff --git a/.internal/arraySample.js b/.internal/arraySample.js index 15f8a2179d..d2b983e798 100644 --- a/.internal/arraySample.js +++ b/.internal/arraySample.js @@ -1,4 +1,4 @@ -import baseRandom from './baseRandom.js'; +import baseRandom from './baseRandom.js' /** * A specialized version of `sample` for arrays. @@ -8,8 +8,8 @@ import baseRandom from './baseRandom.js'; * @returns {*} Returns the random element. */ function arraySample(array) { - const length = array.length; - return length ? array[baseRandom(0, length - 1)] : undefined; + const length = array.length + return length ? array[baseRandom(0, length - 1)] : undefined } -export default arraySample; +export default arraySample diff --git a/.internal/arraySampleSize.js b/.internal/arraySampleSize.js index ebae24df77..d33052de88 100644 --- a/.internal/arraySampleSize.js +++ b/.internal/arraySampleSize.js @@ -1,6 +1,6 @@ -import baseClamp from './baseClamp.js'; -import copyArray from './copyArray.js'; -import shuffleSelf from './shuffleSelf.js'; +import baseClamp from './baseClamp.js' +import copyArray from './copyArray.js' +import shuffleSelf from './shuffleSelf.js' /** * A specialized version of `sampleSize` for arrays. @@ -11,7 +11,7 @@ import shuffleSelf from './shuffleSelf.js'; * @returns {Array} Returns the random elements. */ function arraySampleSize(array, n) { - return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)) } -export default arraySampleSize; +export default arraySampleSize diff --git a/.internal/arrayShuffle.js b/.internal/arrayShuffle.js index 4c46f8bc31..5792e1043c 100644 --- a/.internal/arrayShuffle.js +++ b/.internal/arrayShuffle.js @@ -1,5 +1,5 @@ -import copyArray from './copyArray.js'; -import shuffleSelf from './shuffleSelf.js'; +import copyArray from './copyArray.js' +import shuffleSelf from './shuffleSelf.js' /** * A specialized version of `shuffle` for arrays. @@ -9,7 +9,7 @@ import shuffleSelf from './shuffleSelf.js'; * @returns {Array} Returns the new shuffled array. */ function arrayShuffle(array) { - return shuffleSelf(copyArray(array)); + return shuffleSelf(copyArray(array)) } -export default arrayShuffle; +export default arrayShuffle diff --git a/.internal/arraySome.js b/.internal/arraySome.js index c6459c2233..33c239de20 100644 --- a/.internal/arraySome.js +++ b/.internal/arraySome.js @@ -8,15 +8,15 @@ * else `false`. */ function arraySome(array, predicate) { - let index = -1; - const length = array == null ? 0 : array.length; + let index = -1 + const length = array == null ? 0 : array.length while (++index < length) { if (predicate(array[index], index, array)) { - return true; + return true } } - return false; + return false } -export default arraySome; +export default arraySome diff --git a/.internal/asciiSize.js b/.internal/asciiSize.js index 9517bdc621..4d12e8c9ef 100644 --- a/.internal/asciiSize.js +++ b/.internal/asciiSize.js @@ -6,7 +6,7 @@ * @returns {number} Returns the string size. */ function asciiSize({ length }) { - return length; + return length } -export default asciiSize; +export default asciiSize diff --git a/.internal/asciiToArray.js b/.internal/asciiToArray.js index 1ab7be69c8..2fc3fd586e 100644 --- a/.internal/asciiToArray.js +++ b/.internal/asciiToArray.js @@ -6,7 +6,7 @@ * @returns {Array} Returns the converted array. */ function asciiToArray(string) { - return string.split(''); + return string.split('') } -export default asciiToArray; +export default asciiToArray diff --git a/.internal/asciiWords.js b/.internal/asciiWords.js index 479f537b6e..c992dfd8b2 100644 --- a/.internal/asciiWords.js +++ b/.internal/asciiWords.js @@ -1,5 +1,5 @@ /** Used to match words composed of alphanumeric characters. */ -const reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; +const reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g /** * Splits an ASCII `string` into an array of its words. @@ -9,7 +9,7 @@ const reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; * @returns {Array} Returns the words of `string`. */ function asciiWords(string) { - return string.match(reAsciiWord) || []; + return string.match(reAsciiWord) || [] } -export default asciiWords; +export default asciiWords diff --git a/.internal/assignMergeValue.js b/.internal/assignMergeValue.js index 72099d788f..8ce656b928 100644 --- a/.internal/assignMergeValue.js +++ b/.internal/assignMergeValue.js @@ -1,5 +1,5 @@ -import baseAssignValue from './baseAssignValue.js'; -import eq from '../eq.js'; +import baseAssignValue from './baseAssignValue.js' +import eq from '../eq.js' /** * This function is like `assignValue` except that it doesn't assign @@ -13,8 +13,8 @@ import eq from '../eq.js'; function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); + baseAssignValue(object, key, value) } } -export default assignMergeValue; +export default assignMergeValue diff --git a/.internal/assignValue.js b/.internal/assignValue.js index 0331eaaa9f..f7d895fa15 100644 --- a/.internal/assignValue.js +++ b/.internal/assignValue.js @@ -1,8 +1,8 @@ -import baseAssignValue from './baseAssignValue.js'; -import eq from '../eq.js'; +import baseAssignValue from './baseAssignValue.js' +import eq from '../eq.js' /** Used to check objects for own properties. */ -const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwnProperty = Object.prototype.hasOwnProperty /** * Assigns `value` to `key` of `object` if the existing value is not equivalent @@ -15,11 +15,11 @@ const hasOwnProperty = Object.prototype.hasOwnProperty; * @param {*} value The value to assign. */ function assignValue(object, key, value) { - const objValue = object[key]; + const objValue = object[key] if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); + baseAssignValue(object, key, value) } } -export default assignValue; +export default assignValue diff --git a/.internal/assocIndexOf.js b/.internal/assocIndexOf.js index 869c99da78..1135b4ffaa 100644 --- a/.internal/assocIndexOf.js +++ b/.internal/assocIndexOf.js @@ -1,4 +1,4 @@ -import eq from '../eq.js'; +import eq from '../eq.js' /** * Gets the index at which the `key` is found in `array` of key-value pairs. @@ -9,13 +9,13 @@ import eq from '../eq.js'; * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { - let length = array.length; + let length = array.length while (length--) { if (eq(array[length][0], key)) { - return length; + return length } } - return -1; + return -1 } -export default assocIndexOf; +export default assocIndexOf diff --git a/.internal/baseAssign.js b/.internal/baseAssign.js index 27f1903808..e27f12a3ad 100644 --- a/.internal/baseAssign.js +++ b/.internal/baseAssign.js @@ -1,5 +1,5 @@ -import copyObject from './copyObject.js'; -import keys from '../keys.js'; +import copyObject from './copyObject.js' +import keys from '../keys.js' /** * The base implementation of `assign` without support for multiple sources @@ -11,7 +11,7 @@ import keys from '../keys.js'; * @returns {Object} Returns `object`. */ function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); + return object && copyObject(source, keys(source), object) } -export default baseAssign; +export default baseAssign diff --git a/.internal/baseAssignIn.js b/.internal/baseAssignIn.js index d3e9be6ad4..c4eb6e1bb6 100644 --- a/.internal/baseAssignIn.js +++ b/.internal/baseAssignIn.js @@ -1,5 +1,5 @@ -import copyObject from './copyObject.js'; -import keysIn from '../keysIn.js'; +import copyObject from './copyObject.js' +import keysIn from '../keysIn.js' /** * The base implementation of `assignIn` without support for multiple sources @@ -11,7 +11,7 @@ import keysIn from '../keysIn.js'; * @returns {Object} Returns `object`. */ function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); + return object && copyObject(source, keysIn(source), object) } -export default baseAssignIn; +export default baseAssignIn diff --git a/.internal/baseAssignValue.js b/.internal/baseAssignValue.js index ccdfdac9b4..7b630c321b 100644 --- a/.internal/baseAssignValue.js +++ b/.internal/baseAssignValue.js @@ -14,10 +14,10 @@ function baseAssignValue(object, key, value) { 'enumerable': true, 'value': value, 'writable': true - }); + }) } else { - object[key] = value; + object[key] = value } } -export default baseAssignValue; +export default baseAssignValue diff --git a/.internal/baseAt.js b/.internal/baseAt.js index d664bf9164..9e2f13b5c0 100644 --- a/.internal/baseAt.js +++ b/.internal/baseAt.js @@ -1,4 +1,4 @@ -import get from '../get.js'; +import get from '../get.js' /** * The base implementation of `at` without support for individual paths. @@ -9,15 +9,15 @@ import get from '../get.js'; * @returns {Array} Returns the picked elements. */ function baseAt(object, paths) { - let index = -1; - const length = paths.length; - const result = Array(length); - const skip = object == null; + let index = -1 + const length = paths.length + const result = Array(length) + const skip = object == null while (++index < length) { - result[index] = skip ? undefined : get(object, paths[index]); + result[index] = skip ? undefined : get(object, paths[index]) } - return result; + return result } -export default baseAt; +export default baseAt diff --git a/.internal/baseClamp.js b/.internal/baseClamp.js index 286533d558..f6e7e7ded1 100644 --- a/.internal/baseClamp.js +++ b/.internal/baseClamp.js @@ -9,10 +9,10 @@ */ function baseClamp(number, lower, upper) { if (number === number) { - number = number <= upper ? number : upper; - number = number >= lower ? number : lower; + number = number <= upper ? number : upper + number = number >= lower ? number : lower } - return number; + return number } -export default baseClamp; +export default baseClamp diff --git a/.internal/baseClone.js b/.internal/baseClone.js index 392b90572e..3307fda501 100644 --- a/.internal/baseClone.js +++ b/.internal/baseClone.js @@ -1,67 +1,67 @@ -import Stack from './Stack.js'; -import arrayEach from './arrayEach.js'; -import assignValue from './assignValue.js'; -import baseAssign from './baseAssign.js'; -import baseAssignIn from './baseAssignIn.js'; -import baseCreate from './baseCreate.js'; -import cloneBuffer from './cloneBuffer.js'; -import copyArray from './copyArray.js'; -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'; -import copySymbols from './copySymbols.js'; -import copySymbolsIn from './copySymbolsIn.js'; -import getAllKeys from './getAllKeys.js'; -import getAllKeysIn from './getAllKeysIn.js'; -import getTag from './getTag.js'; -import initCloneArray from './initCloneArray.js'; -import initCloneByTag from './initCloneByTag.js'; -import initCloneObject from './initCloneObject.js'; -import isBuffer from '../isBuffer.js'; -import isObject from '../isObject.js'; -import isPrototype from './isPrototype.js'; -import keys from '../keys.js'; +import Stack from './Stack.js' +import arrayEach from './arrayEach.js' +import assignValue from './assignValue.js' +import baseAssign from './baseAssign.js' +import baseAssignIn from './baseAssignIn.js' +import baseCreate from './baseCreate.js' +import cloneBuffer from './cloneBuffer.js' +import copyArray from './copyArray.js' +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' +import copySymbols from './copySymbols.js' +import copySymbolsIn from './copySymbolsIn.js' +import getAllKeys from './getAllKeys.js' +import getAllKeysIn from './getAllKeysIn.js' +import getTag from './getTag.js' +import initCloneArray from './initCloneArray.js' +import initCloneByTag from './initCloneByTag.js' +import initCloneObject from './initCloneObject.js' +import isBuffer from '../isBuffer.js' +import isObject from '../isObject.js' +import isPrototype from './isPrototype.js' +import keys from '../keys.js' /** Used to compose bitmasks for cloning. */ -const CLONE_DEEP_FLAG = 1; -const CLONE_FLAT_FLAG = 2; -const CLONE_SYMBOLS_FLAG = 4; +const CLONE_DEEP_FLAG = 1 +const CLONE_FLAT_FLAG = 2 +const CLONE_SYMBOLS_FLAG = 4 /** `Object#toString` result references. */ -const argsTag = '[object Arguments]'; -const arrayTag = '[object Array]'; -const boolTag = '[object Boolean]'; -const dateTag = '[object Date]'; -const errorTag = '[object Error]'; -const funcTag = '[object Function]'; -const genTag = '[object GeneratorFunction]'; -const mapTag = '[object Map]'; -const numberTag = '[object Number]'; -const objectTag = '[object Object]'; -const regexpTag = '[object RegExp]'; -const setTag = '[object Set]'; -const stringTag = '[object String]'; -const symbolTag = '[object Symbol]'; -const weakMapTag = '[object WeakMap]'; - -const arrayBufferTag = '[object ArrayBuffer]'; -const dataViewTag = '[object DataView]'; -const float32Tag = '[object Float32Array]'; -const float64Tag = '[object Float64Array]'; -const int8Tag = '[object Int8Array]'; -const int16Tag = '[object Int16Array]'; -const int32Tag = '[object Int32Array]'; -const uint8Tag = '[object Uint8Array]'; -const uint8ClampedTag = '[object Uint8ClampedArray]'; -const uint16Tag = '[object Uint16Array]'; -const uint32Tag = '[object Uint32Array]'; +const argsTag = '[object Arguments]' +const arrayTag = '[object Array]' +const boolTag = '[object Boolean]' +const dateTag = '[object Date]' +const errorTag = '[object Error]' +const funcTag = '[object Function]' +const genTag = '[object GeneratorFunction]' +const mapTag = '[object Map]' +const numberTag = '[object Number]' +const objectTag = '[object Object]' +const regexpTag = '[object RegExp]' +const setTag = '[object Set]' +const stringTag = '[object String]' +const symbolTag = '[object Symbol]' +const weakMapTag = '[object WeakMap]' + +const arrayBufferTag = '[object ArrayBuffer]' +const dataViewTag = '[object DataView]' +const float32Tag = '[object Float32Array]' +const float64Tag = '[object Float64Array]' +const int8Tag = '[object Int8Array]' +const int16Tag = '[object Int16Array]' +const int32Tag = '[object Int32Array]' +const uint8Tag = '[object Uint8Array]' +const uint8ClampedTag = '[object Uint8ClampedArray]' +const uint16Tag = '[object Uint16Array]' +const uint32Tag = '[object Uint32Array]' /** Used to identify `toStringTag` values supported by `clone`. */ -const cloneableTags = {}; +const cloneableTags = {} cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = @@ -72,12 +72,12 @@ cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = -cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; +cloneableTags[weakMapTag] = false /** Used to check objects for own properties. */ -const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwnProperty = Object.prototype.hasOwnProperty /** * Initializes an object clone. @@ -89,7 +89,7 @@ const hasOwnProperty = Object.prototype.hasOwnProperty; function initCloneObject(object) { return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(Object.getPrototypeOf(object)) - : {}; + : {} } /** @@ -106,38 +106,38 @@ function initCloneObject(object) { * @returns {Object} Returns the initialized clone. */ function initCloneByTag(object, tag, cloneFunc, isDeep) { - const Ctor = object.constructor; + const Ctor = object.constructor switch (tag) { case arrayBufferTag: - return cloneArrayBuffer(object); + return cloneArrayBuffer(object) case boolTag: case dateTag: - return new Ctor(+object); + return new Ctor(+object) case dataViewTag: - return cloneDataView(object, isDeep); + return cloneDataView(object, isDeep) case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); + return cloneTypedArray(object, isDeep) case mapTag: - return cloneMap(object, isDeep, cloneFunc); + return cloneMap(object, isDeep, cloneFunc) case numberTag: case stringTag: - return new Ctor(object); + return new Ctor(object) case regexpTag: - return cloneRegExp(object); + return cloneRegExp(object) case setTag: - return cloneSet(object, isDeep, cloneFunc); + return cloneSet(object, isDeep, cloneFunc) case symbolTag: - return cloneSymbol(object); + return cloneSymbol(object) } } @@ -149,15 +149,15 @@ function initCloneByTag(object, tag, cloneFunc, isDeep) { * @returns {Array} Returns the initialized clone. */ function initCloneArray(array) { - const length = array.length; - const result = array.constructor(length); + const length = array.length + const result = array.constructor(length) // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; + result.index = array.index + result.input = array.input } - return result; + return result } /** @@ -177,69 +177,69 @@ function initCloneArray(array) { * @returns {*} Returns the cloned value. */ function baseClone(value, bitmask, customizer, key, object, stack) { - let result; - const isDeep = bitmask & CLONE_DEEP_FLAG; - const isFlat = bitmask & CLONE_FLAT_FLAG; - const isFull = bitmask & CLONE_SYMBOLS_FLAG; + let result + const isDeep = bitmask & CLONE_DEEP_FLAG + const isFlat = bitmask & CLONE_FLAT_FLAG + const isFull = bitmask & CLONE_SYMBOLS_FLAG if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); + result = object ? customizer(value, key, object, stack) : customizer(value) } if (result !== undefined) { - return result; + return result } if (!isObject(value)) { - return value; + return value } - const isArr = Array.isArray(value); + const isArr = Array.isArray(value) if (isArr) { - result = initCloneArray(value); + result = initCloneArray(value) if (!isDeep) { - return copyArray(value, result); + return copyArray(value, result) } } else { - const tag = getTag(value); - const isFunc = tag == funcTag || tag == genTag; + const tag = getTag(value) + const isFunc = tag == funcTag || tag == genTag if (isBuffer(value)) { - return cloneBuffer(value, isDeep); + return cloneBuffer(value, isDeep) } if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); + result = (isFlat || isFunc) ? {} : initCloneObject(value) if (!isDeep) { return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); + : copySymbols(value, baseAssign(result, value)) } } else { if (!cloneableTags[tag]) { - return object ? value : {}; + return object ? value : {} } - result = initCloneByTag(value, tag, baseClone, isDeep); + result = initCloneByTag(value, tag, baseClone, isDeep) } } // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - const stacked = stack.get(value); + stack || (stack = new Stack) + const stacked = stack.get(value) if (stacked) { - return stacked; + return stacked } - stack.set(value, result); + stack.set(value, result) const keysFunc = isFull ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); + : (isFlat ? keysIn : keys) - const props = isArr ? undefined : keysFunc(value); + const props = isArr ? undefined : keysFunc(value) arrayEach(props || value, (subValue, key) => { if (props) { - key = subValue; - subValue = value[key]; + key = subValue + subValue = value[key] } // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)) + }) + return result } -export default baseClone; +export default baseClone diff --git a/.internal/baseConforms.js b/.internal/baseConforms.js index 47ddb2a1b9..53e2fd54f7 100644 --- a/.internal/baseConforms.js +++ b/.internal/baseConforms.js @@ -1,5 +1,5 @@ -import baseConformsTo from './baseConformsTo.js'; -import keys from '../keys.js'; +import baseConformsTo from './baseConformsTo.js' +import keys from '../keys.js' /** * The base implementation of `conforms` which doesn't clone `source`. @@ -9,8 +9,8 @@ import keys from '../keys.js'; * @returns {Function} Returns the new spec function. */ function baseConforms(source) { - const props = keys(source); - return object => baseConformsTo(object, source, props); + const props = keys(source) + return object => baseConformsTo(object, source, props) } -export default baseConforms; +export default baseConforms diff --git a/.internal/baseConformsTo.js b/.internal/baseConformsTo.js index 7f5c61af7d..8569bbd218 100644 --- a/.internal/baseConformsTo.js +++ b/.internal/baseConformsTo.js @@ -7,21 +7,21 @@ * @returns {boolean} Returns `true` if `object` conforms, else `false`. */ function baseConformsTo(object, source, props) { - let length = props.length; + let length = props.length if (object == null) { - return !length; + return !length } - object = Object(object); + object = Object(object) while (length--) { - const key = props[length]; - const predicate = source[key]; - const value = object[key]; + const key = props[length] + const predicate = source[key] + const value = object[key] if ((value === undefined && !(key in object)) || !predicate(value)) { - return false; + return false } } - return true; + return true } -export default baseConformsTo; +export default baseConformsTo diff --git a/.internal/baseCreate.js b/.internal/baseCreate.js index 04f70d783c..30b6a728c5 100644 --- a/.internal/baseCreate.js +++ b/.internal/baseCreate.js @@ -1,4 +1,4 @@ -import isObject from '../isObject.js'; +import isObject from '../isObject.js' /** * The base implementation of `create` without support for assigning @@ -9,7 +9,7 @@ import isObject from '../isObject.js'; * @returns {Object} Returns the new object. */ function baseCreate(proto) { - return isObject(proto) ? Object.create(proto) : {}; + return isObject(proto) ? Object.create(proto) : {} } -export default baseCreate; +export default baseCreate diff --git a/.internal/baseDifference.js b/.internal/baseDifference.js index a600512f69..f68a09895a 100644 --- a/.internal/baseDifference.js +++ b/.internal/baseDifference.js @@ -1,11 +1,11 @@ -import SetCache from './SetCache.js'; -import arrayIncludes from './arrayIncludes.js'; -import arrayIncludesWith from './arrayIncludesWith.js'; -import arrayMap from './arrayMap.js'; -import cacheHas from './cacheHas.js'; +import SetCache from './SetCache.js' +import arrayIncludes from './arrayIncludes.js' +import arrayIncludesWith from './arrayIncludesWith.js' +import arrayMap from './arrayMap.js' +import cacheHas from './cacheHas.js' /** Used as the size to enable large array optimizations. */ -const LARGE_ARRAY_SIZE = 200; +const LARGE_ARRAY_SIZE = 200 /** * The base implementation of methods like `difference` without support @@ -19,48 +19,48 @@ const LARGE_ARRAY_SIZE = 200; * @returns {Array} Returns the new array of filtered values. */ function baseDifference(array, values, iteratee, comparator) { - let index = -1; - let includes = arrayIncludes; - let isCommon = true; - const length = array.length; - const result = []; - const valuesLength = values.length; + let index = -1 + let includes = arrayIncludes + let isCommon = true + const length = array.length + const result = [] + const valuesLength = values.length if (!length) { - return result; + return result } if (iteratee) { - values = arrayMap(values, value => iteratee(value)); + values = arrayMap(values, value => iteratee(value)) } if (comparator) { - includes = arrayIncludesWith; - isCommon = false; + includes = arrayIncludesWith + isCommon = false } else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); + includes = cacheHas + isCommon = false + values = new SetCache(values) } outer: while (++index < length) { - let value = array[index]; - const computed = iteratee == null ? value : iteratee(value); + let value = array[index] + const computed = iteratee == null ? value : iteratee(value) - value = (comparator || value !== 0) ? value : 0; + value = (comparator || value !== 0) ? value : 0 if (isCommon && computed === computed) { - let valuesIndex = valuesLength; + let valuesIndex = valuesLength while (valuesIndex--) { if (values[valuesIndex] === computed) { - continue outer; + continue outer } } - result.push(value); + result.push(value) } else if (!includes(values, computed, comparator)) { - result.push(value); + result.push(value) } } - return result; + return result } -export default baseDifference; +export default baseDifference diff --git a/.internal/baseEach.js b/.internal/baseEach.js index 3ba751ca93..88159f4b09 100644 --- a/.internal/baseEach.js +++ b/.internal/baseEach.js @@ -1,5 +1,5 @@ -import baseForOwn from './baseForOwn.js'; -import createBaseEach from './createBaseEach.js'; +import baseForOwn from './baseForOwn.js' +import createBaseEach from './createBaseEach.js' /** * The base implementation of `forEach`. @@ -9,6 +9,6 @@ import createBaseEach from './createBaseEach.js'; * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ -const baseEach = createBaseEach(baseForOwn); +const baseEach = createBaseEach(baseForOwn) -export default baseEach; +export default baseEach diff --git a/.internal/baseEachRight.js b/.internal/baseEachRight.js index 4c70df0076..a034067a10 100644 --- a/.internal/baseEachRight.js +++ b/.internal/baseEachRight.js @@ -1,5 +1,5 @@ -import baseForOwnRight from './baseForOwnRight.js'; -import createBaseEach from './createBaseEach.js'; +import baseForOwnRight from './baseForOwnRight.js' +import createBaseEach from './createBaseEach.js' /** * The base implementation of `forEachRight`. @@ -9,6 +9,6 @@ import createBaseEach from './createBaseEach.js'; * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ -const baseEachRight = createBaseEach(baseForOwnRight, true); +const baseEachRight = createBaseEach(baseForOwnRight, true) -export default baseEachRight; +export default baseEachRight diff --git a/.internal/baseEvery.js b/.internal/baseEvery.js index 87d26bfbd5..3ff0cf1fb8 100644 --- a/.internal/baseEvery.js +++ b/.internal/baseEvery.js @@ -1,4 +1,4 @@ -import baseEach from './baseEach.js'; +import baseEach from './baseEach.js' /** * The base implementation of `every`. @@ -10,12 +10,12 @@ import baseEach from './baseEach.js'; * else `false` */ function baseEvery(collection, predicate) { - let result = true; + let result = true baseEach(collection, (value, index, collection) => { - result = !!predicate(value, index, collection); - return result; - }); - return result; + result = !!predicate(value, index, collection) + return result + }) + return result } -export default baseEvery; +export default baseEvery diff --git a/.internal/baseFill.js b/.internal/baseFill.js index 36248d54e9..9ea5510acb 100644 --- a/.internal/baseFill.js +++ b/.internal/baseFill.js @@ -1,5 +1,5 @@ -import toInteger from '../toInteger.js'; -import toLength from '../toLength.js'; +import toInteger from '../toInteger.js' +import toLength from '../toLength.js' /** * The base implementation of `fill` without an iteratee call guard. @@ -12,21 +12,21 @@ import toLength from '../toLength.js'; * @returns {Array} Returns `array`. */ function baseFill(array, value, start, end) { - const length = array.length; + const length = array.length - start = toInteger(start); + start = toInteger(start) if (start < 0) { - start = -start > length ? 0 : (length + start); + start = -start > length ? 0 : (length + start) } - end = (end === undefined || end > length) ? length : toInteger(end); + end = (end === undefined || end > length) ? length : toInteger(end) if (end < 0) { - end += length; + end += length } - end = start > end ? 0 : toLength(end); + end = start > end ? 0 : toLength(end) while (start < end) { - array[start++] = value; + array[start++] = value } - return array; + return array } -export default baseFill; +export default baseFill diff --git a/.internal/baseFilter.js b/.internal/baseFilter.js index 5149d5e527..68b2047086 100644 --- a/.internal/baseFilter.js +++ b/.internal/baseFilter.js @@ -1,4 +1,4 @@ -import baseEach from './baseEach.js'; +import baseEach from './baseEach.js' /** * The base implementation of `filter`. @@ -9,13 +9,13 @@ import baseEach from './baseEach.js'; * @returns {Array} Returns the new filtered array. */ function baseFilter(collection, predicate) { - const result = []; + const result = [] baseEach(collection, (value, index, collection) => { if (predicate(value, index, collection)) { - result.push(value); + result.push(value) } - }); - return result; + }) + return result } -export default baseFilter; +export default baseFilter diff --git a/.internal/baseFindIndex.js b/.internal/baseFindIndex.js index 59e66a2bbf..1dc0217745 100644 --- a/.internal/baseFindIndex.js +++ b/.internal/baseFindIndex.js @@ -9,15 +9,15 @@ * @returns {number} Returns the index of the matched value, else `-1`. */ function baseFindIndex(array, predicate, fromIndex, fromRight) { - const length = array.length; - let index = fromIndex + (fromRight ? 1 : -1); + const length = array.length + let index = fromIndex + (fromRight ? 1 : -1) while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { - return index; + return index } } - return -1; + return -1 } -export default baseFindIndex; +export default baseFindIndex diff --git a/.internal/baseFindKey.js b/.internal/baseFindKey.js index 5fed9ba27e..4374ce8b2d 100644 --- a/.internal/baseFindKey.js +++ b/.internal/baseFindKey.js @@ -9,14 +9,14 @@ * @returns {*} Returns the found element or its key, else `undefined`. */ function baseFindKey(collection, predicate, eachFunc) { - let result; + let result eachFunc(collection, (value, key, collection) => { if (predicate(value, key, collection)) { - result = key; - return false; + result = key + return false } - }); - return result; + }) + return result } -export default baseFindKey; +export default baseFindKey diff --git a/.internal/baseFlatten.js b/.internal/baseFlatten.js index 6386ab2a80..37e8bf124e 100644 --- a/.internal/baseFlatten.js +++ b/.internal/baseFlatten.js @@ -1,5 +1,5 @@ -import arrayPush from './arrayPush.js'; -import isFlattenable from './isFlattenable.js'; +import arrayPush from './arrayPush.js' +import isFlattenable from './isFlattenable.js' /** * The base implementation of `flatten` with support for restricting flattening. @@ -13,26 +13,26 @@ import isFlattenable from './isFlattenable.js'; * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, depth, predicate, isStrict, result) { - let index = -1; - const length = array.length; + let index = -1 + const length = array.length - predicate || (predicate = isFlattenable); - result || (result = []); + predicate || (predicate = isFlattenable) + result || (result = []) while (++index < length) { - const value = array[index]; + const value = array[index] if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); + baseFlatten(value, depth - 1, predicate, isStrict, result) } else { - arrayPush(result, value); + arrayPush(result, value) } } else if (!isStrict) { - result[result.length] = value; + result[result.length] = value } } - return result; + return result } -export default baseFlatten; +export default baseFlatten diff --git a/.internal/baseFor.js b/.internal/baseFor.js index e7c00782fb..4a9d98fb2e 100644 --- a/.internal/baseFor.js +++ b/.internal/baseFor.js @@ -1,4 +1,4 @@ -import createBaseFor from './createBaseFor.js'; +import createBaseFor from './createBaseFor.js' /** * The base implementation of `baseForOwn` which iterates over `object` @@ -11,6 +11,6 @@ import createBaseFor from './createBaseFor.js'; * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ -const baseFor = createBaseFor(); +const baseFor = createBaseFor() -export default baseFor; +export default baseFor diff --git a/.internal/baseForOwn.js b/.internal/baseForOwn.js index 7fd08514c1..8476037884 100644 --- a/.internal/baseForOwn.js +++ b/.internal/baseForOwn.js @@ -1,5 +1,5 @@ -import baseFor from './baseFor.js'; -import keys from '../keys.js'; +import baseFor from './baseFor.js' +import keys from '../keys.js' /** * The base implementation of `forOwn`. @@ -10,7 +10,7 @@ import keys from '../keys.js'; * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); + return object && baseFor(object, iteratee, keys) } -export default baseForOwn; +export default baseForOwn diff --git a/.internal/baseForOwnRight.js b/.internal/baseForOwnRight.js index 4b8d5eeb26..b94a053724 100644 --- a/.internal/baseForOwnRight.js +++ b/.internal/baseForOwnRight.js @@ -1,5 +1,5 @@ -import baseForRight from './baseForRight.js'; -import keys from '../keys.js'; +import baseForRight from './baseForRight.js' +import keys from '../keys.js' /** * The base implementation of `forOwnRight`. @@ -10,7 +10,7 @@ import keys from '../keys.js'; * @returns {Object} Returns `object`. */ function baseForOwnRight(object, iteratee) { - return object && baseForRight(object, iteratee, keys); + return object && baseForRight(object, iteratee, keys) } -export default baseForOwnRight; +export default baseForOwnRight diff --git a/.internal/baseForRight.js b/.internal/baseForRight.js index 9bcbcd3a20..1defce1991 100644 --- a/.internal/baseForRight.js +++ b/.internal/baseForRight.js @@ -1,4 +1,4 @@ -import createBaseFor from './createBaseFor.js'; +import createBaseFor from './createBaseFor.js' /** * This function is like `baseFor` except that it iterates over properties @@ -10,6 +10,6 @@ import createBaseFor from './createBaseFor.js'; * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ -const baseForRight = createBaseFor(true); +const baseForRight = createBaseFor(true) -export default baseForRight; +export default baseForRight diff --git a/.internal/baseFunctions.js b/.internal/baseFunctions.js index 215345f818..bf67e48503 100644 --- a/.internal/baseFunctions.js +++ b/.internal/baseFunctions.js @@ -1,5 +1,5 @@ -import arrayFilter from './arrayFilter.js'; -import isFunction from '../isFunction.js'; +import arrayFilter from './arrayFilter.js' +import isFunction from '../isFunction.js' /** * The base implementation of `functions` which creates an array of @@ -11,7 +11,7 @@ import isFunction from '../isFunction.js'; * @returns {Array} Returns the function names. */ function baseFunctions(object, props) { - return arrayFilter(props, key => isFunction(object[key])); + return arrayFilter(props, key => isFunction(object[key])) } -export default baseFunctions; +export default baseFunctions diff --git a/.internal/baseGet.js b/.internal/baseGet.js index 315fdf810b..d0bc3d43ca 100644 --- a/.internal/baseGet.js +++ b/.internal/baseGet.js @@ -1,5 +1,5 @@ -import castPath from './castPath.js'; -import toKey from './toKey.js'; +import castPath from './castPath.js' +import toKey from './toKey.js' /** * The base implementation of `get` without support for default values. @@ -10,15 +10,15 @@ import toKey from './toKey.js'; * @returns {*} Returns the resolved value. */ function baseGet(object, path) { - path = castPath(path, object); + path = castPath(path, object) - let index = 0; - const length = path.length; + let index = 0 + const length = path.length while (object != null && index < length) { - object = object[toKey(path[index++])]; + object = object[toKey(path[index++])] } - return (index && index == length) ? object : undefined; + return (index && index == length) ? object : undefined } -export default baseGet; +export default baseGet diff --git a/.internal/baseGetTag.js b/.internal/baseGetTag.js index 8cce468f5d..75c77f1e1d 100644 --- a/.internal/baseGetTag.js +++ b/.internal/baseGetTag.js @@ -1,12 +1,12 @@ -import getRawTag from './getRawTag.js'; -import objectToString from './objectToString.js'; +import getRawTag from './getRawTag.js' +import objectToString from './objectToString.js' /** `Object#toString` result references. */ -const nullTag = '[object Null]'; -const undefinedTag = '[object Undefined]'; +const nullTag = '[object Null]' +const undefinedTag = '[object Undefined]' /** Built-in value references. */ -const symToStringTag = Symbol ? Symbol.toStringTag : undefined; +const symToStringTag = Symbol ? Symbol.toStringTag : undefined /** * The base implementation of `getTag` without fallbacks for buggy environments. @@ -17,11 +17,11 @@ const symToStringTag = Symbol ? Symbol.toStringTag : undefined; */ function baseGetTag(value) { if (value == null) { - return value === undefined ? undefinedTag : nullTag; + return value === undefined ? undefinedTag : nullTag } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) - : objectToString(value); + : objectToString(value) } -export default baseGetTag; +export default baseGetTag diff --git a/.internal/baseHas.js b/.internal/baseHas.js index e47fd26fb7..3bd6d0603f 100644 --- a/.internal/baseHas.js +++ b/.internal/baseHas.js @@ -1,5 +1,5 @@ /** Used to check objects for own properties. */ -const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwnProperty = Object.prototype.hasOwnProperty /** * The base implementation of `has` without support for deep paths. @@ -10,7 +10,7 @@ const hasOwnProperty = Object.prototype.hasOwnProperty; * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { - return object != null && hasOwnProperty.call(object, key); + return object != null && hasOwnProperty.call(object, key) } -export default baseHas; +export default baseHas diff --git a/.internal/baseHasIn.js b/.internal/baseHasIn.js index e456040c02..f98fd8c8ab 100644 --- a/.internal/baseHasIn.js +++ b/.internal/baseHasIn.js @@ -7,7 +7,7 @@ * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHasIn(object, key) { - return object != null && key in Object(object); + return object != null && key in Object(object) } -export default baseHasIn; +export default baseHasIn diff --git a/.internal/baseInRange.js b/.internal/baseInRange.js index fa922d56d2..0d266ea535 100644 --- a/.internal/baseInRange.js +++ b/.internal/baseInRange.js @@ -1,6 +1,6 @@ /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeMax = Math.max; -const nativeMin = Math.min; +const nativeMax = Math.max +const nativeMin = Math.min /** * The base implementation of `inRange` which doesn't coerce arguments. @@ -12,7 +12,7 @@ const nativeMin = Math.min; * @returns {boolean} Returns `true` if `number` is in the range, else `false`. */ function baseInRange(number, start, end) { - return number >= nativeMin(start, end) && number < nativeMax(start, end); + return number >= nativeMin(start, end) && number < nativeMax(start, end) } -export default baseInRange; +export default baseInRange diff --git a/.internal/baseIndexOf.js b/.internal/baseIndexOf.js index 8fab577990..0566354c9c 100644 --- a/.internal/baseIndexOf.js +++ b/.internal/baseIndexOf.js @@ -1,6 +1,6 @@ -import baseFindIndex from './baseFindIndex.js'; -import baseIsNaN from './baseIsNaN.js'; -import strictIndexOf from './strictIndexOf.js'; +import baseFindIndex from './baseFindIndex.js' +import baseIsNaN from './baseIsNaN.js' +import strictIndexOf from './strictIndexOf.js' /** * The base implementation of `indexOf` without `fromIndex` bounds checks. @@ -14,7 +14,7 @@ import strictIndexOf from './strictIndexOf.js'; function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); + : baseFindIndex(array, baseIsNaN, fromIndex) } -export default baseIndexOf; +export default baseIndexOf diff --git a/.internal/baseIndexOfWith.js b/.internal/baseIndexOfWith.js index f1a2206d8f..bd62504d4c 100644 --- a/.internal/baseIndexOfWith.js +++ b/.internal/baseIndexOfWith.js @@ -9,15 +9,15 @@ * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOfWith(array, value, fromIndex, comparator) { - let index = fromIndex - 1; - const length = array.length; + let index = fromIndex - 1 + const length = array.length while (++index < length) { if (comparator(array[index], value)) { - return index; + return index } } - return -1; + return -1 } -export default baseIndexOfWith; +export default baseIndexOfWith diff --git a/.internal/baseIntersection.js b/.internal/baseIntersection.js index d4763a4782..52cefd2dff 100644 --- a/.internal/baseIntersection.js +++ b/.internal/baseIntersection.js @@ -1,11 +1,11 @@ -import SetCache from './SetCache.js'; -import arrayIncludes from './arrayIncludes.js'; -import arrayIncludesWith from './arrayIncludesWith.js'; -import arrayMap from './arrayMap.js'; -import cacheHas from './cacheHas.js'; +import SetCache from './SetCache.js' +import arrayIncludes from './arrayIncludes.js' +import arrayIncludesWith from './arrayIncludesWith.js' +import arrayMap from './arrayMap.js' +import cacheHas from './cacheHas.js' /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeMin = Math.min; +const nativeMin = Math.min /** * The base implementation of methods like `intersection` that accepts an @@ -18,58 +18,58 @@ const nativeMin = Math.min; * @returns {Array} Returns the new array of shared values. */ function baseIntersection(arrays, iteratee, comparator) { - const includes = comparator ? arrayIncludesWith : arrayIncludes; - const length = arrays[0].length; - const othLength = arrays.length; - const caches = Array(othLength); - const result = []; + const includes = comparator ? arrayIncludesWith : arrayIncludes + const length = arrays[0].length + const othLength = arrays.length + const caches = Array(othLength) + const result = [] - let array; - let maxLength = Infinity; - let othIndex = othLength; + let array + let maxLength = Infinity + let othIndex = othLength while (othIndex--) { - array = arrays[othIndex]; + array = arrays[othIndex] if (othIndex && iteratee) { - array = arrayMap(array, valye => iteratee(value)); + array = arrayMap(array, valye => iteratee(value)) } - maxLength = nativeMin(array.length, maxLength); + maxLength = nativeMin(array.length, maxLength) caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) ? new SetCache(othIndex && array) - : undefined; + : undefined } - array = arrays[0]; + array = arrays[0] - let index = -1; - const seen = caches[0]; + let index = -1 + const seen = caches[0] outer: while (++index < length && result.length < maxLength) { - let value = array[index]; - const computed = iteratee ? iteratee(value) : value; + let value = array[index] + const computed = iteratee ? iteratee(value) : value - value = (comparator || value !== 0) ? value : 0; + value = (comparator || value !== 0) ? value : 0 if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator) )) { - othIndex = othLength; + othIndex = othLength while (--othIndex) { - const cache = caches[othIndex]; + const cache = caches[othIndex] if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator)) ) { - continue outer; + continue outer } } if (seen) { - seen.push(computed); + seen.push(computed) } - result.push(value); + result.push(value) } } - return result; + return result } -export default baseIntersection; +export default baseIntersection diff --git a/.internal/baseIsEqual.js b/.internal/baseIsEqual.js index c1e7270c35..58b2a45133 100644 --- a/.internal/baseIsEqual.js +++ b/.internal/baseIsEqual.js @@ -1,5 +1,5 @@ -import baseIsEqualDeep from './baseIsEqualDeep.js'; -import isObjectLike from '../isObjectLike.js'; +import baseIsEqualDeep from './baseIsEqualDeep.js' +import isObjectLike from '../isObjectLike.js' /** * The base implementation of `isEqual` which supports partial comparisons @@ -17,12 +17,12 @@ import isObjectLike from '../isObjectLike.js'; */ function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { - return true; + return true } if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { - return value !== value && other !== other; + return value !== value && other !== other } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack) } -export default baseIsEqual; +export default baseIsEqual diff --git a/.internal/baseIsEqualDeep.js b/.internal/baseIsEqualDeep.js index 210e5a8e6f..27749cd016 100644 --- a/.internal/baseIsEqualDeep.js +++ b/.internal/baseIsEqualDeep.js @@ -1,21 +1,21 @@ -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 isBuffer from '../isBuffer.js'; -import isTypedArray from '../isTypedArray.js'; +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 isBuffer from '../isBuffer.js' +import isTypedArray from '../isTypedArray.js' /** Used to compose bitmasks for value comparisons. */ -const COMPARE_PARTIAL_FLAG = 1; +const COMPARE_PARTIAL_FLAG = 1 /** `Object#toString` result references. */ -const argsTag = '[object Arguments]'; -const arrayTag = '[object Array]'; -const objectTag = '[object Object]'; +const argsTag = '[object Arguments]' +const arrayTag = '[object Array]' +const objectTag = '[object Object]' /** Used to check objects for own properties. */ -const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwnProperty = Object.prototype.hasOwnProperty /** * A specialized version of `baseIsEqual` for arrays and objects which performs @@ -32,48 +32,48 @@ const hasOwnProperty = Object.prototype.hasOwnProperty; * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { - let objIsArr = Array.isArray(object); - const othIsArr = Array.isArray(other); - let objTag = objIsArr ? arrayTag : getTag(object); - let othTag = othIsArr ? arrayTag : getTag(other); + let objIsArr = Array.isArray(object) + const othIsArr = Array.isArray(other) + let objTag = objIsArr ? arrayTag : getTag(object) + let othTag = othIsArr ? arrayTag : getTag(other) - objTag = objTag == argsTag ? objectTag : objTag; - othTag = othTag == argsTag ? objectTag : othTag; + objTag = objTag == argsTag ? objectTag : objTag + othTag = othTag == argsTag ? objectTag : othTag - let objIsObj = objTag == objectTag; - const othIsObj = othTag == objectTag; - const isSameTag = objTag == othTag; + let objIsObj = objTag == objectTag + const othIsObj = othTag == objectTag + const isSameTag = objTag == othTag if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { - return false; + return false } - objIsArr = true; - objIsObj = false; + objIsArr = true + objIsObj = false } if (isSameTag && !objIsObj) { - stack || (stack = new Stack); + stack || (stack = new Stack) return (objIsArr || isTypedArray(object)) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) - : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack) } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { - const objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'); - const othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + const objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__') + const othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__') if (objIsWrapped || othIsWrapped) { - const objUnwrapped = objIsWrapped ? object.value() : object; - const othUnwrapped = othIsWrapped ? other.value() : other; + const objUnwrapped = objIsWrapped ? object.value() : object + const othUnwrapped = othIsWrapped ? other.value() : other - stack || (stack = new Stack); - return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + stack || (stack = new Stack) + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack) } } if (!isSameTag) { - return false; + return false } - stack || (stack = new Stack); - return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + stack || (stack = new Stack) + return equalObjects(object, other, bitmask, customizer, equalFunc, stack) } -export default baseIsEqualDeep; +export default baseIsEqualDeep diff --git a/.internal/baseIsMatch.js b/.internal/baseIsMatch.js index 229ef2a323..36bdb03959 100644 --- a/.internal/baseIsMatch.js +++ b/.internal/baseIsMatch.js @@ -1,9 +1,9 @@ -import Stack from './Stack.js'; -import baseIsEqual from './baseIsEqual.js'; +import Stack from './Stack.js' +import baseIsEqual from './baseIsEqual.js' /** Used to compose bitmasks for value comparisons. */ -const COMPARE_PARTIAL_FLAG = 1; -const COMPARE_UNORDERED_FLAG = 2; +const COMPARE_PARTIAL_FLAG = 1 +const COMPARE_UNORDERED_FLAG = 2 /** * The base implementation of `isMatch`. @@ -16,49 +16,49 @@ const COMPARE_UNORDERED_FLAG = 2; * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ function baseIsMatch(object, source, matchData, customizer) { - let index = matchData.length; - const length = index; - const noCustomizer = !customizer; + let index = matchData.length + const length = index + const noCustomizer = !customizer if (object == null) { - return !length; + return !length } - let data; - let result; - object = Object(object); + let data + let result + object = Object(object) while (index--) { - data = matchData[index]; + data = matchData[index] if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object) ) { - return false; + return false } } while (++index < length) { - data = matchData[index]; - const key = data[0]; - const objValue = object[key]; - const srcValue = data[1]; + data = matchData[index] + const key = data[0] + const objValue = object[key] + const srcValue = data[1] if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { - return false; + return false } } else { - const stack = new Stack; + const stack = new Stack if (customizer) { - result = customizer(objValue, srcValue, key, object, source, stack); + result = customizer(objValue, srcValue, key, object, source, stack) } if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result )) { - return false; + return false } } } - return true; + return true } -export default baseIsMatch; +export default baseIsMatch diff --git a/.internal/baseIsNaN.js b/.internal/baseIsNaN.js index ee166ec5a8..1ca038c4bf 100644 --- a/.internal/baseIsNaN.js +++ b/.internal/baseIsNaN.js @@ -6,7 +6,7 @@ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ function baseIsNaN(value) { - return value !== value; + return value !== value } -export default baseIsNaN; +export default baseIsNaN diff --git a/.internal/baseKeys.js b/.internal/baseKeys.js index 7f9f55db69..677b855b69 100644 --- a/.internal/baseKeys.js +++ b/.internal/baseKeys.js @@ -1,8 +1,8 @@ -import isPrototype from './isPrototype.js'; -import nativeKeys from './nativeKeys.js'; +import isPrototype from './isPrototype.js' +import nativeKeys from './nativeKeys.js' /** Used to check objects for own properties. */ -const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwnProperty = Object.prototype.hasOwnProperty /** * The base implementation of `keys` which doesn't treat sparse arrays as dense. @@ -13,15 +13,15 @@ const hasOwnProperty = Object.prototype.hasOwnProperty; */ function baseKeys(object) { if (!isPrototype(object)) { - return nativeKeys(object); + return nativeKeys(object) } - const result = []; + const result = [] for (const key in Object(object)) { if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); + result.push(key) } } - return result; + return result } -export default baseKeys; +export default baseKeys diff --git a/.internal/baseKeysIn.js b/.internal/baseKeysIn.js index 62a9b9d6cf..e0de1b9683 100644 --- a/.internal/baseKeysIn.js +++ b/.internal/baseKeysIn.js @@ -1,9 +1,9 @@ -import isObject from '../isObject.js'; -import isPrototype from './isPrototype.js'; -import nativeKeysIn from './nativeKeysIn.js'; +import isObject from '../isObject.js' +import isPrototype from './isPrototype.js' +import nativeKeysIn from './nativeKeysIn.js' /** Used to check objects for own properties. */ -const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwnProperty = Object.prototype.hasOwnProperty /** * The base implementation of `keysIn` which doesn't treat sparse arrays as dense. @@ -14,17 +14,17 @@ const hasOwnProperty = Object.prototype.hasOwnProperty; */ function baseKeysIn(object) { if (!isObject(object)) { - return nativeKeysIn(object); + return nativeKeysIn(object) } - const isProto = isPrototype(object); - const result = []; + const isProto = isPrototype(object) + const result = [] for (const key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); + result.push(key) } } - return result; + return result } -export default baseKeysIn; +export default baseKeysIn diff --git a/.internal/baseMap.js b/.internal/baseMap.js index dd984ec65d..c490995ca9 100644 --- a/.internal/baseMap.js +++ b/.internal/baseMap.js @@ -1,5 +1,5 @@ -import baseEach from './baseEach.js'; -import isArrayLike from '../isArrayLike.js'; +import baseEach from './baseEach.js' +import isArrayLike from '../isArrayLike.js' /** * The base implementation of `map`. @@ -10,13 +10,13 @@ import isArrayLike from '../isArrayLike.js'; * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { - let index = -1; - const result = isArrayLike(collection) ? Array(collection.length) : []; + let index = -1 + const result = isArrayLike(collection) ? Array(collection.length) : [] baseEach(collection, (value, key, collection) => { - result[++index] = iteratee(value, key, collection); - }); - return result; + result[++index] = iteratee(value, key, collection) + }) + return result } -export default baseMap; +export default baseMap diff --git a/.internal/baseMatches.js b/.internal/baseMatches.js index 26649911ef..012a04e5ca 100644 --- a/.internal/baseMatches.js +++ b/.internal/baseMatches.js @@ -1,6 +1,6 @@ -import baseIsMatch from './baseIsMatch.js'; -import getMatchData from './getMatchData.js'; -import matchesStrictComparable from './matchesStrictComparable.js'; +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`. @@ -10,11 +10,11 @@ import matchesStrictComparable from './matchesStrictComparable.js'; * @returns {Function} Returns the new spec function. */ function baseMatches(source) { - const matchData = getMatchData(source); + const matchData = getMatchData(source) if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); + return matchesStrictComparable(matchData[0][0], matchData[0][1]) } - return object => object === source || baseIsMatch(object, source, matchData); + return object => object === source || baseIsMatch(object, source, matchData) } -export default baseMatches; +export default baseMatches diff --git a/.internal/baseMatchesProperty.js b/.internal/baseMatchesProperty.js index af6064dd4e..c832f85001 100644 --- a/.internal/baseMatchesProperty.js +++ b/.internal/baseMatchesProperty.js @@ -1,14 +1,14 @@ -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'; +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 value comparisons. */ -const COMPARE_PARTIAL_FLAG = 1; -const COMPARE_UNORDERED_FLAG = 2; +const COMPARE_PARTIAL_FLAG = 1 +const COMPARE_UNORDERED_FLAG = 2 /** * The base implementation of `matchesProperty` which doesn't clone `srcValue`. @@ -20,14 +20,14 @@ const COMPARE_UNORDERED_FLAG = 2; */ function baseMatchesProperty(path, srcValue) { if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); + return matchesStrictComparable(toKey(path), srcValue) } return object => { - const objValue = get(object, path); + const objValue = get(object, path) return (objValue === undefined && objValue === srcValue) ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); - }; + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG) + } } -export default baseMatchesProperty; +export default baseMatchesProperty diff --git a/.internal/baseMerge.js b/.internal/baseMerge.js index ec5b0b07ca..1f63eef72d 100644 --- a/.internal/baseMerge.js +++ b/.internal/baseMerge.js @@ -1,9 +1,9 @@ -import Stack from './Stack.js'; -import assignMergeValue from './assignMergeValue.js'; -import baseFor from './baseFor.js'; -import baseMergeDeep from './baseMergeDeep.js'; -import isObject from '../isObject.js'; -import keysIn from '../keysIn.js'; +import Stack from './Stack.js' +import assignMergeValue from './assignMergeValue.js' +import baseFor from './baseFor.js' +import baseMergeDeep from './baseMergeDeep.js' +import isObject from '../isObject.js' +import keysIn from '../keysIn.js' /** * The base implementation of `merge` without support for multiple sources. @@ -18,24 +18,24 @@ import keysIn from '../keysIn.js'; */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { - return; + return } baseFor(source, (srcValue, key) => { if (isObject(srcValue)) { - stack || (stack = new Stack); - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + stack || (stack = new Stack) + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack) } else { const newValue = customizer ? customizer(object[key], srcValue, `${ key }`, object, source, stack) - : undefined; + : undefined if (newValue === undefined) { - newValue = srcValue; + newValue = srcValue } - assignMergeValue(object, key, newValue); + assignMergeValue(object, key, newValue) } - }, keysIn); + }, keysIn) } -export default baseMerge; +export default baseMerge diff --git a/.internal/baseMergeDeep.js b/.internal/baseMergeDeep.js index 1246be21ef..e6fee04753 100644 --- a/.internal/baseMergeDeep.js +++ b/.internal/baseMergeDeep.js @@ -1,16 +1,16 @@ -import assignMergeValue from './assignMergeValue.js'; -import cloneBuffer from './cloneBuffer.js'; -import cloneTypedArray from './cloneTypedArray.js'; -import copyArray from './copyArray.js'; -import initCloneObject from './initCloneObject.js'; -import isArguments from '../isArguments.js'; -import isArrayLikeObject from '../isArrayLikeObject.js'; -import isBuffer from '../isBuffer.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'; +import assignMergeValue from './assignMergeValue.js' +import cloneBuffer from './cloneBuffer.js' +import cloneTypedArray from './cloneTypedArray.js' +import copyArray from './copyArray.js' +import initCloneObject from './initCloneObject.js' +import isArguments from '../isArguments.js' +import isArrayLikeObject from '../isArrayLikeObject.js' +import isBuffer from '../isBuffer.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 @@ -28,65 +28,65 @@ import toPlainObject from '../toPlainObject.js'; * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - const objValue = object[key]; - const srcValue = source[key]; - const stacked = stack.get(srcValue); + const objValue = object[key] + const srcValue = source[key] + const stacked = stack.get(srcValue) if (stacked) { - assignMergeValue(object, key, stacked); - return; + assignMergeValue(object, key, stacked) + return } let newValue = customizer ? customizer(objValue, srcValue, `${ key }`, object, source, stack) - : undefined; + : undefined - let isCommon = newValue === undefined; + let isCommon = newValue === undefined if (isCommon) { - const isArr = Array.isArray(srcValue); - const isBuff = !isArr && isBuffer(srcValue); - const isTyped = !isArr && !isBuff && isTypedArray(srcValue); + const isArr = Array.isArray(srcValue) + const isBuff = !isArr && isBuffer(srcValue) + const isTyped = !isArr && !isBuff && isTypedArray(srcValue) - newValue = srcValue; + newValue = srcValue if (isArr || isBuff || isTyped) { if (Array.isArray(objValue)) { - newValue = objValue; + newValue = objValue } else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); + newValue = copyArray(objValue) } else if (isBuff) { - isCommon = false; - newValue = cloneBuffer(srcValue, true); + isCommon = false + newValue = cloneBuffer(srcValue, true) } else if (isTyped) { - isCommon = false; - newValue = cloneTypedArray(srcValue, true); + isCommon = false + newValue = cloneTypedArray(srcValue, true) } else { - newValue = []; + newValue = [] } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = objValue; + newValue = objValue if (isArguments(objValue)) { - newValue = toPlainObject(objValue); + newValue = toPlainObject(objValue) } else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { - newValue = initCloneObject(srcValue); + newValue = initCloneObject(srcValue) } } else { - isCommon = false; + isCommon = false } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack['delete'](srcValue); + stack.set(srcValue, newValue) + mergeFunc(newValue, srcValue, srcIndex, customizer, stack) + stack['delete'](srcValue) } - assignMergeValue(object, key, newValue); + assignMergeValue(object, key, newValue) } -export default baseMergeDeep; +export default baseMergeDeep diff --git a/.internal/baseNth.js b/.internal/baseNth.js index 282f9c2911..f5df951245 100644 --- a/.internal/baseNth.js +++ b/.internal/baseNth.js @@ -1,4 +1,4 @@ -import isIndex from './isIndex.js'; +import isIndex from './isIndex.js' /** * The base implementation of `nth` which doesn't coerce arguments. @@ -9,12 +9,12 @@ import isIndex from './isIndex.js'; * @returns {*} Returns the nth element of `array`. */ function baseNth(array, n) { - const length = array.length; + const length = array.length if (!length) { - return; + return } - n += n < 0 ? length : 0; - return isIndex(n, length) ? array[n] : undefined; + n += n < 0 ? length : 0 + return isIndex(n, length) ? array[n] : undefined } -export default baseNth; +export default baseNth diff --git a/.internal/baseOrderBy.js b/.internal/baseOrderBy.js index f950b5dec7..46a2b8268c 100644 --- a/.internal/baseOrderBy.js +++ b/.internal/baseOrderBy.js @@ -1,8 +1,8 @@ -import arrayMap from './arrayMap.js'; -import baseMap from './baseMap.js'; -import baseSortBy from './baseSortBy.js'; -import compareMultiple from './compareMultiple.js'; -import identity from '../identity.js'; +import arrayMap from './arrayMap.js' +import baseMap from './baseMap.js' +import baseSortBy from './baseSortBy.js' +import compareMultiple from './compareMultiple.js' +import identity from '../identity.js' /** * The base implementation of `orderBy` without param guards. @@ -14,15 +14,15 @@ import identity from '../identity.js'; * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { - let index = -1; - iteratees = iteratees.length ? iteratees : [identity]; + let index = -1 + iteratees = iteratees.length ? iteratees : [identity] const result = baseMap(collection, (value, key, collection) => { - const criteria = arrayMap(iteratees, iteratee => iteratee(value)); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); + const criteria = arrayMap(iteratees, iteratee => iteratee(value)) + return { 'criteria': criteria, 'index': ++index, 'value': value } + }) - return baseSortBy(result, (object, other) => compareMultiple(object, other, orders)); + return baseSortBy(result, (object, other) => compareMultiple(object, other, orders)) } -export default baseOrderBy; +export default baseOrderBy diff --git a/.internal/basePick.js b/.internal/basePick.js index a6c46e0a53..813523cdf7 100644 --- a/.internal/basePick.js +++ b/.internal/basePick.js @@ -1,5 +1,5 @@ -import basePickBy from './basePickBy.js'; -import hasIn from '../hasIn.js'; +import basePickBy from './basePickBy.js' +import hasIn from '../hasIn.js' /** * The base implementation of `pick` without support for individual @@ -11,7 +11,7 @@ import hasIn from '../hasIn.js'; * @returns {Object} Returns the new object. */ function basePick(object, paths) { - return basePickBy(object, paths, (value, path) => hasIn(object, path)); + return basePickBy(object, paths, (value, path) => hasIn(object, path)) } -export default basePick; +export default basePick diff --git a/.internal/basePickBy.js b/.internal/basePickBy.js index d639cd684d..4b1f7cb02a 100644 --- a/.internal/basePickBy.js +++ b/.internal/basePickBy.js @@ -1,6 +1,6 @@ -import baseGet from './baseGet.js'; -import baseSet from './baseSet.js'; -import castPath from './castPath.js'; +import baseGet from './baseGet.js' +import baseSet from './baseSet.js' +import castPath from './castPath.js' /** * The base implementation of `pickBy`. @@ -12,18 +12,18 @@ import castPath from './castPath.js'; * @returns {Object} Returns the new object. */ function basePickBy(object, paths, predicate) { - let index = -1; - const length = paths.length; - const result = {}; + let index = -1 + const length = paths.length + const result = {} while (++index < length) { - const path = paths[index]; - const value = baseGet(object, path); + const path = paths[index] + const value = baseGet(object, path) if (predicate(value, path)) { - baseSet(result, castPath(path, object), value); + baseSet(result, castPath(path, object), value) } } - return result; + return result } -export default basePickBy; +export default basePickBy diff --git a/.internal/baseProperty.js b/.internal/baseProperty.js index 21714557b8..a26fe0d8bd 100644 --- a/.internal/baseProperty.js +++ b/.internal/baseProperty.js @@ -6,7 +6,7 @@ * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { - return object => object == null ? undefined : object[key]; + return object => object == null ? undefined : object[key] } -export default baseProperty; +export default baseProperty diff --git a/.internal/basePropertyDeep.js b/.internal/basePropertyDeep.js index 68c690bb18..2dbe3f2ef7 100644 --- a/.internal/basePropertyDeep.js +++ b/.internal/basePropertyDeep.js @@ -1,4 +1,4 @@ -import baseGet from './baseGet.js'; +import baseGet from './baseGet.js' /** * A specialized version of `baseProperty` which supports deep paths. @@ -8,7 +8,7 @@ import baseGet from './baseGet.js'; * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { - return object => baseGet(object, path); + return object => baseGet(object, path) } -export default basePropertyDeep; +export default basePropertyDeep diff --git a/.internal/basePropertyOf.js b/.internal/basePropertyOf.js index 368ab065fe..d9ecf59a34 100644 --- a/.internal/basePropertyOf.js +++ b/.internal/basePropertyOf.js @@ -6,7 +6,7 @@ * @returns {Function} Returns the new accessor function. */ function basePropertyOf(object) { - return key => object == null ? undefined : object[key]; + return key => object == null ? undefined : object[key] } -export default basePropertyOf; +export default basePropertyOf diff --git a/.internal/basePullAll.js b/.internal/basePullAll.js index 49beec28c3..83dba6f440 100644 --- a/.internal/basePullAll.js +++ b/.internal/basePullAll.js @@ -1,10 +1,10 @@ -import arrayMap from './arrayMap.js'; -import baseIndexOf from './baseIndexOf.js'; -import baseIndexOfWith from './baseIndexOfWith.js'; -import copyArray from './copyArray.js'; +import arrayMap from './arrayMap.js' +import baseIndexOf from './baseIndexOf.js' +import baseIndexOfWith from './baseIndexOfWith.js' +import copyArray from './copyArray.js' /** Built-in value references. */ -const splice = Array.prototype.splice; +const splice = Array.prototype.splice /** * The base implementation of `pullAllBy`. @@ -17,31 +17,31 @@ const splice = Array.prototype.splice; * @returns {Array} Returns `array`. */ function basePullAll(array, values, iteratee, comparator) { - const indexOf = comparator ? baseIndexOfWith : baseIndexOf; - const length = values.length; + const indexOf = comparator ? baseIndexOfWith : baseIndexOf + const length = values.length - let index = -1; - let seen = array; + let index = -1 + let seen = array if (array === values) { - values = copyArray(values); + values = copyArray(values) } if (iteratee) { - seen = arrayMap(array, value => iteratee(value)); + seen = arrayMap(array, value => iteratee(value)) } while (++index < length) { - let fromIndex = 0; - const value = values[index]; - const computed = iteratee ? iteratee(value) : value; + let fromIndex = 0 + const value = values[index] + const computed = iteratee ? iteratee(value) : value while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { if (seen !== array) { - splice.call(seen, fromIndex, 1); + splice.call(seen, fromIndex, 1) } - splice.call(array, fromIndex, 1); + splice.call(array, fromIndex, 1) } } - return array; + return array } -export default basePullAll; +export default basePullAll diff --git a/.internal/basePullAt.js b/.internal/basePullAt.js index eed829ea6a..6a22c501a3 100644 --- a/.internal/basePullAt.js +++ b/.internal/basePullAt.js @@ -1,8 +1,8 @@ -import baseUnset from './baseUnset.js'; -import isIndex from './isIndex.js'; +import baseUnset from './baseUnset.js' +import isIndex from './isIndex.js' /** Built-in value references. */ -const splice = Array.prototype.splice; +const splice = Array.prototype.splice /** * The base implementation of `pullAt` without support for individual @@ -14,22 +14,22 @@ const splice = Array.prototype.splice; * @returns {Array} Returns `array`. */ function basePullAt(array, indexes) { - let length = array ? indexes.length : 0; - const lastIndex = length - 1; + let length = array ? indexes.length : 0 + const lastIndex = length - 1 while (length--) { - let previous; - const index = indexes[length]; + let previous + const index = indexes[length] if (length == lastIndex || index !== previous) { - previous = index; + previous = index if (isIndex(index)) { - splice.call(array, index, 1); + splice.call(array, index, 1) } else { - baseUnset(array, index); + baseUnset(array, index) } } } - return array; + return array } -export default basePullAt; +export default basePullAt diff --git a/.internal/baseRandom.js b/.internal/baseRandom.js index 96a53006e6..c04fc620dc 100644 --- a/.internal/baseRandom.js +++ b/.internal/baseRandom.js @@ -8,7 +8,7 @@ * @returns {number} Returns the random number. */ function baseRandom(lower, upper) { - return lower + Math.floor(Math.random() * (upper - lower + 1)); + return lower + Math.floor(Math.random() * (upper - lower + 1)) } -export default baseRandom; +export default baseRandom diff --git a/.internal/baseRange.js b/.internal/baseRange.js index 6899a47e4e..365e637fac 100644 --- a/.internal/baseRange.js +++ b/.internal/baseRange.js @@ -1,6 +1,6 @@ /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeCeil = Math.ceil; -const nativeMax = Math.max; +const nativeCeil = Math.ceil +const nativeMax = Math.max /** * The base implementation of `range` and `rangeRight` which doesn't @@ -14,15 +14,15 @@ const nativeMax = Math.max; * @returns {Array} Returns the range of numbers. */ function baseRange(start, end, step, fromRight) { - let index = -1; - let length = nativeMax(nativeCeil((end - start) / (step || 1)), 0); - const result = Array(length); + let index = -1 + let length = nativeMax(nativeCeil((end - start) / (step || 1)), 0) + const result = Array(length) while (length--) { - result[fromRight ? length : ++index] = start; - start += step; + result[fromRight ? length : ++index] = start + start += step } - return result; + return result } -export default baseRange; +export default baseRange diff --git a/.internal/baseReduce.js b/.internal/baseReduce.js index 39596da3e6..8c643cee57 100644 --- a/.internal/baseReduce.js +++ b/.internal/baseReduce.js @@ -15,9 +15,9 @@ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, (value, index, collection) => { accumulator = initAccum ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; + : iteratee(accumulator, value, index, collection) + }) + return accumulator } -export default baseReduce; +export default baseReduce diff --git a/.internal/baseRepeat.js b/.internal/baseRepeat.js index 10216f7ae6..b518457bc6 100644 --- a/.internal/baseRepeat.js +++ b/.internal/baseRepeat.js @@ -1,8 +1,8 @@ /** Used as references for various `Number` constants. */ -const MAX_SAFE_INTEGER = 9007199254740991; +const MAX_SAFE_INTEGER = 9007199254740991 /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeFloor = Math.floor; +const nativeFloor = Math.floor /** * The base implementation of `repeat` which doesn't coerce arguments. @@ -13,23 +13,23 @@ const nativeFloor = Math.floor; * @returns {string} Returns the repeated string. */ function baseRepeat(string, n) { - let result = ''; + let result = '' if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; + return result } // Leverage the exponentiation by squaring algorithm for a faster repeat. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. do { if (n % 2) { - result += string; + result += string } - n = nativeFloor(n / 2); + n = nativeFloor(n / 2) if (n) { - string += string; + string += string } - } while (n); + } while (n) - return result; + return result } -export default baseRepeat; +export default baseRepeat diff --git a/.internal/baseSample.js b/.internal/baseSample.js index 6144a464b4..de50cae0a6 100644 --- a/.internal/baseSample.js +++ b/.internal/baseSample.js @@ -1,5 +1,5 @@ -import arraySample from './arraySample.js'; -import values from '../values.js'; +import arraySample from './arraySample.js' +import values from '../values.js' /** * The base implementation of `sample`. @@ -9,7 +9,7 @@ import values from '../values.js'; * @returns {*} Returns the random element. */ function baseSample(collection) { - return arraySample(values(collection)); + return arraySample(values(collection)) } -export default baseSample; +export default baseSample diff --git a/.internal/baseSampleSize.js b/.internal/baseSampleSize.js index babb51b896..9c10b684c3 100644 --- a/.internal/baseSampleSize.js +++ b/.internal/baseSampleSize.js @@ -1,6 +1,6 @@ -import baseClamp from './baseClamp.js'; -import shuffleSelf from './shuffleSelf.js'; -import values from '../values.js'; +import baseClamp from './baseClamp.js' +import shuffleSelf from './shuffleSelf.js' +import values from '../values.js' /** * The base implementation of `sampleSize` without param guards. @@ -11,8 +11,8 @@ import values from '../values.js'; * @returns {Array} Returns the random elements. */ function baseSampleSize(collection, n) { - const array = values(collection); - return shuffleSelf(array, baseClamp(n, 0, array.length)); + const array = values(collection) + return shuffleSelf(array, baseClamp(n, 0, array.length)) } -export default baseSampleSize; +export default baseSampleSize diff --git a/.internal/baseSet.js b/.internal/baseSet.js index 1cd007d314..92bad879fd 100644 --- a/.internal/baseSet.js +++ b/.internal/baseSet.js @@ -1,8 +1,8 @@ -import assignValue from './assignValue.js'; -import castPath from './castPath.js'; -import isIndex from './isIndex.js'; -import isObject from '../isObject.js'; -import toKey from './toKey.js'; +import assignValue from './assignValue.js' +import castPath from './castPath.js' +import isIndex from './isIndex.js' +import isObject from '../isObject.js' +import toKey from './toKey.js' /** * The base implementation of `set`. @@ -16,33 +16,33 @@ import toKey from './toKey.js'; */ function baseSet(object, path, value, customizer) { if (!isObject(object)) { - return object; + return object } - path = castPath(path, object); + path = castPath(path, object) - const length = path.length; - const lastIndex = length - 1; + const length = path.length + const lastIndex = length - 1 - let index = -1; - let nested = object; + let index = -1 + let nested = object while (nested != null && ++index < length) { - const key = toKey(path[index]); - let newValue = value; + const key = toKey(path[index]) + let newValue = value if (index != lastIndex) { - const objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; + const objValue = nested[key] + newValue = customizer ? customizer(objValue, key, nested) : undefined if (newValue === undefined) { newValue = isObject(objValue) ? objValue - : (isIndex(path[index + 1]) ? [] : {}); + : (isIndex(path[index + 1]) ? [] : {}) } } - assignValue(nested, key, newValue); - nested = nested[key]; + assignValue(nested, key, newValue) + nested = nested[key] } - return object; + return object } -export default baseSet; +export default baseSet diff --git a/.internal/baseSetToString.js b/.internal/baseSetToString.js index 7c9890c136..a720411bc4 100644 --- a/.internal/baseSetToString.js +++ b/.internal/baseSetToString.js @@ -1,5 +1,5 @@ -import constant from '../constant.js'; -import identity from '../identity.js'; +import constant from '../constant.js' +import identity from '../identity.js' /** * The base implementation of `setToString` without support for hot loop shorting. @@ -15,7 +15,7 @@ function baseSetToString(func, string){ 'enumerable': false, 'value': constant(string), 'writable': true - }); + }) } -export default baseSetToString; +export default baseSetToString diff --git a/.internal/baseShuffle.js b/.internal/baseShuffle.js index 4dc792ce03..f497405f74 100644 --- a/.internal/baseShuffle.js +++ b/.internal/baseShuffle.js @@ -1,5 +1,5 @@ -import shuffleSelf from './shuffleSelf.js'; -import values from '../values.js'; +import shuffleSelf from './shuffleSelf.js' +import values from '../values.js' /** * The base implementation of `shuffle`. @@ -9,7 +9,7 @@ import values from '../values.js'; * @returns {Array} Returns the new shuffled array. */ function baseShuffle(collection) { - return shuffleSelf(values(collection)); + return shuffleSelf(values(collection)) } -export default baseShuffle; +export default baseShuffle diff --git a/.internal/baseSlice.js b/.internal/baseSlice.js index c7a613be00..ed042ba905 100644 --- a/.internal/baseSlice.js +++ b/.internal/baseSlice.js @@ -9,23 +9,23 @@ */ function baseSlice(array, start, end) { let index = -1, - length = array.length; + length = array.length if (start < 0) { - start = -start > length ? 0 : (length + start); + start = -start > length ? 0 : (length + start) } - end = end > length ? length : end; + end = end > length ? length : end if (end < 0) { - end += length; + end += length } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; + length = start > end ? 0 : ((end - start) >>> 0) + start >>>= 0 - const result = Array(length); + const result = Array(length) while (++index < length) { - result[index] = array[index + start]; + result[index] = array[index + start] } - return result; + return result } -export default baseSlice; +export default baseSlice diff --git a/.internal/baseSome.js b/.internal/baseSome.js index 553ba78157..88b5ee538c 100644 --- a/.internal/baseSome.js +++ b/.internal/baseSome.js @@ -1,4 +1,4 @@ -import baseEach from './baseEach.js'; +import baseEach from './baseEach.js' /** * The base implementation of `some`. @@ -10,13 +10,13 @@ import baseEach from './baseEach.js'; * else `false`. */ function baseSome(collection, predicate) { - let result; + let result baseEach(collection, (value, index, collection) => { - result = predicate(value, index, collection); - return !result; - }); - return !!result; + result = predicate(value, index, collection) + return !result + }) + return !!result } -export default baseSome; +export default baseSome diff --git a/.internal/baseSortBy.js b/.internal/baseSortBy.js index e96d2d9a9c..1a134cba96 100644 --- a/.internal/baseSortBy.js +++ b/.internal/baseSortBy.js @@ -9,13 +9,13 @@ * @returns {Array} Returns `array`. */ function baseSortBy(array, comparer) { - let length = array.length; + let length = array.length - array.sort(comparer); + array.sort(comparer) while (length--) { - array[length] = array[length].value; + array[length] = array[length].value } - return array; + return array } -export default baseSortBy; +export default baseSortBy diff --git a/.internal/baseSortedIndex.js b/.internal/baseSortedIndex.js index 65d7769466..8418c2796f 100644 --- a/.internal/baseSortedIndex.js +++ b/.internal/baseSortedIndex.js @@ -1,10 +1,10 @@ -import baseSortedIndexBy from './baseSortedIndexBy.js'; -import identity from '../identity.js'; -import isSymbol from '../isSymbol.js'; +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. */ -const MAX_ARRAY_LENGTH = 4294967295; -const HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; +const MAX_ARRAY_LENGTH = 4294967295 +const HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1 /** * The base implementation of `sortedIndex` and `sortedLastIndex` which @@ -19,23 +19,23 @@ const HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; * into `array`. */ function baseSortedIndex(array, value, retHighest) { - let low = 0; - let high = array == null ? low : array.length; + let low = 0 + let high = array == null ? low : array.length if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { while (low < high) { - const mid = (low + high) >>> 1; - const computed = array[mid]; + const mid = (low + high) >>> 1 + const computed = array[mid] if (computed !== null && !isSymbol(computed) && (retHighest ? (computed <= value) : (computed < value))) { - low = mid + 1; + low = mid + 1 } else { - high = mid; + high = mid } } - return high; + return high } - return baseSortedIndexBy(array, value, identity, retHighest); + return baseSortedIndexBy(array, value, identity, retHighest) } -export default baseSortedIndex; +export default baseSortedIndex diff --git a/.internal/baseSortedIndexBy.js b/.internal/baseSortedIndexBy.js index d9912ddb68..0e0ea7bccf 100644 --- a/.internal/baseSortedIndexBy.js +++ b/.internal/baseSortedIndexBy.js @@ -1,16 +1,16 @@ -import isSymbol from '../isSymbol.js'; +import isSymbol from '../isSymbol.js' /** Used as references for the maximum length and index of an array. */ -const MAX_ARRAY_LENGTH = 4294967295; -const MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1; +const MAX_ARRAY_LENGTH = 4294967295 +const MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1 /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeFloor = Math.floor, nativeMin = Math.min; +const nativeFloor = Math.floor, nativeMin = Math.min /** * The base implementation of `sortedIndexBy` and `sortedLastIndexBy` * which invokes `iteratee` for `value` and each element of `array` to compute - * their sort ranking. The iteratee is invoked with one argument; (value). + * their sort ranking. The iteratee is invoked with one argument (value). * * @private * @param {Array} array The sorted array to inspect. @@ -21,44 +21,44 @@ const nativeFloor = Math.floor, nativeMin = Math.min; * into `array`. */ function baseSortedIndexBy(array, value, iteratee, retHighest) { - value = iteratee(value); + value = iteratee(value) - let low = 0; - let high = array == null ? 0 : array.length; - const valIsNaN = value !== value; - const valIsNull = value === null; - const valIsSymbol = isSymbol(value); - const valIsUndefined = value === undefined; + let low = 0 + let high = array == null ? 0 : array.length + const valIsNaN = value !== value + const valIsNull = value === null + const valIsSymbol = isSymbol(value) + const valIsUndefined = value === undefined while (low < high) { - let setLow; - const mid = nativeFloor((low + high) / 2); - const computed = iteratee(array[mid]); - const othIsDefined = computed !== undefined; - const othIsNull = computed === null; - const othIsReflexive = computed === computed; - const othIsSymbol = isSymbol(computed); + let setLow + const mid = nativeFloor((low + high) / 2) + const computed = iteratee(array[mid]) + const othIsDefined = computed !== undefined + const othIsNull = computed === null + const othIsReflexive = computed === computed + const othIsSymbol = isSymbol(computed) if (valIsNaN) { - setLow = retHighest || othIsReflexive; + setLow = retHighest || othIsReflexive } else if (valIsUndefined) { - setLow = othIsReflexive && (retHighest || othIsDefined); + setLow = othIsReflexive && (retHighest || othIsDefined) } else if (valIsNull) { - setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull) } else if (valIsSymbol) { - setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol) } else if (othIsNull || othIsSymbol) { - setLow = false; + setLow = false } else { - setLow = retHighest ? (computed <= value) : (computed < value); + setLow = retHighest ? (computed <= value) : (computed < value) } if (setLow) { - low = mid + 1; + low = mid + 1 } else { - high = mid; + high = mid } } - return nativeMin(high, MAX_ARRAY_INDEX); + return nativeMin(high, MAX_ARRAY_INDEX) } -export default baseSortedIndexBy; +export default baseSortedIndexBy diff --git a/.internal/baseSortedUniq.js b/.internal/baseSortedUniq.js index b7017caeb3..5f1a31c9eb 100644 --- a/.internal/baseSortedUniq.js +++ b/.internal/baseSortedUniq.js @@ -1,4 +1,4 @@ -import eq from '../eq.js'; +import eq from '../eq.js' /** * The base implementation of `sortedUniq` and `sortedUniqBy`. @@ -9,21 +9,21 @@ import eq from '../eq.js'; * @returns {Array} Returns the new duplicate free array. */ function baseSortedUniq(array, iteratee) { - let seen; - let index = -1; - let resIndex = 0; + let seen + let index = -1 + let resIndex = 0 - const length = array.length; - const result = []; + const length = array.length + const result = [] while (++index < length) { - const value = array[index], computed = iteratee ? iteratee(value) : value; + const value = array[index], computed = iteratee ? iteratee(value) : value if (!index || !eq(computed, seen)) { - seen = computed; - result[resIndex++] = value === 0 ? 0 : value; + seen = computed + result[resIndex++] = value === 0 ? 0 : value } } - return result; + return result } -export default baseSortedUniq; +export default baseSortedUniq diff --git a/.internal/baseSum.js b/.internal/baseSum.js index ae20dfdb30..638933da74 100644 --- a/.internal/baseSum.js +++ b/.internal/baseSum.js @@ -7,17 +7,17 @@ * @returns {number} Returns the sum. */ function baseSum(array, iteratee) { - let result; - let index = -1; - const length = array.length; + let result + let index = -1 + const length = array.length while (++index < length) { - const current = iteratee(array[index]); + const current = iteratee(array[index]) if (current !== undefined) { - result = result === undefined ? current : (result + current); + result = result === undefined ? current : (result + current) } } - return result; + return result } -export default baseSum; +export default baseSum diff --git a/.internal/baseTimes.js b/.internal/baseTimes.js index 360e585187..c1ab241688 100644 --- a/.internal/baseTimes.js +++ b/.internal/baseTimes.js @@ -7,13 +7,13 @@ * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { - let index = -1; - const result = Array(n); + let index = -1 + const result = Array(n) while (++index < n) { - result[index] = iteratee(index); + result[index] = iteratee(index) } - return result; + return result } -export default baseTimes; +export default baseTimes diff --git a/.internal/baseToNumber.js b/.internal/baseToNumber.js index d5b674005d..a191ab8755 100644 --- a/.internal/baseToNumber.js +++ b/.internal/baseToNumber.js @@ -1,7 +1,7 @@ -import isSymbol from '../isSymbol.js'; +import isSymbol from '../isSymbol.js' /** Used as references for various `Number` constants. */ -const NAN = 0 / 0; +const NAN = 0 / 0 /** * The base implementation of `toNumber` which doesn't ensure correct @@ -13,12 +13,12 @@ const NAN = 0 / 0; */ function baseToNumber(value) { if (typeof value == 'number') { - return value; + return value } if (isSymbol(value)) { - return NAN; + return NAN } - return +value; + return +value } -export default baseToNumber; +export default baseToNumber diff --git a/.internal/baseToString.js b/.internal/baseToString.js index 2e0a89811b..9c2aecfb88 100644 --- a/.internal/baseToString.js +++ b/.internal/baseToString.js @@ -1,12 +1,12 @@ -import arrayMap from './arrayMap.js'; -import isSymbol from '../isSymbol.js'; +import arrayMap from './arrayMap.js' +import isSymbol from '../isSymbol.js' /** Used as references for various `Number` constants. */ -const INFINITY = 1 / 0; +const INFINITY = 1 / 0 /** Used to convert symbols to primitives and strings. */ -const symbolProto = Symbol ? Symbol.prototype : undefined; -const symbolToString = symbolProto ? symbolProto.toString : undefined; +const symbolProto = Symbol ? Symbol.prototype : undefined +const symbolToString = symbolProto ? symbolProto.toString : undefined /** * The base implementation of `toString` which doesn't convert nullish @@ -19,17 +19,17 @@ const symbolToString = symbolProto ? symbolProto.toString : undefined; function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { - return value; + return value } if (Array.isArray(value)) { // Recursively convert values (susceptible to call stack limits). - return `${ arrayMap(value, baseToString) }`; + return `${ arrayMap(value, baseToString) }` } if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; + return symbolToString ? symbolToString.call(value) : '' } - const result = `${ value }`; - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + const result = `${ value }` + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result } -export default baseToString; +export default baseToString diff --git a/.internal/baseUniq.js b/.internal/baseUniq.js index 287da4d46a..48f1495b11 100644 --- a/.internal/baseUniq.js +++ b/.internal/baseUniq.js @@ -1,12 +1,12 @@ -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'; +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. */ -const LARGE_ARRAY_SIZE = 200; +const LARGE_ARRAY_SIZE = 200 /** * The base implementation of `uniqBy`. @@ -18,56 +18,56 @@ const LARGE_ARRAY_SIZE = 200; * @returns {Array} Returns the new duplicate free array. */ function baseUniq(array, iteratee, comparator) { - let index = -1; - let includes = arrayIncludes; - let isCommon = true; + let index = -1 + let includes = arrayIncludes + let isCommon = true - const length = array.length; - const result = []; - let seen = result; + const length = array.length + const result = [] + let seen = result if (comparator) { - isCommon = false; - includes = arrayIncludesWith; + isCommon = false + includes = arrayIncludesWith } else if (length >= LARGE_ARRAY_SIZE) { - const set = iteratee ? null : createSet(array); + const set = iteratee ? null : createSet(array) if (set) { - return setToArray(set); + return setToArray(set) } - isCommon = false; - includes = cacheHas; - seen = new SetCache; + isCommon = false + includes = cacheHas + seen = new SetCache } else { - seen = iteratee ? [] : result; + seen = iteratee ? [] : result } outer: while (++index < length) { - let value = array[index]; - const computed = iteratee ? iteratee(value) : value; + let value = array[index] + const computed = iteratee ? iteratee(value) : value - value = (comparator || value !== 0) ? value : 0; + value = (comparator || value !== 0) ? value : 0 if (isCommon && computed === computed) { - let seenIndex = seen.length; + let seenIndex = seen.length while (seenIndex--) { if (seen[seenIndex] === computed) { - continue outer; + continue outer } } if (iteratee) { - seen.push(computed); + seen.push(computed) } - result.push(value); + result.push(value) } else if (!includes(seen, computed, comparator)) { if (seen !== result) { - seen.push(computed); + seen.push(computed) } - result.push(value); + result.push(value) } } - return result; + return result } -export default baseUniq; +export default baseUniq diff --git a/.internal/baseUnset.js b/.internal/baseUnset.js index ff3d1c491f..85a929f98c 100644 --- a/.internal/baseUnset.js +++ b/.internal/baseUnset.js @@ -1,7 +1,7 @@ -import castPath from './castPath.js'; -import last from '../last.js'; -import parent from './parent.js'; -import toKey from './toKey.js'; +import castPath from './castPath.js' +import last from '../last.js' +import parent from './parent.js' +import toKey from './toKey.js' /** * The base implementation of `unset`. @@ -12,9 +12,9 @@ import toKey from './toKey.js'; * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ function baseUnset(object, path) { - path = castPath(path, object); - object = parent(object, path); - return object == null || delete object[toKey(last(path))]; + path = castPath(path, object) + object = parent(object, path) + return object == null || delete object[toKey(last(path))] } -export default baseUnset; +export default baseUnset diff --git a/.internal/baseUpdate.js b/.internal/baseUpdate.js index 57805f6c41..5ec057362a 100644 --- a/.internal/baseUpdate.js +++ b/.internal/baseUpdate.js @@ -1,5 +1,5 @@ -import baseGet from './baseGet.js'; -import baseSet from './baseSet.js'; +import baseGet from './baseGet.js' +import baseSet from './baseSet.js' /** * The base implementation of `update`. @@ -12,7 +12,7 @@ import baseSet from './baseSet.js'; * @returns {Object} Returns `object`. */ function baseUpdate(object, path, updater, customizer) { - return baseSet(object, path, updater(baseGet(object, path)), customizer); + return baseSet(object, path, updater(baseGet(object, path)), customizer) } -export default baseUpdate; +export default baseUpdate diff --git a/.internal/baseValues.js b/.internal/baseValues.js index f7039043fc..1ec119bc85 100644 --- a/.internal/baseValues.js +++ b/.internal/baseValues.js @@ -1,4 +1,4 @@ -import arrayMap from './arrayMap.js'; +import arrayMap from './arrayMap.js' /** * The base implementation of `values` and `valuesIn` which creates an @@ -11,7 +11,7 @@ import arrayMap from './arrayMap.js'; * @returns {Object} Returns the array of property values. */ function baseValues(object, props) { - return arrayMap(props, key => object[key]); + return arrayMap(props, key => object[key]) } -export default baseValues; +export default baseValues diff --git a/.internal/baseWhile.js b/.internal/baseWhile.js index db489bc670..15489105f4 100644 --- a/.internal/baseWhile.js +++ b/.internal/baseWhile.js @@ -1,4 +1,4 @@ -import baseSlice from './baseSlice.js'; +import baseSlice from './baseSlice.js' /** * The base implementation of methods like `dropWhile` and `takeWhile`. @@ -11,15 +11,15 @@ import baseSlice from './baseSlice.js'; * @returns {Array} Returns the slice of `array`. */ function baseWhile(array, predicate, isDrop, fromRight) { - const length = array.length; - let index = fromRight ? length : -1; + const length = array.length + let index = fromRight ? length : -1 while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) - : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)) } -export default baseWhile; +export default baseWhile diff --git a/.internal/baseWrapperValue.js b/.internal/baseWrapperValue.js index cc7e623ef4..0e4edbbdff 100644 --- a/.internal/baseWrapperValue.js +++ b/.internal/baseWrapperValue.js @@ -1,6 +1,6 @@ -import LazyWrapper from './LazyWrapper.js'; -import arrayPush from './arrayPush.js'; -import arrayReduce from './arrayReduce.js'; +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 @@ -13,11 +13,11 @@ import arrayReduce from './arrayReduce.js'; * @returns {*} Returns the resolved value. */ function baseWrapperValue(value, actions) { - let result = value; + let result = value if (result instanceof LazyWrapper) { - result = result.value(); + result = result.value() } - return arrayReduce(actions, (result, { func, thisArg, args }) => func.apply(thisArg, arrayPush([result], args)), result); + return arrayReduce(actions, (result, { func, thisArg, args }) => func.apply(thisArg, arrayPush([result], args)), result) } -export default baseWrapperValue; +export default baseWrapperValue diff --git a/.internal/baseXor.js b/.internal/baseXor.js index d74d0f7de4..c5df6568b1 100644 --- a/.internal/baseXor.js +++ b/.internal/baseXor.js @@ -1,6 +1,6 @@ -import baseDifference from './baseDifference.js'; -import baseFlatten from './baseFlatten.js'; -import baseUniq from './baseUniq.js'; +import baseDifference from './baseDifference.js' +import baseFlatten from './baseFlatten.js' +import baseUniq from './baseUniq.js' /** * The base implementation of methods like `xor` which accepts an array of @@ -13,24 +13,24 @@ import baseUniq from './baseUniq.js'; * @returns {Array} Returns the new array of values. */ function baseXor(arrays, iteratee, comparator) { - const length = arrays.length; + const length = arrays.length if (length < 2) { - return length ? baseUniq(arrays[0]) : []; + return length ? baseUniq(arrays[0]) : [] } - let index = -1; - const result = Array(length); + let index = -1 + const result = Array(length) while (++index < length) { - const array = arrays[index]; - let othIndex = -1; + const array = arrays[index] + let othIndex = -1 while (++othIndex < length) { if (othIndex != index) { - result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator) } } } - return baseUniq(baseFlatten(result, 1), iteratee, comparator); + return baseUniq(baseFlatten(result, 1), iteratee, comparator) } -export default baseXor; +export default baseXor diff --git a/.internal/baseZipObject.js b/.internal/baseZipObject.js index 723384d066..6cf4dc3e5f 100644 --- a/.internal/baseZipObject.js +++ b/.internal/baseZipObject.js @@ -8,16 +8,16 @@ * @returns {Object} Returns the new object. */ function baseZipObject(props, values, assignFunc) { - let index = -1; - const length = props.length; - const valsLength = values.length; - const result = {}; + let index = -1 + const length = props.length + const valsLength = values.length + const result = {} while (++index < length) { - const value = index < valsLength ? values[index] : undefined; - assignFunc(result, props[index], value); + const value = index < valsLength ? values[index] : undefined + assignFunc(result, props[index], value) } - return result; + return result } -export default baseZipObject; +export default baseZipObject diff --git a/.internal/cacheHas.js b/.internal/cacheHas.js index 374a886541..553369f50c 100644 --- a/.internal/cacheHas.js +++ b/.internal/cacheHas.js @@ -7,7 +7,7 @@ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function cacheHas(cache, key) { - return cache.has(key); + return cache.has(key) } -export default cacheHas; +export default cacheHas diff --git a/.internal/castArrayLikeObject.js b/.internal/castArrayLikeObject.js index 8d988abf75..9c120dc7cd 100644 --- a/.internal/castArrayLikeObject.js +++ b/.internal/castArrayLikeObject.js @@ -1,4 +1,4 @@ -import isArrayLikeObject from '../isArrayLikeObject.js'; +import isArrayLikeObject from '../isArrayLikeObject.js' /** * Casts `value` to an empty array if it's not an array like object. @@ -8,7 +8,7 @@ import isArrayLikeObject from '../isArrayLikeObject.js'; * @returns {Array|Object} Returns the cast array-like object. */ function castArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; + return isArrayLikeObject(value) ? value : [] } -export default castArrayLikeObject; +export default castArrayLikeObject diff --git a/.internal/castPath.js b/.internal/castPath.js index 8d08ff9134..b3c1ad504f 100644 --- a/.internal/castPath.js +++ b/.internal/castPath.js @@ -1,6 +1,6 @@ -import isKey from './isKey.js'; -import stringToPath from './stringToPath.js'; -import toString from '../toString.js'; +import isKey from './isKey.js' +import stringToPath from './stringToPath.js' +import toString from '../toString.js' /** * Casts `value` to a path array if it's not one. @@ -12,9 +12,9 @@ import toString from '../toString.js'; */ function castPath(value, object) { if (Array.isArray(value)) { - return value; + return value } - return isKey(value, object) ? [value] : stringToPath(toString(value)); + return isKey(value, object) ? [value] : stringToPath(toString(value)) } -export default castPath; +export default castPath diff --git a/.internal/castSlice.js b/.internal/castSlice.js index 0ba3c4f3b3..3630de9741 100644 --- a/.internal/castSlice.js +++ b/.internal/castSlice.js @@ -1,4 +1,4 @@ -import baseSlice from './baseSlice.js'; +import baseSlice from './baseSlice.js' /** * Casts `array` to a slice if it's needed. @@ -10,9 +10,9 @@ import baseSlice from './baseSlice.js'; * @returns {Array} Returns the cast slice. */ function castSlice(array, start, end) { - const length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); + const length = array.length + end = end === undefined ? length : end + return (!start && end >= length) ? array : baseSlice(array, start, end) } -export default castSlice; +export default castSlice diff --git a/.internal/charsEndIndex.js b/.internal/charsEndIndex.js index fc5549fff2..add260a9cf 100644 --- a/.internal/charsEndIndex.js +++ b/.internal/charsEndIndex.js @@ -1,4 +1,4 @@ -import baseIndexOf from './baseIndexOf.js'; +import baseIndexOf from './baseIndexOf.js' /** * Used by `trim` and `trimEnd` to get the index of the last string symbol @@ -10,10 +10,10 @@ import baseIndexOf from './baseIndexOf.js'; * @returns {number} Returns the index of the last unmatched string symbol. */ function charsEndIndex(strSymbols, chrSymbols) { - let index = strSymbols.length; + let index = strSymbols.length while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; + return index } -export default charsEndIndex; +export default charsEndIndex diff --git a/.internal/charsStartIndex.js b/.internal/charsStartIndex.js index 75a9726ef5..e8ad163faa 100644 --- a/.internal/charsStartIndex.js +++ b/.internal/charsStartIndex.js @@ -1,4 +1,4 @@ -import baseIndexOf from './baseIndexOf.js'; +import baseIndexOf from './baseIndexOf.js' /** * Used by `trim` and `trimStart` to get the index of the first string symbol @@ -10,11 +10,11 @@ import baseIndexOf from './baseIndexOf.js'; * @returns {number} Returns the index of the first unmatched string symbol. */ function charsStartIndex(strSymbols, chrSymbols) { - let index = -1; - const length = strSymbols.length; + let index = -1 + const length = strSymbols.length while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; + return index } -export default charsStartIndex; +export default charsStartIndex diff --git a/.internal/cloneArrayBuffer.js b/.internal/cloneArrayBuffer.js index e40976ac0f..8aff89edb6 100644 --- a/.internal/cloneArrayBuffer.js +++ b/.internal/cloneArrayBuffer.js @@ -6,9 +6,9 @@ * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { - const result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; + const result = new arrayBuffer.constructor(arrayBuffer.byteLength) + new Uint8Array(result).set(new Uint8Array(arrayBuffer)) + return result } -export default cloneArrayBuffer; +export default cloneArrayBuffer diff --git a/.internal/cloneBuffer.js b/.internal/cloneBuffer.js index 49c8ded51d..37b5241710 100644 --- a/.internal/cloneBuffer.js +++ b/.internal/cloneBuffer.js @@ -1,16 +1,16 @@ -import root from './root.js'; +import root from './root.js' /** Detect free variable `exports`. */ -const freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; +const freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports /** Detect free variable `module`. */ -const freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; +const freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module /** Detect the popular CommonJS extension `module.exports`. */ -const moduleExports = freeModule && freeModule.exports === freeExports; +const moduleExports = freeModule && freeModule.exports === freeExports /** Built-in value references. */ -const Buffer = moduleExports ? root.Buffer : undefined, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; +const Buffer = moduleExports ? root.Buffer : undefined, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined /** * Creates a clone of `buffer`. @@ -22,13 +22,13 @@ const Buffer = moduleExports ? root.Buffer : undefined, allocUnsafe = Buffer ? B */ function cloneBuffer(buffer, isDeep) { if (isDeep) { - return buffer.slice(); + return buffer.slice() } - const length = buffer.length; - const result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + const length = buffer.length + const result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length) - buffer.copy(result); - return result; + buffer.copy(result) + return result } -export default cloneBuffer; +export default cloneBuffer diff --git a/.internal/cloneDataView.js b/.internal/cloneDataView.js index 0667a55b19..8b2a2a241c 100644 --- a/.internal/cloneDataView.js +++ b/.internal/cloneDataView.js @@ -1,4 +1,4 @@ -import cloneArrayBuffer from './cloneArrayBuffer.js'; +import cloneArrayBuffer from './cloneArrayBuffer.js' /** * Creates a clone of `dataView`. @@ -9,8 +9,8 @@ import cloneArrayBuffer from './cloneArrayBuffer.js'; * @returns {Object} Returns the cloned data view. */ function cloneDataView(dataView, isDeep) { - const buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + const buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength) } -export default cloneDataView; +export default cloneDataView diff --git a/.internal/cloneMap.js b/.internal/cloneMap.js index 66acd32f28..5927d21772 100644 --- a/.internal/cloneMap.js +++ b/.internal/cloneMap.js @@ -1,9 +1,9 @@ -import addMapEntry from './addMapEntry.js'; -import arrayReduce from './arrayReduce.js'; -import mapToArray from './mapToArray.js'; +import addMapEntry from './addMapEntry.js' +import arrayReduce from './arrayReduce.js' +import mapToArray from './mapToArray.js' /** Used to compose bitmasks for cloning. */ -const CLONE_DEEP_FLAG = 1; +const CLONE_DEEP_FLAG = 1 /** * Creates a clone of `map`. @@ -15,8 +15,8 @@ const CLONE_DEEP_FLAG = 1; * @returns {Object} Returns the cloned map. */ function cloneMap(map, isDeep, cloneFunc) { - const array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map); - return arrayReduce(array, addMapEntry, new map.constructor); + const array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map) + return arrayReduce(array, addMapEntry, new map.constructor) } -export default cloneMap; +export default cloneMap diff --git a/.internal/cloneRegExp.js b/.internal/cloneRegExp.js index 1616a124c3..6552bc2be4 100644 --- a/.internal/cloneRegExp.js +++ b/.internal/cloneRegExp.js @@ -1,5 +1,5 @@ /** Used to match `RegExp` flags from their coerced string values. */ -const reFlags = /\w*$/; +const reFlags = /\w*$/ /** * Creates a clone of `regexp`. @@ -9,9 +9,9 @@ const reFlags = /\w*$/; * @returns {Object} Returns the cloned regexp. */ function cloneRegExp(regexp) { - const result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; + const result = new regexp.constructor(regexp.source, reFlags.exec(regexp)) + result.lastIndex = regexp.lastIndex + return result } -export default cloneRegExp; +export default cloneRegExp diff --git a/.internal/cloneSet.js b/.internal/cloneSet.js index e5d7bb2e6b..bb354d8e93 100644 --- a/.internal/cloneSet.js +++ b/.internal/cloneSet.js @@ -1,9 +1,9 @@ -import addSetEntry from './addSetEntry.js'; -import arrayReduce from './arrayReduce.js'; -import setToArray from './setToArray.js'; +import addSetEntry from './addSetEntry.js' +import arrayReduce from './arrayReduce.js' +import setToArray from './setToArray.js' /** Used to compose bitmasks for cloning. */ -const CLONE_DEEP_FLAG = 1; +const CLONE_DEEP_FLAG = 1 /** * Creates a clone of `set`. @@ -15,8 +15,8 @@ const CLONE_DEEP_FLAG = 1; * @returns {Object} Returns the cloned set. */ function cloneSet(set, isDeep, cloneFunc) { - const array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set); - return arrayReduce(array, addSetEntry, new set.constructor); + const array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set) + return arrayReduce(array, addSetEntry, new set.constructor) } -export default cloneSet; +export default cloneSet diff --git a/.internal/cloneSymbol.js b/.internal/cloneSymbol.js index b63ba4425c..229d4cee5b 100644 --- a/.internal/cloneSymbol.js +++ b/.internal/cloneSymbol.js @@ -1,5 +1,5 @@ /** Used to convert symbols to primitives and strings. */ -const symbolValueOf = Symbol.prototype.valueOf; +const symbolValueOf = Symbol.prototype.valueOf /** * Creates a clone of the `symbol` object. @@ -9,7 +9,7 @@ const symbolValueOf = Symbol.prototype.valueOf; * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {} } -export default cloneSymbol; +export default cloneSymbol diff --git a/.internal/cloneTypedArray.js b/.internal/cloneTypedArray.js index 4cd6e18037..62ddc3813e 100644 --- a/.internal/cloneTypedArray.js +++ b/.internal/cloneTypedArray.js @@ -1,4 +1,4 @@ -import cloneArrayBuffer from './cloneArrayBuffer.js'; +import cloneArrayBuffer from './cloneArrayBuffer.js' /** * Creates a clone of `typedArray`. @@ -9,8 +9,8 @@ import cloneArrayBuffer from './cloneArrayBuffer.js'; * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { - const buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + const buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length) } -export default cloneTypedArray; +export default cloneTypedArray diff --git a/.internal/compareAscending.js b/.internal/compareAscending.js index 1d1e87b79f..7ce2ffe633 100644 --- a/.internal/compareAscending.js +++ b/.internal/compareAscending.js @@ -1,4 +1,4 @@ -import isSymbol from '../isSymbol.js'; +import isSymbol from '../isSymbol.js' /** * Compares values to sort them in ascending order. @@ -10,32 +10,32 @@ import isSymbol from '../isSymbol.js'; */ function compareAscending(value, other) { if (value !== other) { - const valIsDefined = value !== undefined; - const valIsNull = value === null; - const valIsReflexive = value === value; - const valIsSymbol = isSymbol(value); + const valIsDefined = value !== undefined + const valIsNull = value === null + const valIsReflexive = value === value + const valIsSymbol = isSymbol(value) - const othIsDefined = other !== undefined; - const othIsNull = other === null; - const othIsReflexive = other === other; - const othIsSymbol = isSymbol(other); + const othIsDefined = other !== undefined + const othIsNull = other === null + const othIsReflexive = other === other + const othIsSymbol = isSymbol(other) if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || (valIsNull && othIsDefined && othIsReflexive) || (!valIsDefined && othIsReflexive) || !valIsReflexive) { - return 1; + return 1 } if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || (othIsNull && valIsDefined && valIsReflexive) || (!othIsDefined && valIsReflexive) || !othIsReflexive) { - return -1; + return -1 } } - return 0; + return 0 } -export default compareAscending; +export default compareAscending diff --git a/.internal/compareMultiple.js b/.internal/compareMultiple.js index f14e180f7e..81b7420576 100644 --- a/.internal/compareMultiple.js +++ b/.internal/compareMultiple.js @@ -1,4 +1,4 @@ -import compareAscending from './compareAscending.js'; +import compareAscending from './compareAscending.js' /** * Used by `orderBy` to compare multiple properties of a value to another @@ -15,20 +15,20 @@ import compareAscending from './compareAscending.js'; * @returns {number} Returns the sort order indicator for `object`. */ function compareMultiple(object, other, orders) { - let index = -1; - const objCriteria = object.criteria; - const othCriteria = other.criteria; - const length = objCriteria.length; - const ordersLength = orders.length; + let index = -1 + const objCriteria = object.criteria + const othCriteria = other.criteria + const length = objCriteria.length + const ordersLength = orders.length while (++index < length) { - const result = compareAscending(objCriteria[index], othCriteria[index]); + const result = compareAscending(objCriteria[index], othCriteria[index]) if (result) { if (index >= ordersLength) { - return result; + return result } - const order = orders[index]; - return result * (order == 'desc' ? -1 : 1); + const order = orders[index] + return result * (order == 'desc' ? -1 : 1) } } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications @@ -38,7 +38,7 @@ function compareMultiple(object, other, orders) { // // This also ensures a stable sort in V8 and other engines. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; + return object.index - other.index } -export default compareMultiple; +export default compareMultiple diff --git a/.internal/composeArgs.js b/.internal/composeArgs.js index 96a4464bab..f0c735326e 100644 --- a/.internal/composeArgs.js +++ b/.internal/composeArgs.js @@ -1,5 +1,5 @@ /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeMax = Math.max; +const nativeMax = Math.max /** * Creates an array that is the composition of partially applied arguments, @@ -13,29 +13,29 @@ const nativeMax = Math.max; * @returns {Array} Returns the new array of composed arguments. */ function composeArgs(args, partials, holders, isCurried) { - const argsLength = args.length; - const holdersLength = holders.length; - const leftLength = partials.length; + const argsLength = args.length + const holdersLength = holders.length + const leftLength = partials.length - let argsIndex = -1; - let leftIndex = -1; - let rangeLength = nativeMax(argsLength - holdersLength, 0); + let argsIndex = -1 + let leftIndex = -1 + let rangeLength = nativeMax(argsLength - holdersLength, 0) - const result = Array(leftLength + rangeLength); - const isUncurried = !isCurried; + const result = Array(leftLength + rangeLength) + const isUncurried = !isCurried while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; + result[leftIndex] = partials[leftIndex] } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { - result[holders[argsIndex]] = args[argsIndex]; + result[holders[argsIndex]] = args[argsIndex] } } while (rangeLength--) { - result[leftIndex++] = args[argsIndex++]; + result[leftIndex++] = args[argsIndex++] } - return result; + return result } -export default composeArgs; +export default composeArgs diff --git a/.internal/composeArgsRight.js b/.internal/composeArgsRight.js index 5c3660d374..0caaf4d440 100644 --- a/.internal/composeArgsRight.js +++ b/.internal/composeArgsRight.js @@ -1,5 +1,5 @@ /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeMax = Math.max; +const nativeMax = Math.max /** * This function is like `composeArgs` except that the arguments composition @@ -13,30 +13,30 @@ const nativeMax = Math.max; * @returns {Array} Returns the new array of composed arguments. */ function composeArgsRight(args, partials, holders, isCurried) { - let argsIndex = -1; - let holdersIndex = -1; - let rightIndex = -1; + let argsIndex = -1 + let holdersIndex = -1 + let rightIndex = -1 - const argsLength = args.length; - const holdersLength = holders.length; - const rightLength = partials.length; - const rangeLength = nativeMax(argsLength - holdersLength, 0); - const result = Array(rangeLength + rightLength); - const isUncurried = !isCurried; + const argsLength = args.length + const holdersLength = holders.length + const rightLength = partials.length + const rangeLength = nativeMax(argsLength - holdersLength, 0) + const result = Array(rangeLength + rightLength) + const isUncurried = !isCurried while (++argsIndex < rangeLength) { - result[argsIndex] = args[argsIndex]; + result[argsIndex] = args[argsIndex] } - const offset = argsIndex; + const offset = argsIndex while (++rightIndex < rightLength) { - result[offset + rightIndex] = partials[rightIndex]; + result[offset + rightIndex] = partials[rightIndex] } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; + result[offset + holders[holdersIndex]] = args[argsIndex++] } } - return result; + return result } -export default composeArgsRight; +export default composeArgsRight diff --git a/.internal/copyArray.js b/.internal/copyArray.js index 7968f3787f..cb7279bdd0 100644 --- a/.internal/copyArray.js +++ b/.internal/copyArray.js @@ -7,14 +7,14 @@ * @returns {Array} Returns `array`. */ function copyArray(source, array) { - let index = -1; - const length = source.length; + let index = -1 + const length = source.length - array || (array = Array(length)); + array || (array = Array(length)) while (++index < length) { - array[index] = source[index]; + array[index] = source[index] } - return array; + return array } -export default copyArray; +export default copyArray diff --git a/.internal/copyObject.js b/.internal/copyObject.js index beb9473eb3..86c01a8175 100644 --- a/.internal/copyObject.js +++ b/.internal/copyObject.js @@ -1,5 +1,5 @@ -import assignValue from './assignValue.js'; -import baseAssignValue from './baseAssignValue.js'; +import assignValue from './assignValue.js' +import baseAssignValue from './baseAssignValue.js' /** * Copies properties of `source` to `object`. @@ -12,29 +12,29 @@ import baseAssignValue from './baseAssignValue.js'; * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { - const isNew = !object; - object || (object = {}); + const isNew = !object + object || (object = {}) - let index = -1; - const length = props.length; + let index = -1 + const length = props.length while (++index < length) { - const key = props[index]; + const key = props[index] let newValue = customizer ? customizer(object[key], source[key], key, object, source) - : undefined; + : undefined if (newValue === undefined) { - newValue = source[key]; + newValue = source[key] } if (isNew) { - baseAssignValue(object, key, newValue); + baseAssignValue(object, key, newValue) } else { - assignValue(object, key, newValue); + assignValue(object, key, newValue) } } - return object; + return object } -export default copyObject; +export default copyObject diff --git a/.internal/copySymbols.js b/.internal/copySymbols.js index 4151833ff0..319562c79f 100644 --- a/.internal/copySymbols.js +++ b/.internal/copySymbols.js @@ -1,5 +1,5 @@ -import copyObject from './copyObject.js'; -import getSymbols from './getSymbols.js'; +import copyObject from './copyObject.js' +import getSymbols from './getSymbols.js' /** * Copies own symbols of `source` to `object`. @@ -10,7 +10,7 @@ import getSymbols from './getSymbols.js'; * @returns {Object} Returns `object`. */ function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); + return copyObject(source, getSymbols(source), object) } -export default copySymbols; +export default copySymbols diff --git a/.internal/copySymbolsIn.js b/.internal/copySymbolsIn.js index 5cb0179b7d..30ba034bce 100644 --- a/.internal/copySymbolsIn.js +++ b/.internal/copySymbolsIn.js @@ -1,5 +1,5 @@ -import copyObject from './copyObject.js'; -import getSymbolsIn from './getSymbolsIn.js'; +import copyObject from './copyObject.js' +import getSymbolsIn from './getSymbolsIn.js' /** * Copies own and inherited symbols of `source` to `object`. @@ -10,7 +10,7 @@ import getSymbolsIn from './getSymbolsIn.js'; * @returns {Object} Returns `object`. */ function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); + return copyObject(source, getSymbolsIn(source), object) } -export default copySymbolsIn; +export default copySymbolsIn diff --git a/.internal/countHolders.js b/.internal/countHolders.js index c5bce50d03..289c7c64ae 100644 --- a/.internal/countHolders.js +++ b/.internal/countHolders.js @@ -7,15 +7,15 @@ * @returns {number} Returns the placeholder count. */ function countHolders(array, placeholder) { - let length = array.length; - let result = 0; + let length = array.length + let result = 0 while (length--) { if (array[length] === placeholder) { - ++result; + ++result } } - return result; + return result } -export default countHolders; +export default countHolders diff --git a/.internal/createCaseFirst.js b/.internal/createCaseFirst.js index 632fd9dfc7..3f72a51af8 100644 --- a/.internal/createCaseFirst.js +++ b/.internal/createCaseFirst.js @@ -1,7 +1,7 @@ -import castSlice from './castSlice.js'; -import hasUnicode from './hasUnicode.js'; -import stringToArray from './stringToArray.js'; -import toString from '../toString.js'; +import castSlice from './castSlice.js' +import hasUnicode from './hasUnicode.js' +import stringToArray from './stringToArray.js' +import toString from '../toString.js' /** * Creates a function like `lowerFirst`. @@ -12,22 +12,22 @@ import toString from '../toString.js'; */ function createCaseFirst(methodName) { return string => { - string = toString(string); + string = toString(string) const strSymbols = hasUnicode(string) ? stringToArray(string) - : undefined; + : undefined const chr = strSymbols ? strSymbols[0] - : string[0]; + : string[0] const trailing = strSymbols ? castSlice(strSymbols, 1).join('') - : string.slice(1); + : string.slice(1) - return chr[methodName]() + trailing; - }; + return chr[methodName]() + trailing + } } -export default createCaseFirst; +export default createCaseFirst diff --git a/.internal/createCompounder.js b/.internal/createCompounder.js index 59e418fd13..4b9b889368 100644 --- a/.internal/createCompounder.js +++ b/.internal/createCompounder.js @@ -1,9 +1,9 @@ -import arrayReduce from './arrayReduce.js'; -import toString from '../toString.js'; -import words from '../words.js'; +import arrayReduce from './arrayReduce.js' +import toString from '../toString.js' +import words from '../words.js' /** Used to match apostrophes. */ -const reApos = /['\u2019]/g; +const reApos = /['\u2019]/g /** * Creates a function like `camelCase`. @@ -15,7 +15,7 @@ const reApos = /['\u2019]/g; function createCompounder(callback) { return string => ( arrayReduce(words(toString(string).replace(reApos, '')), callback, '') - ); + ) } -export default createCompounder; +export default createCompounder diff --git a/.internal/createCtor.js b/.internal/createCtor.js index 8e4b82c81b..0e42be188c 100644 --- a/.internal/createCtor.js +++ b/.internal/createCtor.js @@ -1,5 +1,5 @@ -import baseCreate from './baseCreate.js'; -import isObject from '../isObject.js'; +import baseCreate from './baseCreate.js' +import isObject from '../isObject.js' /** * Creates a function that produces an instance of `Ctor` regardless of @@ -15,22 +15,22 @@ function createCtor(Ctor) { // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + case 0: return new Ctor + case 1: return new Ctor(args[0]) + case 2: return new Ctor(args[0], args[1]) + case 3: return new Ctor(args[0], args[1], args[2]) + case 4: return new Ctor(args[0], args[1], args[2], args[3]) + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]) + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]) + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]) } - const thisBinding = baseCreate(Ctor.prototype); - const result = Ctor.apply(thisBinding, args); + const thisBinding = baseCreate(Ctor.prototype) + const result = Ctor.apply(thisBinding, args) // Mimic the constructor's `return` behavior. // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; + return isObject(result) ? result : thisBinding + } } -export default createCtor; +export default createCtor diff --git a/.internal/createMathOperation.js b/.internal/createMathOperation.js index bd035cd207..80245a81b4 100644 --- a/.internal/createMathOperation.js +++ b/.internal/createMathOperation.js @@ -1,5 +1,5 @@ -import baseToNumber from './baseToNumber.js'; -import baseToString from './baseToString.js'; +import baseToNumber from './baseToNumber.js' +import baseToString from './baseToString.js' /** * Creates a function that performs a mathematical operation on two values. @@ -11,28 +11,28 @@ import baseToString from './baseToString.js'; */ function createMathOperation(operator, defaultValue) { return (value, other) => { - let result; + let result if (value === undefined && other === undefined) { - return defaultValue; + return defaultValue } if (value !== undefined) { - result = value; + result = value } if (other !== undefined) { if (result === undefined) { - return other; + return other } if (typeof value == 'string' || typeof other == 'string') { - value = baseToString(value); - other = baseToString(other); + value = baseToString(value) + other = baseToString(other) } else { - value = baseToNumber(value); - other = baseToNumber(other); + value = baseToNumber(value) + other = baseToNumber(other) } - result = operator(value, other); + result = operator(value, other) } - return result; - }; + return result + } } -export default createMathOperation; +export default createMathOperation diff --git a/.internal/createPadding.js b/.internal/createPadding.js index f2ffb2ed2e..3579cc2c29 100644 --- a/.internal/createPadding.js +++ b/.internal/createPadding.js @@ -1,12 +1,12 @@ -import baseRepeat from './baseRepeat.js'; -import baseToString from './baseToString.js'; -import castSlice from './castSlice.js'; -import hasUnicode from './hasUnicode.js'; -import stringSize from './stringSize.js'; -import stringToArray from './stringToArray.js'; +import baseRepeat from './baseRepeat.js' +import baseToString from './baseToString.js' +import castSlice from './castSlice.js' +import hasUnicode from './hasUnicode.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. */ -const nativeCeil = Math.ceil; +const nativeCeil = Math.ceil /** * Creates the padding for `string` based on `length`. The `chars` string @@ -18,16 +18,16 @@ const nativeCeil = Math.ceil; * @returns {string} Returns the padding for `string`. */ function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); + chars = chars === undefined ? ' ' : baseToString(chars) - const charsLength = chars.length; + const charsLength = chars.length if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; + return charsLength ? baseRepeat(chars, length) : chars } - const result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + const result = baseRepeat(chars, nativeCeil(length / stringSize(chars))) return hasUnicode(chars) ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); + : result.slice(0, length) } -export default createPadding; +export default createPadding diff --git a/.internal/createRange.js b/.internal/createRange.js index 92418ab0ae..9e1525f280 100644 --- a/.internal/createRange.js +++ b/.internal/createRange.js @@ -1,6 +1,6 @@ -import baseRange from './baseRange.js'; -import isIterateeCall from './isIterateeCall.js'; -import toFinite from '../toFinite.js'; +import baseRange from './baseRange.js' +import isIterateeCall from './isIterateeCall.js' +import toFinite from '../toFinite.js' /** * Creates a `range` or `rangeRight` function. @@ -12,19 +12,19 @@ import toFinite from '../toFinite.js'; function createRange(fromRight) { return (start, end, step) => { if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { - end = step = undefined; + end = step = undefined } // Ensure the sign of `-0` is preserved. - start = toFinite(start); + start = toFinite(start) if (end === undefined) { - end = start; - start = 0; + end = start + start = 0 } else { - end = toFinite(end); + end = toFinite(end) } - step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); - return baseRange(start, end, step, fromRight); - }; + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step) + return baseRange(start, end, step, fromRight) + } } -export default createRange; +export default createRange diff --git a/.internal/createRound.js b/.internal/createRound.js index de2fb5e6cc..c8b9c85752 100644 --- a/.internal/createRound.js +++ b/.internal/createRound.js @@ -1,6 +1,6 @@ -import toInteger from '../toInteger.js'; -import toNumber from '../toNumber.js'; -import toString from '../toString.js'; +import toInteger from '../toInteger.js' +import toNumber from '../toNumber.js' +import toString from '../toString.js' /** * Creates a function like `round`. @@ -10,21 +10,21 @@ import toString from '../toString.js'; * @returns {Function} Returns the new round function. */ function createRound(methodName) { - const func = Math[methodName]; + const func = Math[methodName] return (number, precision) => { - number = toNumber(number); - precision = precision == null ? 0 : Math.min(toInteger(precision), 292); + number = toNumber(number) + precision = precision == null ? 0 : Math.min(toInteger(precision), 292) if (precision) { // Shift with exponential notation to avoid floating-point issues. // See [MDN](https://mdn.io/round#Examples) for more details. - let pair = `${ toString(number) }e`.split('e'); - const value = func(`${ pair[0] }e${ +pair[1] + precision }`); + let pair = `${ toString(number) }e`.split('e') + const value = func(`${ pair[0] }e${ +pair[1] + precision }`) - pair = `${ toString(value) }e`.split('e'); - return +`${ pair[0] }e${ +pair[1] - precision }`; + pair = `${ toString(value) }e`.split('e') + return +`${ pair[0] }e${ +pair[1] - precision }` } - return func(number); - }; + return func(number) + } } -export default createRound; +export default createRound diff --git a/.internal/createSet.js b/.internal/createSet.js index e835c15e3e..bb624bd2b9 100644 --- a/.internal/createSet.js +++ b/.internal/createSet.js @@ -1,7 +1,7 @@ -import setToArray from './setToArray.js'; +import setToArray from './setToArray.js' /** Used as references for various `Number` constants. */ -const INFINITY = 1 / 0; +const INFINITY = 1 / 0 /** * Creates a set object of `values`. @@ -12,6 +12,6 @@ const INFINITY = 1 / 0; */ const createSet = (Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? values => new Set(values) - : () => {}; + : () => {} -export default createSet; +export default createSet diff --git a/.internal/customDefaultsAssignIn.js b/.internal/customDefaultsAssignIn.js index 51abe80c76..5ff8e9a824 100644 --- a/.internal/customDefaultsAssignIn.js +++ b/.internal/customDefaultsAssignIn.js @@ -1,10 +1,10 @@ -import eq from '../eq.js'; +import eq from '../eq.js' /** Used for built-in method references. */ -const objectProto = Object.prototype; +const objectProto = Object.prototype /** Used to check objects for own properties. */ -const hasOwnProperty = objectProto.hasOwnProperty; +const hasOwnProperty = objectProto.hasOwnProperty /** * Used by `defaults` to customize its `assignIn` use to assign properties @@ -21,9 +21,9 @@ const hasOwnProperty = objectProto.hasOwnProperty; function customDefaultsAssignIn(objValue, srcValue, key, object) { if (objValue === undefined || (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { - return srcValue; + return srcValue } - return objValue; + return objValue } -export default customDefaultsAssignIn; +export default customDefaultsAssignIn diff --git a/.internal/customDefaultsMerge.js b/.internal/customDefaultsMerge.js index 5ebb41f297..7a14251e38 100644 --- a/.internal/customDefaultsMerge.js +++ b/.internal/customDefaultsMerge.js @@ -1,5 +1,5 @@ -import baseMerge from './baseMerge.js'; -import isObject from '../isObject.js'; +import baseMerge from './baseMerge.js' +import isObject from '../isObject.js' /** * Used by `defaultsDeep` to customize its `merge` use to merge source @@ -18,11 +18,11 @@ import isObject from '../isObject.js'; function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); - stack['delete'](srcValue); + stack.set(srcValue, objValue) + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack) + stack['delete'](srcValue) } - return objValue; + return objValue } -export default customDefaultsMerge; +export default customDefaultsMerge diff --git a/.internal/deburrLetter.js b/.internal/deburrLetter.js index c477a04985..fef37ad1a1 100644 --- a/.internal/deburrLetter.js +++ b/.internal/deburrLetter.js @@ -1,4 +1,4 @@ -import basePropertyOf from './basePropertyOf.js'; +import basePropertyOf from './basePropertyOf.js' /** Used to map Latin Unicode letters to basic Latin letters. */ const deburredLetters = { @@ -56,7 +56,7 @@ const deburredLetters = { '\u0132': 'IJ', '\u0133': 'ij', '\u0152': 'Oe', '\u0153': 'oe', '\u0149': "'n", '\u017f': 's' -}; +} /** * Used by `deburr` to convert Latin-1 Supplement and Latin Extended-A @@ -66,6 +66,6 @@ const deburredLetters = { * @param {string} letter The matched letter to deburr. * @returns {string} Returns the deburred letter. */ -const deburrLetter = basePropertyOf(deburredLetters); +const deburrLetter = basePropertyOf(deburredLetters) -export default deburrLetter; +export default deburrLetter diff --git a/.internal/equalArrays.js b/.internal/equalArrays.js index 2e07a651ab..9b36458216 100644 --- a/.internal/equalArrays.js +++ b/.internal/equalArrays.js @@ -1,10 +1,10 @@ -import SetCache from './SetCache.js'; -import arraySome from './arraySome.js'; -import cacheHas from './cacheHas.js'; +import SetCache from './SetCache.js' +import arraySome from './arraySome.js' +import cacheHas from './cacheHas.js' /** Used to compose bitmasks for value comparisons. */ -const COMPARE_PARTIAL_FLAG = 1; -const COMPARE_UNORDERED_FLAG = 2; +const COMPARE_PARTIAL_FLAG = 1 +const COMPARE_UNORDERED_FLAG = 2 /** * A specialized version of `baseIsEqualDeep` for arrays with support for @@ -20,65 +20,65 @@ const COMPARE_UNORDERED_FLAG = 2; * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - const isPartial = bitmask & COMPARE_PARTIAL_FLAG; - const arrLength = array.length; - const othLength = other.length; + const isPartial = bitmask & COMPARE_PARTIAL_FLAG + const arrLength = array.length + const othLength = other.length if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; + return false } // Assume cyclic values are equal. - const stacked = stack.get(array); + const stacked = stack.get(array) if (stacked && stack.get(other)) { - return stacked == other; + return stacked == other } - let index = -1; - let result = true; - const seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + let index = -1 + let result = true + const seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined - stack.set(array, other); - stack.set(other, array); + stack.set(array, other) + stack.set(other, array) // Ignore non-index properties. while (++index < arrLength) { - let compared; - const arrValue = array[index]; - const othValue = other[index]; + let compared + const arrValue = array[index] + const othValue = other[index] if (customizer) { compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); + : customizer(arrValue, othValue, index, array, other, stack) } if (compared !== undefined) { if (compared) { - continue; + continue } - result = false; - break; + result = false + break } // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!arraySome(other, (othValue, othIndex) => { if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - return seen.push(othIndex); + return seen.push(othIndex) } })) { - result = false; - break; + result = false + break } } else if (!( arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack) )) { - result = false; - break; + result = false + break } } - stack['delete'](array); - stack['delete'](other); - return result; + stack['delete'](array) + stack['delete'](other) + return result } -export default equalArrays; +export default equalArrays diff --git a/.internal/equalByTag.js b/.internal/equalByTag.js index 59a8010065..204cb4067b 100644 --- a/.internal/equalByTag.js +++ b/.internal/equalByTag.js @@ -1,29 +1,29 @@ -import eq from '../eq.js'; -import equalArrays from './equalArrays.js'; -import mapToArray from './mapToArray.js'; -import setToArray from './setToArray.js'; +import eq from '../eq.js' +import equalArrays from './equalArrays.js' +import mapToArray from './mapToArray.js' +import setToArray from './setToArray.js' /** Used to compose bitmasks for value comparisons. */ -const COMPARE_PARTIAL_FLAG = 1; -const COMPARE_UNORDERED_FLAG = 2; +const COMPARE_PARTIAL_FLAG = 1 +const COMPARE_UNORDERED_FLAG = 2 /** `Object#toString` result references. */ -const boolTag = '[object Boolean]'; -const dateTag = '[object Date]'; -const errorTag = '[object Error]'; -const mapTag = '[object Map]'; -const numberTag = '[object Number]'; -const regexpTag = '[object RegExp]'; -const setTag = '[object Set]'; -const stringTag = '[object String]'; -const symbolTag = '[object Symbol]'; +const boolTag = '[object Boolean]' +const dateTag = '[object Date]' +const errorTag = '[object Error]' +const mapTag = '[object Map]' +const numberTag = '[object Number]' +const regexpTag = '[object RegExp]' +const setTag = '[object Set]' +const stringTag = '[object String]' +const symbolTag = '[object Symbol]' -const arrayBufferTag = '[object ArrayBuffer]'; -const dataViewTag = '[object DataView]'; +const arrayBufferTag = '[object ArrayBuffer]' +const dataViewTag = '[object DataView]' /** Used to convert symbols to primitives and strings. */ -const symbolProto = Symbol ? Symbol.prototype : undefined; -const symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; +const symbolProto = Symbol ? Symbol.prototype : undefined +const symbolValueOf = symbolProto ? symbolProto.valueOf : undefined /** * A specialized version of `baseIsEqualDeep` for comparing objects of @@ -47,64 +47,64 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { case dataViewTag: if ((object.byteLength != other.byteLength) || (object.byteOffset != other.byteOffset)) { - return false; + return false } - object = object.buffer; - other = other.buffer; + object = object.buffer + other = other.buffer case arrayBufferTag: if ((object.byteLength != other.byteLength) || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; + return false } - return true; + return true case boolTag: case dateTag: case numberTag: // Coerce booleans to `1` or `0` and dates to milliseconds. // Invalid dates are coerced to `NaN`. - return eq(+object, +other); + return eq(+object, +other) case errorTag: - return object.name == other.name && object.message == other.message; + return object.name == other.name && object.message == other.message case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. - return object == `${ other }`; + return object == `${ other }` case mapTag: - let convert = mapToArray; + let convert = mapToArray case setTag: - const isPartial = bitmask & COMPARE_PARTIAL_FLAG; - convert || (convert = setToArray); + const isPartial = bitmask & COMPARE_PARTIAL_FLAG + convert || (convert = setToArray) if (object.size != other.size && !isPartial) { - return false; + return false } // Assume cyclic values are equal. - const stacked = stack.get(object); + const stacked = stack.get(object) if (stacked) { - return stacked == other; + return stacked == other } - bitmask |= COMPARE_UNORDERED_FLAG; + bitmask |= COMPARE_UNORDERED_FLAG // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - const result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); - stack['delete'](object); - return result; + stack.set(object, other) + const result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack) + stack['delete'](object) + return result case symbolTag: if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); + return symbolValueOf.call(object) == symbolValueOf.call(other) } } - return false; + return false } -export default equalByTag; +export default equalByTag diff --git a/.internal/equalObjects.js b/.internal/equalObjects.js index 715046c0b8..200f8cae7a 100644 --- a/.internal/equalObjects.js +++ b/.internal/equalObjects.js @@ -1,10 +1,10 @@ -import getAllKeys from './getAllKeys.js'; +import getAllKeys from './getAllKeys.js' /** Used to compose bitmasks for value comparisons. */ -const COMPARE_PARTIAL_FLAG = 1; +const COMPARE_PARTIAL_FLAG = 1 /** Used to check objects for own properties. */ -const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwnProperty = Object.prototype.hasOwnProperty /** * A specialized version of `baseIsEqualDeep` for objects with support for @@ -20,69 +20,69 @@ const hasOwnProperty = Object.prototype.hasOwnProperty; * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { - const isPartial = bitmask & COMPARE_PARTIAL_FLAG; - const objProps = getAllKeys(object); - const objLength = objProps.length; - const othProps = getAllKeys(other); - const othLength = othProps.length; + const isPartial = bitmask & COMPARE_PARTIAL_FLAG + const objProps = getAllKeys(object) + const objLength = objProps.length + const othProps = getAllKeys(other) + const othLength = othProps.length if (objLength != othLength && !isPartial) { - return false; + return false } - let key; - let index = objLength; + let key + let index = objLength while (index--) { - key = objProps[index]; + key = objProps[index] if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; + return false } } // Assume cyclic values are equal. - const stacked = stack.get(object); + const stacked = stack.get(object) if (stacked && stack.get(other)) { - return stacked == other; + return stacked == other } - let result = true; - stack.set(object, other); - stack.set(other, object); + let result = true + stack.set(object, other) + stack.set(other, object) - let compared; - let skipCtor = isPartial; + let compared + let skipCtor = isPartial while (++index < objLength) { - key = objProps[index]; - const objValue = object[key]; - const othValue = other[key]; + key = objProps[index] + const objValue = object[key] + const othValue = other[key] if (customizer) { compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); + : customizer(objValue, othValue, key, object, other, stack) } // Recursively compare objects (susceptible to call stack limits). if (!(compared === undefined ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) : compared )) { - result = false; - break; + result = false + break } - skipCtor || (skipCtor = key == 'constructor'); + skipCtor || (skipCtor = key == 'constructor') } if (result && !skipCtor) { - const objCtor = object.constructor; - const othCtor = other.constructor; + const objCtor = object.constructor + const othCtor = other.constructor // Non `Object` object instances with different constructors are not equal. if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; + result = false } } - stack['delete'](object); - stack['delete'](other); - return result; + stack['delete'](object) + stack['delete'](other) + return result } -export default equalObjects; +export default equalObjects diff --git a/.internal/freeGlobal.js b/.internal/freeGlobal.js index a2e2e1735b..ef2e2da475 100644 --- a/.internal/freeGlobal.js +++ b/.internal/freeGlobal.js @@ -1,4 +1,4 @@ /** Detect free variable `global` from Node.js. */ -const freeGlobal = typeof global == 'object' && global && global.Object === Object && global; +const freeGlobal = typeof global == 'object' && global && global.Object === Object && global -export default freeGlobal; +export default freeGlobal diff --git a/.internal/getAllKeys.js b/.internal/getAllKeys.js index f8965fb764..eadc6aec18 100644 --- a/.internal/getAllKeys.js +++ b/.internal/getAllKeys.js @@ -1,5 +1,5 @@ -import getSymbols from './getSymbols.js'; -import keys from '../keys.js'; +import getSymbols from './getSymbols.js' +import keys from '../keys.js' /** * Creates an array of own enumerable property names and symbols of `object`. @@ -9,8 +9,8 @@ import keys from '../keys.js'; * @returns {Array} Returns the array of property names and symbols. */ function getAllKeys(object) { - const result = keys(object); - return Array.isArray(object) ? result : arrayPush(result, getSymbols(object)); + const result = keys(object) + return Array.isArray(object) ? result : arrayPush(result, getSymbols(object)) } -export default getAllKeys; +export default getAllKeys diff --git a/.internal/getAllKeysIn.js b/.internal/getAllKeysIn.js index d6219038e0..a6f6a63103 100644 --- a/.internal/getAllKeysIn.js +++ b/.internal/getAllKeysIn.js @@ -1,5 +1,5 @@ -import getSymbolsIn from './getSymbolsIn.js'; -import keysIn from '../keysIn.js'; +import getSymbolsIn from './getSymbolsIn.js' +import keysIn from '../keysIn.js' /** * Creates an array of own and inherited enumerable property names and @@ -10,8 +10,8 @@ import keysIn from '../keysIn.js'; * @returns {Array} Returns the array of property names and symbols. */ function getAllKeysIn(object) { - const result = keysIn(object); - return Array.isArray(object) ? result : arrayPush(result, getSymbolsIn(object)); + const result = keysIn(object) + return Array.isArray(object) ? result : arrayPush(result, getSymbolsIn(object)) } -export default getAllKeysIn; +export default getAllKeysIn diff --git a/.internal/getHolder.js b/.internal/getHolder.js index 1e4ce3ecc8..d63e905016 100644 --- a/.internal/getHolder.js +++ b/.internal/getHolder.js @@ -6,8 +6,8 @@ * @returns {*} Returns the placeholder value. */ function getHolder(func) { - const object = func; - return object.placeholder; + const object = func + return object.placeholder } -export default getHolder; +export default getHolder diff --git a/.internal/getMatchData.js b/.internal/getMatchData.js index 3d35d579b4..baf1b5f28e 100644 --- a/.internal/getMatchData.js +++ b/.internal/getMatchData.js @@ -1,5 +1,5 @@ -import isStrictComparable from './isStrictComparable.js'; -import keys from '../keys.js'; +import isStrictComparable from './isStrictComparable.js' +import keys from '../keys.js' /** * Gets the property names, values, and compare flags of `object`. @@ -9,15 +9,15 @@ import keys from '../keys.js'; * @returns {Array} Returns the match data of `object`. */ function getMatchData(object) { - const result = keys(object); - let length = result.length; + const result = keys(object) + let length = result.length while (length--) { - const key = result[length]; - const value = object[key]; - result[length] = [key, value, isStrictComparable(value)]; + const key = result[length] + const value = object[key] + result[length] = [key, value, isStrictComparable(value)] } - return result; + return result } -export default getMatchData; +export default getMatchData diff --git a/.internal/getRawTag.js b/.internal/getRawTag.js index 627678e5b7..0b8c7165e7 100644 --- a/.internal/getRawTag.js +++ b/.internal/getRawTag.js @@ -1,18 +1,18 @@ /** Used for built-in method references. */ -const objectProto = Object.prototype; +const objectProto = Object.prototype /** Used to check objects for own properties. */ -const hasOwnProperty = objectProto.hasOwnProperty; +const hasOwnProperty = objectProto.hasOwnProperty /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ -const nativeObjectToString = objectProto.toString; +const nativeObjectToString = objectProto.toString /** Built-in value references. */ -const symToStringTag = Symbol ? Symbol.toStringTag : undefined; +const symToStringTag = Symbol ? Symbol.toStringTag : undefined /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. @@ -22,24 +22,24 @@ const symToStringTag = Symbol ? Symbol.toStringTag : undefined; * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { - const isOwn = hasOwnProperty.call(value, symToStringTag); - const tag = value[symToStringTag]; - let unmasked = false; + const isOwn = hasOwnProperty.call(value, symToStringTag) + const tag = value[symToStringTag] + let unmasked = false try { - value[symToStringTag] = undefined; - unmasked = true; + value[symToStringTag] = undefined + unmasked = true } catch (e) {} - const result = nativeObjectToString.call(value); + const result = nativeObjectToString.call(value) if (unmasked) { if (isOwn) { - value[symToStringTag] = tag; + value[symToStringTag] = tag } else { - delete value[symToStringTag]; + delete value[symToStringTag] } } - return result; + return result } -export default getRawTag; +export default getRawTag diff --git a/.internal/getSymbols.js b/.internal/getSymbols.js index d3b22397fb..c1e97e7343 100644 --- a/.internal/getSymbols.js +++ b/.internal/getSymbols.js @@ -1,11 +1,11 @@ -import arrayFilter from './arrayFilter.js'; -import stubArray from '../stubArray.js'; +import arrayFilter from './arrayFilter.js' +import stubArray from '../stubArray.js' /** Built-in value references. */ -const propertyIsEnumerable = Object.prototype.propertyIsEnumerable; +const propertyIsEnumerable = Object.prototype.propertyIsEnumerable /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeGetSymbols = Object.getOwnPropertySymbols; +const nativeGetSymbols = Object.getOwnPropertySymbols /** * Creates an array of the own enumerable symbols of `object`. @@ -16,10 +16,10 @@ const nativeGetSymbols = Object.getOwnPropertySymbols; */ const getSymbols = !nativeGetSymbols ? stubArray : object => { if (object == null) { - return []; + return [] } - object = Object(object); - return arrayFilter(nativeGetSymbols(object), symbol => propertyIsEnumerable.call(object, symbol)); -}; + object = Object(object) + return arrayFilter(nativeGetSymbols(object), symbol => propertyIsEnumerable.call(object, symbol)) +} -export default getSymbols; +export default getSymbols diff --git a/.internal/getSymbolsIn.js b/.internal/getSymbolsIn.js index 14d568e5e2..f1a0af8ca3 100644 --- a/.internal/getSymbolsIn.js +++ b/.internal/getSymbolsIn.js @@ -1,9 +1,9 @@ -import arrayPush from './arrayPush.js'; -import getSymbols from './getSymbols.js'; -import stubArray from '../stubArray.js'; +import arrayPush from './arrayPush.js' +import getSymbols from './getSymbols.js' +import stubArray from '../stubArray.js' /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeGetSymbols = Object.getOwnPropertySymbols; +const nativeGetSymbols = Object.getOwnPropertySymbols /** * Creates an array of the own and inherited enumerable symbols of `object`. @@ -13,12 +13,12 @@ const nativeGetSymbols = Object.getOwnPropertySymbols; * @returns {Array} Returns the array of symbols. */ const getSymbolsIn = !nativeGetSymbols ? stubArray : object => { - const result = []; + const result = [] while (object) { - arrayPush(result, getSymbols(object)); - object = Object.getPrototypeOf(Object(object)); + arrayPush(result, getSymbols(object)) + object = Object.getPrototypeOf(Object(object)) } - return result; -}; + return result +} -export default getSymbolsIn; +export default getSymbolsIn diff --git a/.internal/getTag.js b/.internal/getTag.js index 3f292c9fda..98a444f605 100644 --- a/.internal/getTag.js +++ b/.internal/getTag.js @@ -1,20 +1,20 @@ -import baseGetTag from './baseGetTag.js'; -import toSource from './toSource.js'; +import baseGetTag from './baseGetTag.js' +import toSource from './toSource.js' /** `Object#toString` result references. */ -const dataViewTag = '[object DataView]'; -const mapTag = '[object Map]'; -const objectTag = '[object Object]'; -const promiseTag = '[object Promise]'; -const setTag = '[object Set]'; -const weakMapTag = '[object WeakMap]'; +const dataViewTag = '[object DataView]' +const mapTag = '[object Map]' +const objectTag = '[object Object]' +const promiseTag = '[object Promise]' +const setTag = '[object Set]' +const weakMapTag = '[object WeakMap]' /** Used to detect maps, sets, and weakmaps. */ -const dataViewCtorString = toSource(DataView); -const mapCtorString = toSource(Map); -const promiseCtorString = toSource(Promise); -const setCtorString = toSource(Set); -const weakMapCtorString = toSource(WeakMap); +const dataViewCtorString = toSource(DataView) +const mapCtorString = toSource(Map) +const promiseCtorString = toSource(Promise) +const setCtorString = toSource(Set) +const weakMapCtorString = toSource(WeakMap) /** * Gets the `toStringTag` of `value`. @@ -23,7 +23,7 @@ const weakMapCtorString = toSource(WeakMap); * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ -let getTag = baseGetTag; +let getTag = baseGetTag // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || @@ -32,21 +32,21 @@ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (getTag(new Set) != setTag) || (getTag(new WeakMap) != weakMapTag)) { getTag = value => { - const result = baseGetTag(value); - const Ctor = result == objectTag ? value.constructor : undefined; - const ctorString = Ctor ? toSource(Ctor) : ''; + const result = baseGetTag(value) + const Ctor = result == objectTag ? value.constructor : undefined + const ctorString = Ctor ? toSource(Ctor) : '' if (ctorString) { switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; + case dataViewCtorString: return dataViewTag + case mapCtorString: return mapTag + case promiseCtorString: return promiseTag + case setCtorString: return setTag + case weakMapCtorString: return weakMapTag } } - return result; - }; + return result + } } -export default getTag; +export default getTag diff --git a/.internal/hasPath.js b/.internal/hasPath.js index 3b3e7182b5..20e3f6bf9f 100644 --- a/.internal/hasPath.js +++ b/.internal/hasPath.js @@ -1,8 +1,8 @@ -import castPath from './castPath.js'; -import isArguments from '../isArguments.js'; -import isIndex from './isIndex.js'; -import isLength from '../isLength.js'; -import toKey from './toKey.js'; +import castPath from './castPath.js' +import isArguments from '../isArguments.js' +import isIndex from './isIndex.js' +import isLength from '../isLength.js' +import toKey from './toKey.js' /** * Checks if `path` exists on `object`. @@ -14,26 +14,26 @@ import toKey from './toKey.js'; * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { - path = castPath(path, object); + path = castPath(path, object) - let key; - let index = -1; - let length = path.length; - let result = false; + let key + let index = -1 + let length = path.length + let result = false while (++index < length) { - key = toKey(path[index]); + key = toKey(path[index]) if (!(result = object != null && hasFunc(object, key))) { - break; + break } - object = object[key]; + object = object[key] } if (result || ++index != length) { - return result; + return result } - length = object == null ? 0 : object.length; + length = object == null ? 0 : object.length return !!length && isLength(length) && isIndex(key, length) && - (Array.isArray(object) || isArguments(object)); + (Array.isArray(object) || isArguments(object)) } -export default hasPath; +export default hasPath diff --git a/.internal/hasUnicode.js b/.internal/hasUnicode.js index d13b73ec01..a7ead56881 100644 --- a/.internal/hasUnicode.js +++ b/.internal/hasUnicode.js @@ -1,16 +1,16 @@ /** Used to compose unicode character classes. */ -const rsAstralRange = '\\ud800-\\udfff'; -const rsComboMarksRange = '\\u0300-\\u036f'; -const reComboHalfMarksRange = '\\ufe20-\\ufe2f'; -const rsComboSymbolsRange = '\\u20d0-\\u20ff'; -const rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; -const rsVarRange = '\\ufe0e\\ufe0f'; +const rsAstralRange = '\\ud800-\\udfff' +const rsComboMarksRange = '\\u0300-\\u036f' +const reComboHalfMarksRange = '\\ufe20-\\ufe2f' +const rsComboSymbolsRange = '\\u20d0-\\u20ff' +const rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange +const rsVarRange = '\\ufe0e\\ufe0f' /** Used to compose unicode capture groups. */ -const rsZWJ = '\\u200d'; +const rsZWJ = '\\u200d' /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -const reHasUnicode = RegExp(`[${ rsZWJ + rsAstralRange + rsComboRange + rsVarRange }]`); +const reHasUnicode = RegExp(`[${ rsZWJ + rsAstralRange + rsComboRange + rsVarRange }]`) /** * Checks if `string` contains Unicode symbols. @@ -20,7 +20,7 @@ const reHasUnicode = RegExp(`[${ rsZWJ + rsAstralRange + rsComboRange + rsVarRan * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ function hasUnicode(string) { - return reHasUnicode.test(string); + return reHasUnicode.test(string) } -export default hasUnicode; +export default hasUnicode diff --git a/.internal/hasUnicodeWord.js b/.internal/hasUnicodeWord.js index 3d4d3b634a..d9f0faac97 100644 --- a/.internal/hasUnicodeWord.js +++ b/.internal/hasUnicodeWord.js @@ -1,5 +1,5 @@ /** Used to detect strings that need a more robust regexp to match words. */ -const reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; +const reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/ /** * Checks if `string` contains a word composed of Unicode symbols. @@ -9,7 +9,7 @@ const reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]| * @returns {boolean} Returns `true` if a word is found, else `false`. */ function hasUnicodeWord(string) { - return reHasUnicodeWord.test(string); + return reHasUnicodeWord.test(string) } -export default hasUnicodeWord; +export default hasUnicodeWord diff --git a/.internal/initCloneArray.js b/.internal/initCloneArray.js index 25d89fd9c5..6394fa50b4 100644 --- a/.internal/initCloneArray.js +++ b/.internal/initCloneArray.js @@ -1,5 +1,5 @@ /** Used to check objects for own properties. */ -const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwnProperty = Object.prototype.hasOwnProperty /** * Initializes an array clone. @@ -9,15 +9,15 @@ const hasOwnProperty = Object.prototype.hasOwnProperty; * @returns {Array} Returns the initialized clone. */ function initCloneArray(array) { - const length = array.length; - const result = array.constructor(length); + const length = array.length + const result = array.constructor(length) // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; + result.index = array.index + result.input = array.input } - return result; + return result } -export default initCloneArray; +export default initCloneArray diff --git a/.internal/initCloneByTag.js b/.internal/initCloneByTag.js index 86357ead18..c53e0d8a20 100644 --- a/.internal/initCloneByTag.js +++ b/.internal/initCloneByTag.js @@ -1,32 +1,32 @@ -import cloneArrayBuffer from './.internal/cloneArrayBuffer.js'; -import cloneDataView from './.internal/cloneDataView.js'; -import cloneMap from './.internal/cloneMap.js'; -import cloneRegExp from './.internal/cloneRegExp.js'; -import cloneSet from './.internal/cloneSet.js'; -import cloneSymbol from './.internal/cloneSymbol.js'; -import cloneTypedArray from './.internal/cloneTypedArray.js'; +import cloneArrayBuffer from './.internal/cloneArrayBuffer.js' +import cloneDataView from './.internal/cloneDataView.js' +import cloneMap from './.internal/cloneMap.js' +import cloneRegExp from './.internal/cloneRegExp.js' +import cloneSet from './.internal/cloneSet.js' +import cloneSymbol from './.internal/cloneSymbol.js' +import cloneTypedArray from './.internal/cloneTypedArray.js' /** `Object#toString` result references. */ -const boolTag = '[object Boolean]'; -const dateTag = '[object Date]'; -const mapTag = '[object Map]'; -const numberTag = '[object Number]'; -const regexpTag = '[object RegExp]'; -const setTag = '[object Set]'; -const stringTag = '[object String]'; -const symbolTag = '[object Symbol]'; +const boolTag = '[object Boolean]' +const dateTag = '[object Date]' +const mapTag = '[object Map]' +const numberTag = '[object Number]' +const regexpTag = '[object RegExp]' +const setTag = '[object Set]' +const stringTag = '[object String]' +const symbolTag = '[object Symbol]' -const arrayBufferTag = '[object ArrayBuffer]'; -const dataViewTag = '[object DataView]'; -const float32Tag = '[object Float32Array]'; -const float64Tag = '[object Float64Array]'; -const int8Tag = '[object Int8Array]'; -const int16Tag = '[object Int16Array]'; -const int32Tag = '[object Int32Array]'; -const uint8Tag = '[object Uint8Array]'; -const uint8ClampedTag = '[object Uint8ClampedArray]'; -const uint16Tag = '[object Uint16Array]'; -const uint32Tag = '[object Uint32Array]'; +const arrayBufferTag = '[object ArrayBuffer]' +const dataViewTag = '[object DataView]' +const float32Tag = '[object Float32Array]' +const float64Tag = '[object Float64Array]' +const int8Tag = '[object Int8Array]' +const int16Tag = '[object Int16Array]' +const int32Tag = '[object Int32Array]' +const uint8Tag = '[object Uint8Array]' +const uint8ClampedTag = '[object Uint8ClampedArray]' +const uint16Tag = '[object Uint16Array]' +const uint32Tag = '[object Uint32Array]' /** * Initializes an object clone based on its `toStringTag`. @@ -42,39 +42,39 @@ const uint32Tag = '[object Uint32Array]'; * @returns {Object} Returns the initialized clone. */ function initCloneByTag(object, tag, cloneFunc, isDeep) { - const Ctor = object.constructor; + const Ctor = object.constructor switch (tag) { case arrayBufferTag: - return cloneArrayBuffer(object); + return cloneArrayBuffer(object) case boolTag: case dateTag: - return new Ctor(+object); + return new Ctor(+object) case dataViewTag: - return cloneDataView(object, isDeep); + return cloneDataView(object, isDeep) case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); + return cloneTypedArray(object, isDeep) case mapTag: - return cloneMap(object, isDeep, cloneFunc); + return cloneMap(object, isDeep, cloneFunc) case numberTag: case stringTag: - return new Ctor(object); + return new Ctor(object) case regexpTag: - return cloneRegExp(object); + return cloneRegExp(object) case setTag: - return cloneSet(object, isDeep, cloneFunc); + return cloneSet(object, isDeep, cloneFunc) case symbolTag: - return cloneSymbol(object); + return cloneSymbol(object) } } -export default initCloneByTag; +export default initCloneByTag diff --git a/.internal/initCloneObject.js b/.internal/initCloneObject.js index aaaaa4cd71..5d5211f06b 100644 --- a/.internal/initCloneObject.js +++ b/.internal/initCloneObject.js @@ -1,5 +1,5 @@ -import baseCreate from './.internal/baseCreate.js'; -import isPrototype from './.internal/isPrototype.js'; +import baseCreate from './.internal/baseCreate.js' +import isPrototype from './.internal/isPrototype.js' /** * Initializes an object clone. @@ -11,7 +11,7 @@ import isPrototype from './.internal/isPrototype.js'; function initCloneObject(object) { return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(Object.getPrototypeOf(object)) - : {}; + : {} } -export default initCloneObject; +export default initCloneObject diff --git a/.internal/isFlattenable.js b/.internal/isFlattenable.js index 945056cbc4..1f9a5086f4 100644 --- a/.internal/isFlattenable.js +++ b/.internal/isFlattenable.js @@ -1,7 +1,7 @@ -import isArguments from '../isArguments.js'; +import isArguments from '../isArguments.js' /** Built-in value reference. */ -const spreadableSymbol = Symbol.isConcatSpreadable; +const spreadableSymbol = Symbol.isConcatSpreadable /** * Checks if `value` is a flattenable `arguments` object or array. @@ -12,7 +12,7 @@ const spreadableSymbol = Symbol.isConcatSpreadable; */ function isFlattenable(value) { return Array.isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); + !!(spreadableSymbol && value && value[spreadableSymbol]) } -export default isFlattenable; +export default isFlattenable diff --git a/.internal/isIndex.js b/.internal/isIndex.js index 9c5aa51ad2..3d9e218a2f 100644 --- a/.internal/isIndex.js +++ b/.internal/isIndex.js @@ -1,8 +1,8 @@ /** Used as references for various `Number` constants. */ -const MAX_SAFE_INTEGER = 9007199254740991; +const MAX_SAFE_INTEGER = 9007199254740991 /** Used to detect unsigned integer values. */ -const reIsUint = /^(?:0|[1-9]\d*)$/; +const reIsUint = /^(?:0|[1-9]\d*)$/ /** * Checks if `value` is a valid array-like index. @@ -13,10 +13,10 @@ const reIsUint = /^(?:0|[1-9]\d*)$/; * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; + length = length == null ? MAX_SAFE_INTEGER : length return !!length && (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); + (value > -1 && value % 1 == 0 && value < length) } -export default isIndex; +export default isIndex diff --git a/.internal/isIterateeCall.js b/.internal/isIterateeCall.js index f67f3ca1ff..0bad8adec7 100644 --- a/.internal/isIterateeCall.js +++ b/.internal/isIterateeCall.js @@ -1,7 +1,7 @@ -import eq from '../eq.js'; -import isArrayLike from '../isArrayLike.js'; -import isIndex from './isIndex.js'; -import isObject from '../isObject.js'; +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. @@ -15,16 +15,16 @@ import isObject from '../isObject.js'; */ function isIterateeCall(value, index, object) { if (!isObject(object)) { - return false; + return false } - const type = typeof index; + const type = typeof index if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object) ) { - return eq(object[index], value); + return eq(object[index], value) } - return false; + return false } -export default isIterateeCall; +export default isIterateeCall diff --git a/.internal/isKey.js b/.internal/isKey.js index d263c9c3bf..7cbba64e25 100644 --- a/.internal/isKey.js +++ b/.internal/isKey.js @@ -1,8 +1,8 @@ -import isSymbol from '../isSymbol.js'; +import isSymbol from '../isSymbol.js' /** Used to match property names within property paths. */ -const reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; -const reIsPlainProp = /^\w*$/; +const reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/ +const reIsPlainProp = /^\w*$/ /** * Checks if `value` is a property name and not a property path. @@ -14,15 +14,15 @@ const reIsPlainProp = /^\w*$/; */ function isKey(value, object) { if (Array.isArray(value)) { - return false; + return false } - const type = typeof value; + const type = typeof value if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { - return true; + return true } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); + (object != null && value in Object(object)) } -export default isKey; +export default isKey diff --git a/.internal/isPrototype.js b/.internal/isPrototype.js index 40630a2d87..0e56cfd291 100644 --- a/.internal/isPrototype.js +++ b/.internal/isPrototype.js @@ -1,5 +1,5 @@ /** Used for built-in method references. */ -const objectProto = Object.prototype; +const objectProto = Object.prototype /** * Checks if `value` is likely a prototype object. @@ -9,10 +9,10 @@ const objectProto = Object.prototype; * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { - const Ctor = value && value.constructor; - const proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + const Ctor = value && value.constructor + const proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto - return value === proto; + return value === proto } -export default isPrototype; +export default isPrototype diff --git a/.internal/isStrictComparable.js b/.internal/isStrictComparable.js index fdf29d86ea..edbe94d7ce 100644 --- a/.internal/isStrictComparable.js +++ b/.internal/isStrictComparable.js @@ -1,4 +1,4 @@ -import isObject from '../isObject.js'; +import isObject from '../isObject.js' /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. @@ -9,7 +9,7 @@ import isObject from '../isObject.js'; * equality comparisons, else `false`. */ function isStrictComparable(value) { - return value === value && !isObject(value); + return value === value && !isObject(value) } -export default isStrictComparable; +export default isStrictComparable diff --git a/.internal/iteratorToArray.js b/.internal/iteratorToArray.js index 59fb720540..894e0924fc 100644 --- a/.internal/iteratorToArray.js +++ b/.internal/iteratorToArray.js @@ -6,13 +6,13 @@ * @returns {Array} Returns the converted array. */ function iteratorToArray(iterator) { - let data; - const result = []; + let data + const result = [] while (!(data = iterator.next()).done) { - result.push(data.value); + result.push(data.value) } - return result; + return result } -export default iteratorToArray; +export default iteratorToArray diff --git a/.internal/mapToArray.js b/.internal/mapToArray.js index 307131217a..985b9ea2ec 100644 --- a/.internal/mapToArray.js +++ b/.internal/mapToArray.js @@ -6,13 +6,13 @@ * @returns {Array} Returns the key-value pairs. */ function mapToArray(map) { - let index = -1; - const result = Array(map.size); + let index = -1 + const result = Array(map.size) map.forEach((value, key) => { - result[++index] = [key, value]; - }); - return result; + result[++index] = [key, value] + }) + return result } -export default mapToArray; +export default mapToArray diff --git a/.internal/matchesStrictComparable.js b/.internal/matchesStrictComparable.js index ddcabefa76..15dc340957 100644 --- a/.internal/matchesStrictComparable.js +++ b/.internal/matchesStrictComparable.js @@ -10,11 +10,11 @@ function matchesStrictComparable(key, srcValue) { return object => { if (object == null) { - return false; + return false } return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; + (srcValue !== undefined || (key in Object(object))) + } } -export default matchesStrictComparable; +export default matchesStrictComparable diff --git a/.internal/memoizeCapped.js b/.internal/memoizeCapped.js index d421f46786..8752cfb554 100644 --- a/.internal/memoizeCapped.js +++ b/.internal/memoizeCapped.js @@ -1,7 +1,7 @@ -import memoize from '../memoize.js'; +import memoize from '../memoize.js' /** Used as the maximum memoize cache size. */ -const MAX_MEMOIZE_SIZE = 500; +const MAX_MEMOIZE_SIZE = 500 /** * A specialized version of `memoize` which clears the memoized function's @@ -13,14 +13,14 @@ const MAX_MEMOIZE_SIZE = 500; */ function memoizeCapped(func) { const result = memoize(func, key => { - const { cache } = result; + const { cache } = result if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); + cache.clear() } - return key; - }); + return key + }) - return result; + return result } -export default memoizeCapped; +export default memoizeCapped diff --git a/.internal/mergeData.js b/.internal/mergeData.js index 7f13c5265f..f0136dfc01 100644 --- a/.internal/mergeData.js +++ b/.internal/mergeData.js @@ -1,20 +1,20 @@ -import composeArgs from './composeArgs.js'; -import composeArgsRight from './composeArgsRight.js'; -import replaceHolders from './replaceHolders.js'; +import composeArgs from './composeArgs.js' +import composeArgsRight from './composeArgsRight.js' +import replaceHolders from './replaceHolders.js' /** Used as the internal argument placeholder. */ -const PLACEHOLDER = '__lodash_placeholder__'; +const PLACEHOLDER = '__lodash_placeholder__' /** Used to compose bitmasks for function metadata. */ -const WRAP_BIND_FLAG = 1; -const WRAP_BIND_KEY_FLAG = 2; -const WRAP_CURRY_BOUND_FLAG = 4; -const WRAP_CURRY_FLAG = 8; -const WRAP_ARY_FLAG = 128; -const WRAP_REARG_FLAG = 256; +const WRAP_BIND_FLAG = 1 +const WRAP_BIND_KEY_FLAG = 2 +const WRAP_CURRY_BOUND_FLAG = 4 +const WRAP_CURRY_FLAG = 8 +const WRAP_ARY_FLAG = 128 +const WRAP_REARG_FLAG = 256 /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeMin = Math.min; +const nativeMin = Math.min /** * Merges the function metadata of `source` into `data`. @@ -33,60 +33,60 @@ const nativeMin = Math.min; * @returns {Array} Returns `data`. */ function mergeData(data, source) { - const bitmask = data[1]; - const srcBitmask = source[1]; + const bitmask = data[1] + const srcBitmask = source[1] - let newBitmask = bitmask | srcBitmask; - const isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + let newBitmask = bitmask | srcBitmask + const isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG) const isCombo = ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || - ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)) // Exit early if metadata can't be merged. if (!(isCommon || isCombo)) { - return data; + return data } // Use source `thisArg` if available. if (srcBitmask & WRAP_BIND_FLAG) { - data[2] = source[2]; + data[2] = source[2] // Set when currying a bound function. - newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG } // Compose partial arguments. - let partials; - let value = source[3]; + let partials + let value = source[3] if (value) { - partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : value; - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + partials = data[3] + data[3] = partials ? composeArgs(partials, value, source[4]) : value + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4] } // Compose partial right arguments. - value = source[5]; + value = source[5] if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + partials = data[5] + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6] } // Use source `argPos` if available. - value = source[7]; + value = source[7] if (value) { - data[7] = value; + data[7] = value } // Use source `ary` if it's smaller. if (srcBitmask & WRAP_ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]) } // Use source `arity` if one is not provided. if (data[9] == null) { - data[9] = source[9]; + data[9] = source[9] } // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; + data[0] = source[0] + data[1] = newBitmask - return data; + return data } -export default mergeData; +export default mergeData diff --git a/.internal/metaMap.js b/.internal/metaMap.js index 467790caa0..261cd39b55 100644 --- a/.internal/metaMap.js +++ b/.internal/metaMap.js @@ -1 +1 @@ -export default new WeakMap; +export default new WeakMap diff --git a/.internal/nativeKeys.js b/.internal/nativeKeys.js index 159dabece1..24bc7c64c7 100644 --- a/.internal/nativeKeys.js +++ b/.internal/nativeKeys.js @@ -8,7 +8,7 @@ * @returns {Array} Returns the array of property names. */ function nativeKeys(object) { - return Object.keys(Object(object)); + return Object.keys(Object(object)) } -export default nativeKeys; +export default nativeKeys diff --git a/.internal/nativeKeysIn.js b/.internal/nativeKeysIn.js index e01e2ceca3..7ab18a1bca 100644 --- a/.internal/nativeKeysIn.js +++ b/.internal/nativeKeysIn.js @@ -8,13 +8,13 @@ * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { - const result = []; + const result = [] if (object != null) { for (const key in Object(object)) { - result.push(key); + result.push(key) } } - return result; + return result } -export default nativeKeysIn; +export default nativeKeysIn diff --git a/.internal/nodeUtil.js b/.internal/nodeUtil.js index 3c44ebc0d7..d684732e9d 100644 --- a/.internal/nodeUtil.js +++ b/.internal/nodeUtil.js @@ -1,22 +1,22 @@ -import freeGlobal from './freeGlobal.js'; +import freeGlobal from './freeGlobal.js' /** Detect free variable `exports`. */ -const freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; +const freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports /** Detect free variable `module`. */ -const freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; +const freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module /** Detect the popular CommonJS extension `module.exports`. */ -const moduleExports = freeModule && freeModule.exports === freeExports; +const moduleExports = freeModule && freeModule.exports === freeExports /** Detect free variable `process` from Node.js. */ -const freeProcess = moduleExports && freeGlobal.process; +const freeProcess = moduleExports && freeGlobal.process /** Used to access faster Node.js helpers. */ const nodeUtil = ((() => { try { - return freeProcess && freeProcess.binding && freeProcess.binding('util'); + return freeProcess && freeProcess.binding && freeProcess.binding('util') } catch (e) {} -})()); +})()) -export default nodeUtil; +export default nodeUtil diff --git a/.internal/objectToString.js b/.internal/objectToString.js index 4a22e3eadc..c10d12d7a1 100644 --- a/.internal/objectToString.js +++ b/.internal/objectToString.js @@ -3,7 +3,7 @@ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ -const nativeObjectToString = Object.prototype.toString; +const nativeObjectToString = Object.prototype.toString /** * Converts `value` to a string using `Object.prototype.toString`. @@ -13,7 +13,7 @@ const nativeObjectToString = Object.prototype.toString; * @returns {string} Returns the converted string. */ function objectToString(value) { - return nativeObjectToString.call(value); + return nativeObjectToString.call(value) } -export default objectToString; +export default objectToString diff --git a/.internal/parent.js b/.internal/parent.js index e211482348..04e5a01daa 100644 --- a/.internal/parent.js +++ b/.internal/parent.js @@ -1,5 +1,5 @@ -import baseGet from './baseGet.js'; -import baseSlice from './baseSlice.js'; +import baseGet from './baseGet.js' +import baseSlice from './baseSlice.js' /** * Gets the parent value at `path` of `object`. @@ -10,7 +10,7 @@ import baseSlice from './baseSlice.js'; * @returns {*} Returns the parent value. */ function parent(object, path) { - return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)) } -export default parent; +export default parent diff --git a/.internal/reEscape.js b/.internal/reEscape.js index 1063b8c5c0..e98fa45da7 100644 --- a/.internal/reEscape.js +++ b/.internal/reEscape.js @@ -1,4 +1,4 @@ /** Used to match template delimiters. */ -const reEscape = /<%-([\s\S]+?)%>/g; +const reEscape = /<%-([\s\S]+?)%>/g -export default reEscape; +export default reEscape diff --git a/.internal/reEvaluate.js b/.internal/reEvaluate.js index dee63eef70..f0df1b356d 100644 --- a/.internal/reEvaluate.js +++ b/.internal/reEvaluate.js @@ -1,4 +1,4 @@ /** Used to match template delimiters. */ -const reEvaluate = /<%([\s\S]+?)%>/g; +const reEvaluate = /<%([\s\S]+?)%>/g -export default reEvaluate; +export default reEvaluate diff --git a/.internal/reInterpolate.js b/.internal/reInterpolate.js index 5124ab7550..8c681d9e52 100644 --- a/.internal/reInterpolate.js +++ b/.internal/reInterpolate.js @@ -1,4 +1,4 @@ /** Used to match template delimiters. */ -const reInterpolate = /<%=([\s\S]+?)%>/g; +const reInterpolate = /<%=([\s\S]+?)%>/g -export default reInterpolate; +export default reInterpolate diff --git a/.internal/reorder.js b/.internal/reorder.js index d200c4bcd1..d8d18c5811 100644 --- a/.internal/reorder.js +++ b/.internal/reorder.js @@ -1,8 +1,8 @@ -import copyArray from './copyArray.js'; -import isIndex from './isIndex.js'; +import copyArray from './copyArray.js' +import isIndex from './isIndex.js' /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeMin = Math.min; +const nativeMin = Math.min /** * Reorder `array` according to the specified indexes where the element at @@ -15,15 +15,15 @@ const nativeMin = Math.min; * @returns {Array} Returns `array`. */ function reorder(array, indexes) { - const arrLength = array.length; - let length = nativeMin(indexes.length, arrLength); - const oldArray = copyArray(array); + const arrLength = array.length + let length = nativeMin(indexes.length, arrLength) + const oldArray = copyArray(array) while (length--) { - const index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + const index = indexes[length] + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined } - return array; + return array } -export default reorder; +export default reorder diff --git a/.internal/replaceHolders.js b/.internal/replaceHolders.js index 3c36bc831c..adb68d9b07 100644 --- a/.internal/replaceHolders.js +++ b/.internal/replaceHolders.js @@ -1,5 +1,5 @@ /** Used as the internal argument placeholder. */ -const PLACEHOLDER = '__lodash_placeholder__'; +const PLACEHOLDER = '__lodash_placeholder__' /** * Replaces all `placeholder` elements in `array` with an internal placeholder @@ -11,19 +11,19 @@ const PLACEHOLDER = '__lodash_placeholder__'; * @returns {Array} Returns the new array of placeholder indexes. */ function replaceHolders(array, placeholder) { - let index = -1; - const length = array.length; - let resIndex = 0; - const result = []; + let index = -1 + const length = array.length + let resIndex = 0 + const result = [] while (++index < length) { - const value = array[index]; + const value = array[index] if (value === placeholder || value === PLACEHOLDER) { - array[index] = PLACEHOLDER; - result[resIndex++] = index; + array[index] = PLACEHOLDER + result[resIndex++] = index } } - return result; + return result } -export default replaceHolders; +export default replaceHolders diff --git a/.internal/root.js b/.internal/root.js index 4033802ffe..b0dd49267d 100644 --- a/.internal/root.js +++ b/.internal/root.js @@ -1,9 +1,9 @@ -import freeGlobal from './freeGlobal.js'; +import freeGlobal from './freeGlobal.js' /** Detect free variable `self`. */ -const freeSelf = typeof self == 'object' && self && self.Object === Object && self; +const freeSelf = typeof self == 'object' && self && self.Object === Object && self /** Used as a reference to the global object. */ -const root = freeGlobal || freeSelf || Function('return this')(); +const root = freeGlobal || freeSelf || Function('return this')() -export default root; +export default root diff --git a/.internal/setToArray.js b/.internal/setToArray.js index 6fb730a159..94f10bfb97 100644 --- a/.internal/setToArray.js +++ b/.internal/setToArray.js @@ -6,13 +6,13 @@ * @returns {Array} Returns the values. */ function setToArray(set) { - let index = -1; - const result = Array(set.size); + let index = -1 + const result = Array(set.size) set.forEach(value => { - result[++index] = value; - }); - return result; + result[++index] = value + }) + return result } -export default setToArray; +export default setToArray diff --git a/.internal/setToPairs.js b/.internal/setToPairs.js index eeb1bdde9b..3f2d1d9d77 100644 --- a/.internal/setToPairs.js +++ b/.internal/setToPairs.js @@ -6,13 +6,13 @@ * @returns {Array} Returns the value-value pairs. */ function setToPairs(set) { - let index = -1; - const result = Array(set.size); + let index = -1 + const result = Array(set.size) set.forEach(value => result[++index] = [value, value] - ); - return result; + ) + return result } -export default setToPairs; +export default setToPairs diff --git a/.internal/setToString.js b/.internal/setToString.js index 6a6b252df7..a29ef90b92 100644 --- a/.internal/setToString.js +++ b/.internal/setToString.js @@ -1,5 +1,5 @@ -import baseSetToString from './baseSetToString.js'; -import shortOut from './shortOut.js'; +import baseSetToString from './baseSetToString.js' +import shortOut from './shortOut.js' /** * Sets the `toString` method of `func` to return `string`. @@ -9,6 +9,6 @@ import shortOut from './shortOut.js'; * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ -const setToString = shortOut(baseSetToString); +const setToString = shortOut(baseSetToString) -export default setToString; +export default setToString diff --git a/.internal/shuffleSelf.js b/.internal/shuffleSelf.js index 931bbc841a..4ca1701f70 100644 --- a/.internal/shuffleSelf.js +++ b/.internal/shuffleSelf.js @@ -1,4 +1,4 @@ -import baseRandom from './baseRandom.js'; +import baseRandom from './baseRandom.js' /** * A specialized version of `shuffle` which mutates and sets the size of `array`. @@ -9,20 +9,20 @@ import baseRandom from './baseRandom.js'; * @returns {Array} Returns `array`. */ function shuffleSelf(array, size) { - let index = -1; - const length = array.length; - const lastIndex = length - 1; + let index = -1 + const length = array.length + const lastIndex = length - 1 - size = size === undefined ? length : size; + size = size === undefined ? length : size while (++index < size) { - const rand = baseRandom(index, lastIndex); - const value = array[rand]; + const rand = baseRandom(index, lastIndex) + const value = array[rand] - array[rand] = array[index]; - array[index] = value; + array[rand] = array[index] + array[index] = value } - array.length = size; - return array; + array.length = size + return array } -export default shuffleSelf; +export default shuffleSelf diff --git a/.internal/strictIndexOf.js b/.internal/strictIndexOf.js index 705acf66d2..98073bffff 100644 --- a/.internal/strictIndexOf.js +++ b/.internal/strictIndexOf.js @@ -9,15 +9,15 @@ * @returns {number} Returns the index of the matched value, else `-1`. */ function strictIndexOf(array, value, fromIndex) { - let index = fromIndex - 1; - const length = array.length; + let index = fromIndex - 1 + const length = array.length while (++index < length) { if (array[index] === value) { - return index; + return index } } - return -1; + return -1 } -export default strictIndexOf; +export default strictIndexOf diff --git a/.internal/strictLastIndexOf.js b/.internal/strictLastIndexOf.js index 64fbe3f182..8b81bfd790 100644 --- a/.internal/strictLastIndexOf.js +++ b/.internal/strictLastIndexOf.js @@ -9,13 +9,13 @@ * @returns {number} Returns the index of the matched value, else `-1`. */ function strictLastIndexOf(array, value, fromIndex) { - let index = fromIndex + 1; + let index = fromIndex + 1 while (index--) { if (array[index] === value) { - return index; + return index } } - return index; + return index } -export default strictLastIndexOf; +export default strictLastIndexOf diff --git a/.internal/stringSize.js b/.internal/stringSize.js index 5ad911926f..25a108e18f 100644 --- a/.internal/stringSize.js +++ b/.internal/stringSize.js @@ -1,6 +1,6 @@ -import asciiSize from './asciiSize.js'; -import hasUnicode from './hasUnicode.js'; -import unicodeSize from './unicodeSize.js'; +import asciiSize from './asciiSize.js' +import hasUnicode from './hasUnicode.js' +import unicodeSize from './unicodeSize.js' /** * Gets the number of symbols in `string`. @@ -10,7 +10,7 @@ import unicodeSize from './unicodeSize.js'; * @returns {number} Returns the string size. */ function stringSize(string) { - return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); + return hasUnicode(string) ? unicodeSize(string) : asciiSize(string) } -export default stringSize; +export default stringSize diff --git a/.internal/stringToArray.js b/.internal/stringToArray.js index a584d5dec5..38aceed0cb 100644 --- a/.internal/stringToArray.js +++ b/.internal/stringToArray.js @@ -1,6 +1,6 @@ -import asciiToArray from './asciiToArray.js'; -import hasUnicode from './hasUnicode.js'; -import unicodeToArray from './unicodeToArray.js'; +import asciiToArray from './asciiToArray.js' +import hasUnicode from './hasUnicode.js' +import unicodeToArray from './unicodeToArray.js' /** * Converts `string` to an array. @@ -12,7 +12,7 @@ import unicodeToArray from './unicodeToArray.js'; function stringToArray(string) { return hasUnicode(string) ? unicodeToArray(string) - : asciiToArray(string); + : asciiToArray(string) } -export default stringToArray; +export default stringToArray diff --git a/.internal/stringToPath.js b/.internal/stringToPath.js index 1c8a64cb42..4a73d3c762 100644 --- a/.internal/stringToPath.js +++ b/.internal/stringToPath.js @@ -1,11 +1,11 @@ -import memoizeCapped from './memoizeCapped.js'; +import memoizeCapped from './memoizeCapped.js' /** Used to match property names within property paths. */ -const reLeadingDot = /^\./; -const rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; +const reLeadingDot = /^\./ +const rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g /** Used to match backslashes in property paths. */ -const reEscapeChar = /\\(\\)?/g; +const reEscapeChar = /\\(\\)?/g /** * Converts `string` to a property path array. @@ -15,14 +15,14 @@ const reEscapeChar = /\\(\\)?/g; * @returns {Array} Returns the property path array. */ const stringToPath = memoizeCapped(string => { - const result = []; + const result = [] if (reLeadingDot.test(string)) { - result.push(''); + result.push('') } string.replace(rePropName, (match, number, quote, string) => { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; -}); + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)) + }) + return result +}) -export default stringToPath; +export default stringToPath diff --git a/.internal/toKey.js b/.internal/toKey.js index 14aba59456..8faf05f0fd 100644 --- a/.internal/toKey.js +++ b/.internal/toKey.js @@ -1,7 +1,7 @@ -import isSymbol from '../isSymbol.js'; +import isSymbol from '../isSymbol.js' /** Used as references for various `Number` constants. */ -const INFINITY = 1 / 0; +const INFINITY = 1 / 0 /** * Converts `value` to a string key if it's not a string or symbol. @@ -12,10 +12,10 @@ const INFINITY = 1 / 0; */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { - return value; + return value } - const result = `${ value }`; - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + const result = `${ value }` + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result } -export default toKey; +export default toKey diff --git a/.internal/toSource.js b/.internal/toSource.js index b057ac620b..9ca9446389 100644 --- a/.internal/toSource.js +++ b/.internal/toSource.js @@ -1,5 +1,5 @@ /** Used to resolve the decompiled source of functions. */ -const funcToString = Function.prototype.toString; +const funcToString = Function.prototype.toString /** * Converts `func` to its source code. @@ -11,13 +11,13 @@ const funcToString = Function.prototype.toString; function toSource(func) { if (func != null) { try { - return funcToString.call(func); + return funcToString.call(func) } catch (e) {} try { - return `${ func }`; + return `${ func }` } catch (e) {} } - return ''; + return '' } -export default toSource; +export default toSource diff --git a/.internal/unicodeSize.js b/.internal/unicodeSize.js index 8b14af37cf..f3877f0545 100644 --- a/.internal/unicodeSize.js +++ b/.internal/unicodeSize.js @@ -1,30 +1,30 @@ /** Used to compose unicode character classes. */ -const rsAstralRange = '\\ud800-\\udfff'; -const rsComboMarksRange = '\\u0300-\\u036f'; -const reComboHalfMarksRange = '\\ufe20-\\ufe2f'; -const rsComboSymbolsRange = '\\u20d0-\\u20ff'; -const rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; -const rsVarRange = '\\ufe0e\\ufe0f'; +const rsAstralRange = '\\ud800-\\udfff' +const rsComboMarksRange = '\\u0300-\\u036f' +const reComboHalfMarksRange = '\\ufe20-\\ufe2f' +const rsComboSymbolsRange = '\\u20d0-\\u20ff' +const rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange +const rsVarRange = '\\ufe0e\\ufe0f' /** Used to compose unicode capture groups. */ -const rsAstral = `[${ rsAstralRange }]`; -const rsCombo = `[${ rsComboRange }]`; -const rsFitz = '\\ud83c[\\udffb-\\udfff]'; -const rsModifier = `(?:${ rsCombo }|${ rsFitz })`; -const rsNonAstral = `[^${ rsAstralRange }]`; -const rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; -const rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; -const rsZWJ = '\\u200d'; +const rsAstral = `[${ rsAstralRange }]` +const rsCombo = `[${ rsComboRange }]` +const rsFitz = '\\ud83c[\\udffb-\\udfff]' +const rsModifier = `(?:${ rsCombo }|${ rsFitz })` +const rsNonAstral = `[^${ rsAstralRange }]` +const rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}' +const rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]' +const rsZWJ = '\\u200d' /** Used to compose unicode regexes. */ -const reOptMod = `${ rsModifier }?`; -const rsOptVar = `[${ rsVarRange }]?`; -const rsOptJoin = `(?:${ rsZWJ }(?:${ [rsNonAstral, rsRegional, rsSurrPair].join('|') })${ rsOptVar + reOptMod })*`; -const rsSeq = rsOptVar + reOptMod + rsOptJoin; -const rsSymbol = `(?:${ [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') })`; +const reOptMod = `${ rsModifier }?` +const rsOptVar = `[${ rsVarRange }]?` +const rsOptJoin = `(?:${ rsZWJ }(?:${ [rsNonAstral, rsRegional, rsSurrPair].join('|') })${ rsOptVar + reOptMod })*` +const rsSeq = rsOptVar + reOptMod + rsOptJoin +const rsSymbol = `(?:${ [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') })` /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -const reUnicode = RegExp(`${ rsFitz }(?=${ rsFitz })|${ rsSymbol + rsSeq }`, 'g'); +const reUnicode = RegExp(`${ rsFitz }(?=${ rsFitz })|${ rsSymbol + rsSeq }`, 'g') /** * Gets the size of a Unicode `string`. @@ -34,11 +34,11 @@ const reUnicode = RegExp(`${ rsFitz }(?=${ rsFitz })|${ rsSymbol + rsSeq }`, 'g' * @returns {number} Returns the string size. */ function unicodeSize(string) { - let result = reUnicode.lastIndex = 0; + let result = reUnicode.lastIndex = 0 while (reUnicode.test(string)) { - ++result; + ++result } - return result; + return result } -export default unicodeSize; +export default unicodeSize diff --git a/.internal/unicodeToArray.js b/.internal/unicodeToArray.js index 2d6f9f9f0c..308a8633b2 100644 --- a/.internal/unicodeToArray.js +++ b/.internal/unicodeToArray.js @@ -1,30 +1,30 @@ /** Used to compose unicode character classes. */ -const rsAstralRange = '\\ud800-\\udfff'; -const rsComboMarksRange = '\\u0300-\\u036f'; -const reComboHalfMarksRange = '\\ufe20-\\ufe2f'; -const rsComboSymbolsRange = '\\u20d0-\\u20ff'; -const rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; -const rsVarRange = '\\ufe0e\\ufe0f'; +const rsAstralRange = '\\ud800-\\udfff' +const rsComboMarksRange = '\\u0300-\\u036f' +const reComboHalfMarksRange = '\\ufe20-\\ufe2f' +const rsComboSymbolsRange = '\\u20d0-\\u20ff' +const rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange +const rsVarRange = '\\ufe0e\\ufe0f' /** Used to compose unicode capture groups. */ -const rsAstral = `[${ rsAstralRange }]`; -const rsCombo = `[${ rsComboRange }]`; -const rsFitz = '\\ud83c[\\udffb-\\udfff]'; -const rsModifier = `(?:${ rsCombo }|${ rsFitz })`; -const rsNonAstral = `[^${ rsAstralRange }]`; -const rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; -const rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; -const rsZWJ = '\\u200d'; +const rsAstral = `[${ rsAstralRange }]` +const rsCombo = `[${ rsComboRange }]` +const rsFitz = '\\ud83c[\\udffb-\\udfff]' +const rsModifier = `(?:${ rsCombo }|${ rsFitz })` +const rsNonAstral = `[^${ rsAstralRange }]` +const rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}' +const rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]' +const rsZWJ = '\\u200d' /** Used to compose unicode regexes. */ -const reOptMod = `${ rsModifier }?`; -const rsOptVar = `[${ rsVarRange }]?`; -const rsOptJoin = `(?:${ rsZWJ }(?:${ [rsNonAstral, rsRegional, rsSurrPair].join('|') })${ rsOptVar + reOptMod })*`; -const rsSeq = rsOptVar + reOptMod + rsOptJoin; -const rsSymbol = `(?:${ [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') })`; +const reOptMod = `${ rsModifier }?` +const rsOptVar = `[${ rsVarRange }]?` +const rsOptJoin = `(?:${ rsZWJ }(?:${ [rsNonAstral, rsRegional, rsSurrPair].join('|') })${ rsOptVar + reOptMod })*` +const rsSeq = rsOptVar + reOptMod + rsOptJoin +const rsSymbol = `(?:${ [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') })` /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -const reUnicode = RegExp(`${ rsFitz }(?=${ rsFitz })|${ rsSymbol + rsSeq }`, 'g'); +const reUnicode = RegExp(`${ rsFitz }(?=${ rsFitz })|${ rsSymbol + rsSeq }`, 'g') /** * Converts a Unicode `string` to an array. @@ -34,7 +34,7 @@ const reUnicode = RegExp(`${ rsFitz }(?=${ rsFitz })|${ rsSymbol + rsSeq }`, 'g' * @returns {Array} Returns the converted array. */ function unicodeToArray(string) { - return string.match(reUnicode) || []; + return string.match(reUnicode) || [] } -export default unicodeToArray; +export default unicodeToArray diff --git a/.internal/unicodeWords.js b/.internal/unicodeWords.js index bf152d284e..c08756b895 100644 --- a/.internal/unicodeWords.js +++ b/.internal/unicodeWords.js @@ -1,47 +1,47 @@ /** Used to compose unicode character classes. */ -const rsAstralRange = '\\ud800-\\udfff'; -const rsComboMarksRange = '\\u0300-\\u036f'; -const reComboHalfMarksRange = '\\ufe20-\\ufe2f'; -const rsComboSymbolsRange = '\\u20d0-\\u20ff'; -const rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; -const rsDingbatRange = '\\u2700-\\u27bf'; -const rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff'; -const rsMathOpRange = '\\xac\\xb1\\xd7\\xf7'; -const rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf'; -const rsPunctuationRange = '\\u2000-\\u206f'; -const rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000'; -const rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde'; -const rsVarRange = '\\ufe0e\\ufe0f'; -const rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; +const rsAstralRange = '\\ud800-\\udfff' +const rsComboMarksRange = '\\u0300-\\u036f' +const reComboHalfMarksRange = '\\ufe20-\\ufe2f' +const rsComboSymbolsRange = '\\u20d0-\\u20ff' +const rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange +const rsDingbatRange = '\\u2700-\\u27bf' +const rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff' +const rsMathOpRange = '\\xac\\xb1\\xd7\\xf7' +const rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf' +const rsPunctuationRange = '\\u2000-\\u206f' +const rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000' +const rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde' +const rsVarRange = '\\ufe0e\\ufe0f' +const rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange /** Used to compose unicode capture groups. */ -const rsApos = "['\u2019]"; -const rsBreak = `[${ rsBreakRange }]`; -const rsCombo = `[${ rsComboRange }]`; -const rsDigits = '\\d+'; -const rsDingbat = `[${ rsDingbatRange }]`; -const rsLower = `[${ rsLowerRange }]`; -const rsMisc = `[^${ rsAstralRange }${ rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange }]`; -const rsFitz = '\\ud83c[\\udffb-\\udfff]'; -const rsModifier = `(?:${ rsCombo }|${ rsFitz })`; -const rsNonAstral = `[^${ rsAstralRange }]`; -const rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; -const rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; -const rsUpper = `[${ rsUpperRange }]`; -const rsZWJ = '\\u200d'; +const rsApos = "['\u2019]" +const rsBreak = `[${ rsBreakRange }]` +const rsCombo = `[${ rsComboRange }]` +const rsDigits = '\\d+' +const rsDingbat = `[${ rsDingbatRange }]` +const rsLower = `[${ rsLowerRange }]` +const rsMisc = `[^${ rsAstralRange }${ rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange }]` +const rsFitz = '\\ud83c[\\udffb-\\udfff]' +const rsModifier = `(?:${ rsCombo }|${ rsFitz })` +const rsNonAstral = `[^${ rsAstralRange }]` +const rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}' +const rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]' +const rsUpper = `[${ rsUpperRange }]` +const rsZWJ = '\\u200d' /** Used to compose unicode regexes. */ -const rsMiscLower = `(?:${ rsLower }|${ rsMisc })`; -const rsMiscUpper = `(?:${ rsUpper }|${ rsMisc })`; -const rsOptContrLower = `(?:${ rsApos }(?:d|ll|m|re|s|t|ve))?`; -const rsOptContrUpper = `(?:${ rsApos }(?:D|LL|M|RE|S|T|VE))?`; -const reOptMod = `${ rsModifier }?`; -const rsOptVar = `[${ rsVarRange }]?`; -const rsOptJoin = `(?:${ rsZWJ }(?:${ [rsNonAstral, rsRegional, rsSurrPair].join('|') })${ rsOptVar + reOptMod })*`; -const rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)'; -const rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)'; -const rsSeq = rsOptVar + reOptMod + rsOptJoin; -const rsEmoji = `(?:${ [rsDingbat, rsRegional, rsSurrPair].join('|') })${ rsSeq }`; +const rsMiscLower = `(?:${ rsLower }|${ rsMisc })` +const rsMiscUpper = `(?:${ rsUpper }|${ rsMisc })` +const rsOptContrLower = `(?:${ rsApos }(?:d|ll|m|re|s|t|ve))?` +const rsOptContrUpper = `(?:${ rsApos }(?:D|LL|M|RE|S|T|VE))?` +const reOptMod = `${ rsModifier }?` +const rsOptVar = `[${ rsVarRange }]?` +const rsOptJoin = `(?:${ rsZWJ }(?:${ [rsNonAstral, rsRegional, rsSurrPair].join('|') })${ rsOptVar + reOptMod })*` +const rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)' +const rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)' +const rsSeq = rsOptVar + reOptMod + rsOptJoin +const rsEmoji = `(?:${ [rsDingbat, rsRegional, rsSurrPair].join('|') })${ rsSeq }` /** Used to match complex or compound words. */ const reUnicodeWord = RegExp([ @@ -53,7 +53,7 @@ const reUnicodeWord = RegExp([ rsOrdLower, rsDigits, rsEmoji -].join('|'), 'g'); +].join('|'), 'g') /** * Splits a Unicode `string` into an array of its words. @@ -63,7 +63,7 @@ const reUnicodeWord = RegExp([ * @returns {Array} Returns the words of `string`. */ function unicodeWords(string) { - return string.match(reUnicodeWord) || []; + return string.match(reUnicodeWord) || [] } -export default unicodeWords; +export default unicodeWords diff --git a/add.js b/add.js index 67fff62554..1e69176591 100644 --- a/add.js +++ b/add.js @@ -1,4 +1,4 @@ -import createMathOperation from './.internal/createMathOperation.js'; +import createMathOperation from './.internal/createMathOperation.js' /** * Adds two numbers. @@ -10,9 +10,9 @@ import createMathOperation from './.internal/createMathOperation.js'; * @returns {number} Returns the total. * @example * - * add(6, 4); + * add(6, 4) * // => 10 */ -const add = createMathOperation((augend, addend) => augend + addend, 0); +const add = createMathOperation((augend, addend) => augend + addend, 0) -export default add; +export default add diff --git a/after.js b/after.js index 681c6b8145..694d8d28f4 100644 --- a/after.js +++ b/after.js @@ -1,7 +1,7 @@ -import toInteger from './toInteger.js'; +import toInteger from './toInteger.js' /** - * The opposite of `before`; this method creates a function that invokes + * The opposite of `before`his method creates a function that invokes * `func` once it's called `n` or more times. * * @since 0.1.0 @@ -11,22 +11,22 @@ import toInteger from './toInteger.js'; * @returns {Function} Returns the new restricted function. * @example * - * const saves = ['profile', 'settings']; - * const done = after(saves.length, () => console.log('done saving!')); + * const saves = ['profile', 'settings'] + * const done = after(saves.length, () => console.log('done saving!')) * - * forEach(saves, type => asyncSave({ 'type': type, 'complete': done })); + * forEach(saves, type => asyncSave({ 'type': type, 'complete': done })) * // => Logs 'done saving!' after the two async saves have completed. */ function after(n, func) { if (typeof func != 'function') { - throw new TypeError('Expected a function'); + throw new TypeError('Expected a function') } - n = toInteger(n); + n = toInteger(n) return function(...args) { if (--n < 1) { - return func.apply(this, args); + return func.apply(this, args) } - }; + } } -export default after; +export default after diff --git a/ary.js b/ary.js index e835da0fc7..a02f71c6d9 100644 --- a/ary.js +++ b/ary.js @@ -1,7 +1,7 @@ -import createWrap from './.internal/createWrap.js'; +import createWrap from './.internal/createWrap.js' /** Used to compose bitmasks for function metadata. */ -const WRAP_ARY_FLAG = 128; +const WRAP_ARY_FLAG = 128 /** * Creates a function that invokes `func`, with up to `n` arguments, @@ -15,13 +15,13 @@ const WRAP_ARY_FLAG = 128; * @returns {Function} Returns the new capped function. * @example * - * map(['6', '8', '10'], ary(parseInt, 1)); + * map(['6', '8', '10'], ary(parseInt, 1)) * // => [6, 8, 10] */ function ary(func, n, guard) { - n = guard ? undefined : n; - n = (func && n == null) ? func.length : n; - return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + n = guard ? undefined : n + n = (func && n == null) ? func.length : n + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n) } -export default ary; +export default ary diff --git a/assignWith.js b/assignWith.js index d4c7978915..8aac3f2ba6 100644 --- a/assignWith.js +++ b/assignWith.js @@ -1,6 +1,6 @@ -import copyObject from './.internal/copyObject.js'; -import createAssigner from './.internal/createAssigner.js'; -import keys from './keys.js'; +import copyObject from './.internal/copyObject.js' +import createAssigner from './.internal/createAssigner.js' +import keys from './keys.js' /** * This method is like `assign` except that it accepts `customizer` @@ -20,16 +20,16 @@ import keys from './keys.js'; * @example * * function customizer(objValue, srcValue) { - * return isUndefined(objValue) ? srcValue : objValue; + * return isUndefined(objValue) ? srcValue : objValue * } * - * const defaults = partialRight(assignWith, customizer); + * const defaults = partialRight(assignWith, customizer) * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }) * // => { 'a': 1, 'b': 2 } */ const assignWith = createAssigner((object, source, srcIndex, customizer) => { - copyObject(source, keys(source), object, customizer); -}); + copyObject(source, keys(source), object, customizer) +}) -export default assignWith; +export default assignWith diff --git a/at.js b/at.js index cbd2045aa9..8b98e291ea 100644 --- a/at.js +++ b/at.js @@ -1,4 +1,4 @@ -import baseAt from './.internal/baseAt.js'; +import baseAt from './.internal/baseAt.js' /** * Creates an array of values corresponding to `paths` of `object`. @@ -10,13 +10,13 @@ import baseAt from './.internal/baseAt.js'; * @returns {Array} Returns the picked values. * @example * - * const object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * const object = { 'a': [{ 'b': { 'c': 3 } }, 4] } * - * at(object, ['a[0].b.c', 'a[1]']); + * at(object, ['a[0].b.c', 'a[1]']) * // => [3, 4] */ function at(...paths) { - return baseAt(paths); + return baseAt(paths) } -export default at; +export default at diff --git a/attempt.js b/attempt.js index 97ac4e6fbc..c335dc6cff 100644 --- a/attempt.js +++ b/attempt.js @@ -1,5 +1,5 @@ -import apply from './.internal/apply.js'; -import isError from './isError.js'; +import apply from './.internal/apply.js' +import isError from './isError.js' /** * Attempts to invoke `func`, returning either the result or the caught error @@ -14,18 +14,18 @@ import isError from './isError.js'; * * // Avoid throwing errors for invalid selectors. * const elements = attempt(selector => - * document.querySelectorAll(selector), '>_>'); + * document.querySelectorAll(selector), '>_>') * * if (isError(elements)) { - * elements = []; + * elements = [] * } */ function attempt(func, ...args) { try { - return apply(func, undefined, args); + return apply(func, undefined, args) } catch (e) { - return isError(e) ? e : new Error(e); + return isError(e) ? e : new Error(e) } } -export default attempt; +export default attempt diff --git a/before.js b/before.js index 78ac3d5a2b..2747496a42 100644 --- a/before.js +++ b/before.js @@ -1,4 +1,4 @@ -import toInteger from './toInteger.js'; +import toInteger from './toInteger.js' /** * Creates a function that invokes `func`, with the `this` binding and arguments @@ -12,24 +12,24 @@ import toInteger from './toInteger.js'; * @returns {Function} Returns the new restricted function. * @example * - * jQuery(element).on('click', before(5, addContactToList)); + * jQuery(element).on('click', before(5, addContactToList)) * // => Allows adding up to 4 contacts to the list. */ function before(n, func) { - let result; + let result if (typeof func != 'function') { - throw new TypeError('Expected a function'); + throw new TypeError('Expected a function') } - n = toInteger(n); + n = toInteger(n) return function(...args) { if (--n > 0) { - result = func.apply(this, args); + result = func.apply(this, args) } if (n <= 1) { - func = undefined; + func = undefined } - return result; - }; + return result + } } -export default before; +export default before diff --git a/bindKey.js b/bindKey.js index fc666d97eb..4b24d3c71b 100644 --- a/bindKey.js +++ b/bindKey.js @@ -1,11 +1,11 @@ -import createWrap from './.internal/createWrap.js'; -import getHolder from './.internal/getHolder.js'; -import replaceHolders from './.internal/replaceHolders.js'; +import createWrap from './.internal/createWrap.js' +import getHolder from './.internal/getHolder.js' +import replaceHolders from './.internal/replaceHolders.js' /** Used to compose bitmasks for function metadata. */ -const WRAP_BIND_FLAG = 1; -const WRAP_BIND_KEY_FLAG = 2; -const WRAP_PARTIAL_FLAG = 32; +const WRAP_BIND_FLAG = 1 +const WRAP_BIND_KEY_FLAG = 2 +const WRAP_PARTIAL_FLAG = 32 /** * Creates a function that invokes the method at `object[key]` with `partials` @@ -30,37 +30,37 @@ const WRAP_PARTIAL_FLAG = 32; * const object = { * 'user': 'fred', * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; + * return greeting + ' ' + this.user + punctuation * } - * }; + * } * - * const bound = bindKey(object, 'greet', 'hi'); - * bound('!'); + * const bound = bindKey(object, 'greet', 'hi') + * bound('!') * // => 'hi fred!' * * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; + * return greeting + 'ya ' + this.user + punctuation + * } * - * bound('!'); + * bound('!') * // => 'hiya fred!' * * // Bound with placeholders. - * const bound = bindKey(object, 'greet', _, '!'); - * bound('hi'); + * const bound = bindKey(object, 'greet', _, '!') + * bound('hi') * // => 'hiya fred!' */ function bindKey(object, key, ...partials) { - let holders; - let bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + let holders + let bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG if (partials.length) { - holders = replaceHolders(partials, getHolder(bindKey)); - bitmask |= WRAP_PARTIAL_FLAG; + holders = replaceHolders(partials, getHolder(bindKey)) + bitmask |= WRAP_PARTIAL_FLAG } - return createWrap(key, bitmask, object, partials, holders); + return createWrap(key, bitmask, object, partials, holders) } // Assign default placeholders. -bindKey.placeholder = {}; +bindKey.placeholder = {} -export default bindKey; +export default bindKey diff --git a/camelCase.js b/camelCase.js index 160ff60bcc..44814a851d 100644 --- a/camelCase.js +++ b/camelCase.js @@ -1,5 +1,5 @@ -import capitalize from './capitalize.js'; -import createCompounder from './.internal/createCompounder.js'; +import capitalize from './capitalize.js' +import createCompounder from './.internal/createCompounder.js' /** * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). @@ -11,18 +11,18 @@ import createCompounder from './.internal/createCompounder.js'; * @see lowerCase, kebabCase, snakeCase, startCase, upperCase, upperFirst * @example * - * camelCase('Foo Bar'); + * camelCase('Foo Bar') * // => 'fooBar' * - * camelCase('--foo-bar--'); + * camelCase('--foo-bar--') * // => 'fooBar' * - * camelCase('__FOO_BAR__'); + * camelCase('__FOO_BAR__') * // => 'fooBar' */ const camelCase = createCompounder((result, word, index) => { - word = word.toLowerCase(); - return result + (index ? capitalize(word) : word); -}); + word = word.toLowerCase() + return result + (index ? capitalize(word) : word) +}) -export default camelCase; +export default camelCase diff --git a/capitalize.js b/capitalize.js index 4859f61c10..54adb57363 100644 --- a/capitalize.js +++ b/capitalize.js @@ -1,5 +1,5 @@ -import toString from './toString.js'; -import upperFirst from './upperFirst.js'; +import toString from './toString.js' +import upperFirst from './upperFirst.js' /** * Converts the first character of `string` to upper case and the remaining @@ -11,11 +11,11 @@ import upperFirst from './upperFirst.js'; * @returns {string} Returns the capitalized string. * @example * - * capitalize('FRED'); + * capitalize('FRED') * // => 'Fred' */ function capitalize(string) { - return upperFirst(toString(string).toLowerCase()); + return upperFirst(toString(string).toLowerCase()) } -export default capitalize; +export default capitalize diff --git a/castArray.js b/castArray.js index 55d46412ba..d00bd367cc 100644 --- a/castArray.js +++ b/castArray.js @@ -8,34 +8,34 @@ * @returns {Array} Returns the cast array. * @example * - * castArray(1); + * castArray(1) * // => [1] * - * castArray({ 'a': 1 }); + * castArray({ 'a': 1 }) * // => [{ 'a': 1 }] * - * castArray('abc'); + * castArray('abc') * // => ['abc'] * - * castArray(null); + * castArray(null) * // => [null] * - * castArray(undefined); + * castArray(undefined) * // => [undefined] * - * castArray(); + * castArray() * // => [] * - * const array = [1, 2, 3]; - * console.log(castArray(array) === array); + * const array = [1, 2, 3] + * console.log(castArray(array) === array) * // => true */ function castArray(...args) { if (!args.length) { - return []; + return [] } - const value = args[0]; - return Array.isArray(value) ? value : [value]; + const value = args[0] + return Array.isArray(value) ? value : [value] } -export default castArray; +export default castArray diff --git a/ceil.js b/ceil.js index 85a6dc6a4b..4481591bec 100644 --- a/ceil.js +++ b/ceil.js @@ -1,4 +1,4 @@ -import createRound from './.internal/createRound.js'; +import createRound from './.internal/createRound.js' /** * Computes `number` rounded up to `precision`. @@ -10,15 +10,15 @@ import createRound from './.internal/createRound.js'; * @returns {number} Returns the rounded up number. * @example * - * ceil(4.006); + * ceil(4.006) * // => 5 * - * ceil(6.004, 2); + * ceil(6.004, 2) * // => 6.01 * - * ceil(6040, -2); + * ceil(6040, -2) * // => 6100 */ -const ceil = createRound('ceil'); +const ceil = createRound('ceil') -export default ceil; +export default ceil diff --git a/chunk.js b/chunk.js index e9fea78d54..53395ce166 100644 --- a/chunk.js +++ b/chunk.js @@ -1,10 +1,10 @@ -import baseSlice from './.internal/baseSlice.js'; -import isIterateeCall from './.internal/isIterateeCall.js'; -import toInteger from './toInteger.js'; +import baseSlice from './.internal/baseSlice.js' +import isIterateeCall from './.internal/isIterateeCall.js' +import toInteger from './toInteger.js' /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeCeil = Math.ceil; -const nativeMax = Math.max; +const nativeCeil = Math.ceil +const nativeMax = Math.max /** * Creates an array of elements split into groups the length of `size`. @@ -19,30 +19,30 @@ const nativeMax = Math.max; * @returns {Array} Returns the new array of chunks. * @example * - * chunk(['a', 'b', 'c', 'd'], 2); + * chunk(['a', 'b', 'c', 'd'], 2) * // => [['a', 'b'], ['c', 'd']] * - * chunk(['a', 'b', 'c', 'd'], 3); + * chunk(['a', 'b', 'c', 'd'], 3) * // => [['a', 'b', 'c'], ['d']] */ function chunk(array, size, guard) { if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { - size = 1; + size = 1 } else { - size = nativeMax(toInteger(size), 0); + size = nativeMax(toInteger(size), 0) } - const length = array == null ? 0 : array.length; + const length = array == null ? 0 : array.length if (!length || size < 1) { - return []; + return [] } - let index = 0; - let resIndex = 0; - const result = Array(nativeCeil(length / size)); + let index = 0 + let resIndex = 0 + const result = Array(nativeCeil(length / size)) while (index < length) { - result[resIndex++] = baseSlice(array, index, (index += size)); + result[resIndex++] = baseSlice(array, index, (index += size)) } - return result; + return result } -export default chunk; +export default chunk diff --git a/clamp.js b/clamp.js index a7bf59dbb4..0f40c0e4c1 100644 --- a/clamp.js +++ b/clamp.js @@ -1,5 +1,5 @@ -import baseClamp from './.internal/baseClamp.js'; -import toNumber from './toNumber.js'; +import baseClamp from './.internal/baseClamp.js' +import toNumber from './toNumber.js' /** * Clamps `number` within the inclusive `lower` and `upper` bounds. @@ -12,20 +12,20 @@ import toNumber from './toNumber.js'; * @returns {number} Returns the clamped number. * @example * - * clamp(-10, -5, 5); + * clamp(-10, -5, 5) * // => -5 * - * clamp(10, -5, 5); + * clamp(10, -5, 5) * // => 5 */ function clamp(number, lower, upper) { - lower = toNumber(lower); - lower = lower === lower ? lower : 0; + lower = toNumber(lower) + lower = lower === lower ? lower : 0 - upper = toNumber(upper); - upper = upper === upper ? upper : 0; + upper = toNumber(upper) + upper = upper === upper ? upper : 0 - return baseClamp(toNumber(number), lower, upper); + return baseClamp(toNumber(number), lower, upper) } -export default clamp; +export default clamp diff --git a/clone.js b/clone.js index 16dac4de41..b4fdc83437 100644 --- a/clone.js +++ b/clone.js @@ -1,7 +1,7 @@ -import baseClone from './.internal/baseClone.js'; +import baseClone from './.internal/baseClone.js' /** Used to compose bitmasks for cloning. */ -const CLONE_SYMBOLS_FLAG = 4; +const CLONE_SYMBOLS_FLAG = 4 /** * Creates a shallow clone of `value`. @@ -21,14 +21,14 @@ const CLONE_SYMBOLS_FLAG = 4; * @see cloneDeep * @example * - * const objects = [{ 'a': 1 }, { 'b': 2 }]; + * const objects = [{ 'a': 1 }, { 'b': 2 }] * - * const shallow = clone(objects); - * console.log(shallow[0] === objects[0]); + * const shallow = clone(objects) + * console.log(shallow[0] === objects[0]) * // => true */ function clone(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG); + return baseClone(value, CLONE_SYMBOLS_FLAG) } -export default clone; +export default clone diff --git a/cloneDeep.js b/cloneDeep.js index 3f6a14247d..fad5ab0d03 100644 --- a/cloneDeep.js +++ b/cloneDeep.js @@ -1,8 +1,8 @@ -import baseClone from './.internal/baseClone.js'; +import baseClone from './.internal/baseClone.js' /** Used to compose bitmasks for cloning. */ -const CLONE_DEEP_FLAG = 1; -const CLONE_SYMBOLS_FLAG = 4; +const CLONE_DEEP_FLAG = 1 +const CLONE_SYMBOLS_FLAG = 4 /** * This method is like `clone` except that it recursively clones `value`. @@ -14,14 +14,14 @@ const CLONE_SYMBOLS_FLAG = 4; * @see clone * @example * - * const objects = [{ 'a': 1 }, { 'b': 2 }]; + * const objects = [{ 'a': 1 }, { 'b': 2 }] * - * const deep = cloneDeep(objects); - * console.log(deep[0] === objects[0]); + * const deep = cloneDeep(objects) + * console.log(deep[0] === objects[0]) * // => false */ function cloneDeep(value) { - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG) } -export default cloneDeep; +export default cloneDeep diff --git a/cloneDeepWith.js b/cloneDeepWith.js index ba27e8a29d..c736cedcfd 100644 --- a/cloneDeepWith.js +++ b/cloneDeepWith.js @@ -1,8 +1,8 @@ -import baseClone from './.internal/baseClone.js'; +import baseClone from './.internal/baseClone.js' /** Used to compose bitmasks for cloning. */ -const CLONE_DEEP_FLAG = 1; -const CLONE_SYMBOLS_FLAG = 4; +const CLONE_DEEP_FLAG = 1 +const CLONE_SYMBOLS_FLAG = 4 /** * This method is like `cloneWith` except that it recursively clones `value`. @@ -17,22 +17,22 @@ const CLONE_SYMBOLS_FLAG = 4; * * function customizer(value) { * if (isElement(value)) { - * return value.cloneNode(true); + * return value.cloneNode(true) * } * } * - * const el = cloneDeepWith(document.body, customizer); + * const el = cloneDeepWith(document.body, customizer) * - * console.log(el === document.body); + * console.log(el === document.body) * // => false - * console.log(el.nodeName); + * console.log(el.nodeName) * // => 'BODY' - * console.log(el.childNodes.length); + * console.log(el.childNodes.length) * // => 20 */ function cloneDeepWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + customizer = typeof customizer == 'function' ? customizer : undefined + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer) } -export default cloneDeepWith; +export default cloneDeepWith diff --git a/cloneWith.js b/cloneWith.js index 20a69203f7..2e43ff18f0 100644 --- a/cloneWith.js +++ b/cloneWith.js @@ -1,13 +1,13 @@ -import baseClone from './.internal/baseClone.js'; +import baseClone from './.internal/baseClone.js' /** Used to compose bitmasks for cloning. */ -const CLONE_SYMBOLS_FLAG = 4; +const CLONE_SYMBOLS_FLAG = 4 /** * This method is like `clone` except that it accepts `customizer` which * is invoked to produce the cloned value. If `customizer` returns `undefined`, * cloning is handled by the method instead. The `customizer` is invoked with - * up to four arguments; (value [, index|key, object, stack]). + * up to four arguments (value [, index|key, object, stack]). * * @since 4.0.0 * @category Lang @@ -19,22 +19,22 @@ const CLONE_SYMBOLS_FLAG = 4; * * function customizer(value) { * if (isElement(value)) { - * return value.cloneNode(false); + * return value.cloneNode(false) * } * } * - * const el = cloneWith(document.body, customizer); + * const el = cloneWith(document.body, customizer) * - * console.log(el === document.body); + * console.log(el === document.body) * // => false - * console.log(el.nodeName); + * console.log(el.nodeName) * // => 'BODY' - * console.log(el.childNodes.length); + * console.log(el.childNodes.length) * // => 0 */ function cloneWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + customizer = typeof customizer == 'function' ? customizer : undefined + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer) } -export default cloneWith; +export default cloneWith diff --git a/compact.js b/compact.js index a92d3a5f3d..a01290ef7c 100644 --- a/compact.js +++ b/compact.js @@ -8,22 +8,22 @@ * @returns {Array} Returns the new array of filtered values. * @example * - * compact([0, 1, false, 2, '', 3]); + * compact([0, 1, false, 2, '', 3]) * // => [1, 2, 3] */ function compact(array) { - let index = -1; - const length = array == null ? 0 : array.length; - let resIndex = 0; - const result = []; + let index = -1 + const length = array == null ? 0 : array.length + let resIndex = 0 + const result = [] while (++index < length) { - const value = array[index]; + const value = array[index] if (value) { - result[resIndex++] = value; + result[resIndex++] = value } } - return result; + return result } -export default compact; +export default compact diff --git a/concat.js b/concat.js index 49203aaa1d..10283331f7 100644 --- a/concat.js +++ b/concat.js @@ -1,6 +1,6 @@ -import arrayPush from './.internal/arrayPush.js'; -import baseFlatten from './.internal/baseFlatten.js'; -import copyArray from './.internal/copyArray.js'; +import arrayPush from './.internal/arrayPush.js' +import baseFlatten from './.internal/baseFlatten.js' +import copyArray from './.internal/copyArray.js' /** * Creates a new array concatenating `array` with any additional arrays @@ -13,17 +13,17 @@ import copyArray from './.internal/copyArray.js'; * @returns {Array} Returns the new concatenated array. * @example * - * const array = [1]; - * const other = concat(array, 2, [3], [[4]]); + * const array = [1] + * const other = concat(array, 2, [3], [[4]]) * - * console.log(other); + * console.log(other) * // => [1, 2, 3, [4]] * - * console.log(array); + * console.log(array) * // => [1] */ function concat(array, ...values) { - return arrayPush(Array.isArray(array) ? copyArray(array) : [array], baseFlatten(values, 1)); + return arrayPush(Array.isArray(array) ? copyArray(array) : [array], baseFlatten(values, 1)) } -export default concat; +export default concat diff --git a/cond.js b/cond.js index 0ee04f896f..5c632a7adb 100644 --- a/cond.js +++ b/cond.js @@ -1,5 +1,5 @@ -import apply from './.internal/apply.js'; -import arrayMap from './.internal/arrayMap.js'; +import apply from './.internal/apply.js' +import arrayMap from './.internal/arrayMap.js' /** * Creates a function that iterates over `pairs` and invokes the corresponding @@ -17,36 +17,36 @@ import arrayMap from './.internal/arrayMap.js'; * [matches({ 'a': 1 }), constant('matches A')], * [conforms({ 'b': isNumber }), constant('matches B')], * [stubTrue, constant('no match')] - * ]); + * ]) * - * func({ 'a': 1, 'b': 2 }); + * func({ 'a': 1, 'b': 2 }) * // => 'matches A' * - * func({ 'a': 0, 'b': 1 }); + * func({ 'a': 0, 'b': 1 }) * // => 'matches B' * - * func({ 'a': '1', 'b': '2' }); + * func({ 'a': '1', 'b': '2' }) * // => 'no match' */ function cond(pairs) { - const length = pairs == null ? 0 : pairs.length; + const length = pairs == null ? 0 : pairs.length pairs = !length ? [] : arrayMap(pairs, pair => { if (typeof pair[1] != 'function') { - throw new TypeError('Expected a function'); + throw new TypeError('Expected a function') } - return [pair[0], pair[1]]; - }); + return [pair[0], pair[1]] + }) return (...args) => { - let index = -1; + let index = -1 while (++index < length) { - const pair = pairs[index]; + const pair = pairs[index] if (apply(pair[0], this, args)) { - return apply(pair[1], this, args); + return apply(pair[1], this, args) } } - }; + } } -export default cond; +export default cond diff --git a/conforms.js b/conforms.js index 8468a5c827..843035eb00 100644 --- a/conforms.js +++ b/conforms.js @@ -1,8 +1,8 @@ -import baseClone from './.internal/baseClone.js'; -import baseConforms from './.internal/baseConforms.js'; +import baseClone from './.internal/baseClone.js' +import baseConforms from './.internal/baseConforms.js' /** Used to compose bitmasks for cloning. */ -const CLONE_DEEP_FLAG = 1; +const CLONE_DEEP_FLAG = 1 /** * Creates a function that invokes the predicate properties of `source` with @@ -21,13 +21,13 @@ const CLONE_DEEP_FLAG = 1; * const objects = [ * { 'a': 2, 'b': 1 }, * { 'a': 1, 'b': 2 } - * ]; + * ] * - * filter(objects, conforms({ 'b': function(n) { return n > 1; } })); + * filter(objects, conforms({ 'b': function(n) { return n > 1 } })) * // => [{ 'a': 1, 'b': 2 }] */ function conforms(source) { - return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); + return baseConforms(baseClone(source, CLONE_DEEP_FLAG)) } -export default conforms; +export default conforms diff --git a/conformsTo.js b/conformsTo.js index 286bd70b73..ffe47039d1 100644 --- a/conformsTo.js +++ b/conformsTo.js @@ -1,5 +1,5 @@ -import baseConformsTo from './.internal/baseConformsTo.js'; -import keys from './keys.js'; +import baseConformsTo from './.internal/baseConformsTo.js' +import keys from './keys.js' /** * Checks if `object` conforms to `source` by invoking the predicate @@ -15,16 +15,16 @@ import keys from './keys.js'; * @returns {boolean} Returns `true` if `object` conforms, else `false`. * @example * - * const object = { 'a': 1, 'b': 2 }; + * const object = { 'a': 1, 'b': 2 } * - * conformsTo(object, { 'b': function(n) { return n > 1; } }); + * conformsTo(object, { 'b': function(n) { return n > 1 } }) * // => true * - * conformsTo(object, { 'b': function(n) { return n > 2; } }); + * conformsTo(object, { 'b': function(n) { return n > 2 } }) * // => false */ function conformsTo(object, source) { - return source == null || baseConformsTo(object, source, keys(source)); + return source == null || baseConformsTo(object, source, keys(source)) } -export default conformsTo; +export default conformsTo diff --git a/countBy.js b/countBy.js index 4b3938951e..fb5d44752b 100644 --- a/countBy.js +++ b/countBy.js @@ -1,8 +1,8 @@ -import baseAssignValue from './.internal/baseAssignValue.js'; -import reduce from './reduce.js'; +import baseAssignValue from './.internal/baseAssignValue.js' +import reduce from './reduce.js' /** Used to check objects for own properties. */ -const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwnProperty = Object.prototype.hasOwnProperty /** * Creates an object composed of keys generated from the results of running @@ -17,18 +17,18 @@ const hasOwnProperty = Object.prototype.hasOwnProperty; * @returns {Object} Returns the composed aggregate object. * @example * - * countBy([6.1, 4.2, 6.3], Math.floor); + * countBy([6.1, 4.2, 6.3], Math.floor) * // => { '4': 1, '6': 2 } */ function countBy(collection, iteratee) { return reduce(collection, (result, value, key) => { if (hasOwnProperty.call(result, key)) { - ++result[key]; + ++result[key] } else { - baseAssignValue(result, key, 1); + baseAssignValue(result, key, 1) } - return result; - }, {}); + return result + }, {}) } -export default countBy; +export default countBy diff --git a/create.js b/create.js index 63833a2a35..e3b0f3e535 100644 --- a/create.js +++ b/create.js @@ -1,4 +1,4 @@ -import baseCreate from './.internal/baseCreate.js'; +import baseCreate from './.internal/baseCreate.js' /** * Creates an object that inherits from the `prototype` object. If a @@ -13,28 +13,28 @@ import baseCreate from './.internal/baseCreate.js'; * @example * * function Shape() { - * this.x = 0; - * this.y = 0; + * this.x = 0 + * this.y = 0 * } * * function Circle() { - * Shape.call(this); + * Shape.call(this) * } * * Circle.prototype = create(Shape.prototype, { * 'constructor': Circle - * }); + * }) * - * const circle = new Circle; - * circle instanceof Circle; + * const circle = new Circle + * circle instanceof Circle * // => true * - * circle instanceof Shape; + * circle instanceof Shape * // => true */ function create(prototype, properties) { - const result = baseCreate(prototype); - return properties == null ? result : Object.assign(result, properties); + const result = baseCreate(prototype) + return properties == null ? result : Object.assign(result, properties) } -export default create; +export default create diff --git a/curry.js b/curry.js index 47d232a9ae..f3bad3131b 100644 --- a/curry.js +++ b/curry.js @@ -1,7 +1,7 @@ -import createWrap from './.internal/createWrap.js'; +import createWrap from './.internal/createWrap.js' /** Used to compose bitmasks for function metadata. */ -const WRAP_CURRY_FLAG = 8; +const WRAP_CURRY_FLAG = 8 /** * Creates a function that accepts arguments of `func` and either invokes @@ -24,32 +24,32 @@ const WRAP_CURRY_FLAG = 8; * @example * * const abc = function(a, b, c) { - * return [a, b, c]; - * }; + * return [a, b, c] + * } * - * const curried = curry(abc); + * const curried = curry(abc) * - * curried(1)(2)(3); + * curried(1)(2)(3) * // => [1, 2, 3] * - * curried(1, 2)(3); + * curried(1, 2)(3) * // => [1, 2, 3] * - * curried(1, 2, 3); + * curried(1, 2, 3) * // => [1, 2, 3] * * // Curried with placeholders. - * curried(1)(_, 3)(2); + * curried(1)(_, 3)(2) * // => [1, 2, 3] */ function curry(func, arity, guard) { - arity = guard ? undefined : arity; - const result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curry.placeholder; - return result; + arity = guard ? undefined : arity + const result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity) + result.placeholder = curry.placeholder + return result } // Assign default placeholders. -curry.placeholder = {}; +curry.placeholder = {} -export default curry; +export default curry diff --git a/curryRight.js b/curryRight.js index 5761f68f1c..d75e10c35d 100644 --- a/curryRight.js +++ b/curryRight.js @@ -1,7 +1,7 @@ -import createWrap from './.internal/createWrap.js'; +import createWrap from './.internal/createWrap.js' /** Used to compose bitmasks for function metadata. */ -const WRAP_CURRY_RIGHT_FLAG = 16; +const WRAP_CURRY_RIGHT_FLAG = 16 /** * This method is like `curry` except that arguments are applied to `func` @@ -21,32 +21,32 @@ const WRAP_CURRY_RIGHT_FLAG = 16; * @example * * const abc = function(a, b, c) { - * return [a, b, c]; - * }; + * return [a, b, c] + * } * - * const curried = curryRight(abc); + * const curried = curryRight(abc) * - * curried(3)(2)(1); + * curried(3)(2)(1) * // => [1, 2, 3] * - * curried(2, 3)(1); + * curried(2, 3)(1) * // => [1, 2, 3] * - * curried(1, 2, 3); + * curried(1, 2, 3) * // => [1, 2, 3] * * // Curried with placeholders. - * curried(3)(1, _)(2); + * curried(3)(1, _)(2) * // => [1, 2, 3] */ function curryRight(func, arity, guard) { - arity = guard ? undefined : arity; - const result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curryRight.placeholder; - return result; + arity = guard ? undefined : arity + const result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity) + result.placeholder = curryRight.placeholder + return result } // Assign default placeholders. -curryRight.placeholder = {}; +curryRight.placeholder = {} -export default curryRight; +export default curryRight diff --git a/debounce.js b/debounce.js index 29dcad75fb..9cf01fdd31 100644 --- a/debounce.js +++ b/debounce.js @@ -1,9 +1,9 @@ -import isObject from './isObject.js'; -import toNumber from './toNumber.js'; +import isObject from './isObject.js' +import toNumber from './toNumber.js' /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeMax = Math.max; -const nativeMin = Math.min; +const nativeMax = Math.max +const nativeMin = Math.min /** * Creates a debounced function that delays invoking `func` until after `wait` @@ -41,21 +41,21 @@ const nativeMin = Math.min; * @example * * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', debounce(calculateLayout, 150)); + * jQuery(window).on('resize', debounce(calculateLayout, 150)) * * // Invoke `sendMail` when clicked, debouncing subsequent calls. * jQuery(element).on('click', debounce(sendMail, 300, { * 'leading': true, * 'trailing': false - * })); + * })) * * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * const debounced = debounce(batchLog, 250, { 'maxWait': 1000 }); - * const source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); + * const debounced = debounce(batchLog, 250, { 'maxWait': 1000 }) + * const source = new EventSource('/stream') + * jQuery(source).on('message', debounced) * * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); + * jQuery(window).on('popstate', debounced.cancel) */ function debounce(func, wait, options) { let lastArgs, @@ -63,121 +63,121 @@ function debounce(func, wait, options) { maxWait, result, timerId, - lastCallTime; + lastCallTime - let lastInvokeTime = 0; - let leading = false; - let maxing = false; - let trailing = true; + let lastInvokeTime = 0 + let leading = false + let maxing = false + let trailing = true if (typeof func != 'function') { - throw new TypeError('Expected a function'); + throw new TypeError('Expected a function') } - wait = toNumber(wait) || 0; + wait = toNumber(wait) || 0 if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; + leading = !!options.leading + maxing = 'maxWait' in options + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait + trailing = 'trailing' in options ? !!options.trailing : trailing } function invokeFunc(time) { - const args = lastArgs; - const thisArg = lastThis; + const args = lastArgs + const thisArg = lastThis - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; + lastArgs = lastThis = undefined + lastInvokeTime = time + result = func.apply(thisArg, args) + return result } function leadingEdge(time) { // Reset any `maxWait` timer. - lastInvokeTime = time; + lastInvokeTime = time // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); + timerId = setTimeout(timerExpired, wait) // Invoke the leading edge. - return leading ? invokeFunc(time) : result; + return leading ? invokeFunc(time) : result } function remainingWait(time) { - const timeSinceLastCall = time - lastCallTime; - const timeSinceLastInvoke = time - lastInvokeTime; - const result = wait - timeSinceLastCall; + const timeSinceLastCall = time - lastCallTime + const timeSinceLastInvoke = time - lastInvokeTime + const result = wait - timeSinceLastCall - return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result } function shouldInvoke(time) { - const timeSinceLastCall = time - lastCallTime; - const timeSinceLastInvoke = time - lastInvokeTime; + const timeSinceLastCall = time - lastCallTime + const timeSinceLastInvoke = time - lastInvokeTime // 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 === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)) } function timerExpired() { - const time = Date.now(); + const time = Date.now() if (shouldInvoke(time)) { - return trailingEdge(time); + return trailingEdge(time) } // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); + timerId = setTimeout(timerExpired, remainingWait(time)) } function trailingEdge(time) { - timerId = undefined; + timerId = undefined // Only invoke if we have `lastArgs` which means `func` has been // debounced at least once. if (trailing && lastArgs) { - return invokeFunc(time); + return invokeFunc(time) } - lastArgs = lastThis = undefined; - return result; + lastArgs = lastThis = undefined + return result } function cancel() { if (timerId !== undefined) { - clearTimeout(timerId); + clearTimeout(timerId) } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; + lastInvokeTime = 0 + lastArgs = lastCallTime = lastThis = timerId = undefined } function flush() { - return timerId === undefined ? result : trailingEdge(Date.now()); + return timerId === undefined ? result : trailingEdge(Date.now()) } function debounced(...args) { - const time = Date.now(); - const isInvoking = shouldInvoke(time); + const time = Date.now() + const isInvoking = shouldInvoke(time) - lastArgs = args; - lastThis = this; - lastCallTime = time; + lastArgs = args + lastThis = this + lastCallTime = time if (isInvoking) { if (timerId === undefined) { - return leadingEdge(lastCallTime); + return leadingEdge(lastCallTime) } if (maxing) { // Handle invocations in a tight loop. - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); + timerId = setTimeout(timerExpired, wait) + return invokeFunc(lastCallTime) } } if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); + timerId = setTimeout(timerExpired, wait) } - return result; + return result } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; + debounced.cancel = cancel + debounced.flush = flush + return debounced } -export default debounce; +export default debounce diff --git a/deburr.js b/deburr.js index 2360377129..50a40b34a6 100644 --- a/deburr.js +++ b/deburr.js @@ -1,23 +1,23 @@ -import deburrLetter from './.internal/deburrLetter.js'; -import toString from './toString.js'; +import deburrLetter from './.internal/deburrLetter.js' +import toString from './toString.js' /** Used to match Latin Unicode letters (excluding mathematical operators). */ -const reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; +const reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g /** Used to compose unicode character classes. */ -const rsComboMarksRange = '\\u0300-\\u036f'; -const reComboHalfMarksRange = '\\ufe20-\\ufe2f'; -const rsComboSymbolsRange = '\\u20d0-\\u20ff'; -const rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; +const rsComboMarksRange = '\\u0300-\\u036f' +const reComboHalfMarksRange = '\\ufe20-\\ufe2f' +const rsComboSymbolsRange = '\\u20d0-\\u20ff' +const rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange /** Used to compose unicode capture groups. */ -const rsCombo = `[${ rsComboRange }]`; +const rsCombo = `[${ rsComboRange }]` /** * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). */ -const reComboMark = RegExp(rsCombo, 'g'); +const reComboMark = RegExp(rsCombo, 'g') /** * Deburrs `string` by converting @@ -32,12 +32,12 @@ const reComboMark = RegExp(rsCombo, 'g'); * @returns {string} Returns the deburred string. * @example * - * deburr('déjà vu'); + * deburr('déjà vu') * // => 'deja vu' */ function deburr(string) { - string = toString(string); - return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + string = toString(string) + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '') } -export default deburr; +export default deburr diff --git a/defaultTo.js b/defaultTo.js index 8b1b91d15d..6f43f29ca2 100644 --- a/defaultTo.js +++ b/defaultTo.js @@ -10,14 +10,14 @@ * @returns {*} Returns the resolved value. * @example * - * defaultTo(1, 10); + * defaultTo(1, 10) * // => 1 * - * defaultTo(undefined, 10); + * defaultTo(undefined, 10) * // => 10 */ function defaultTo(value, defaultValue) { - return (value == null || value !== value) ? defaultValue : value; + return (value == null || value !== value) ? defaultValue : value } -export default defaultTo; +export default defaultTo diff --git a/defaults.js b/defaults.js index 3802e3897d..78eabac51f 100644 --- a/defaults.js +++ b/defaults.js @@ -1,6 +1,6 @@ -import apply from './.internal/apply.js'; -import assignInWith from './assignInWith.js'; -import customDefaultsAssignIn from './.internal/customDefaultsAssignIn.js'; +import apply from './.internal/apply.js' +import assignInWith from './assignInWith.js' +import customDefaultsAssignIn from './.internal/customDefaultsAssignIn.js' /** * Assigns own and inherited enumerable string keyed properties of source @@ -18,12 +18,12 @@ import customDefaultsAssignIn from './.internal/customDefaultsAssignIn.js'; * @see defaultsDeep * @example * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }) * // => { 'a': 1, 'b': 2 } */ function defaults(...args) { - args.push(undefined, customDefaultsAssignIn); - return apply(assignInWith, undefined, args); + args.push(undefined, customDefaultsAssignIn) + return apply(assignInWith, undefined, args) } -export default defaults; +export default defaults diff --git a/defaultsDeep.js b/defaultsDeep.js index 6937048314..1ee4bdf6ad 100644 --- a/defaultsDeep.js +++ b/defaultsDeep.js @@ -1,6 +1,6 @@ -import apply from './.internal/apply.js'; -import customDefaultsMerge from './.internal/customDefaultsMerge.js'; -import mergeWith from './mergeWith.js'; +import apply from './.internal/apply.js' +import customDefaultsMerge from './.internal/customDefaultsMerge.js' +import mergeWith from './mergeWith.js' /** * This method is like `defaults` except that it recursively assigns @@ -16,12 +16,12 @@ import mergeWith from './mergeWith.js'; * @see defaults * @example * - * defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }) * // => { 'a': { 'b': 2, 'c': 3 } } */ function defaultsDeep(...args) { - args.push(undefined, customDefaultsMerge); - return apply(mergeWith, undefined, args); + args.push(undefined, customDefaultsMerge) + return apply(mergeWith, undefined, args) } -export default defaultsDeep; +export default defaultsDeep diff --git a/defer.js b/defer.js index 1131ff32d9..c5b5ed9f1b 100644 --- a/defer.js +++ b/defer.js @@ -9,14 +9,14 @@ * @returns {number} Returns the timer id. * @example * - * defer(text => console.log(text), 'deferred'); + * defer(text => console.log(text), 'deferred') * // => Logs 'deferred' after one millisecond. */ function defer(func, ...args) { if (typeof func != 'function') { - throw new TypeError('Expected a function'); + throw new TypeError('Expected a function') } - return setTimeout(func, 1, ...args); + return setTimeout(func, 1, ...args) } -export default defer; +export default defer diff --git a/delay.js b/delay.js index 6119d9074c..3b9559b653 100644 --- a/delay.js +++ b/delay.js @@ -1,4 +1,4 @@ -import toNumber from './toNumber.js'; +import toNumber from './toNumber.js' /** * Invokes `func` after `wait` milliseconds. Any additional arguments are @@ -12,14 +12,14 @@ import toNumber from './toNumber.js'; * @returns {number} Returns the timer id. * @example * - * delay(text => console.log(text), 1000, 'later'); + * delay(text => console.log(text), 1000, 'later') * // => Logs 'later' after one second. */ function delay(func, wait, ...args) { if (typeof func != 'function') { - throw new TypeError('Expected a function'); + throw new TypeError('Expected a function') } - return setTimeout(func, toNumber(wait) || 0, ...args); + return setTimeout(func, toNumber(wait) || 0, ...args) } -export default delay; +export default delay diff --git a/difference.js b/difference.js index be4be904d6..6a25b1e8aa 100644 --- a/difference.js +++ b/difference.js @@ -1,6 +1,6 @@ -import baseDifference from './.internal/baseDifference.js'; -import baseFlatten from './.internal/baseFlatten.js'; -import isArrayLikeObject from './isArrayLikeObject.js'; +import baseDifference from './.internal/baseDifference.js' +import baseFlatten from './.internal/baseFlatten.js' +import isArrayLikeObject from './isArrayLikeObject.js' /** * Creates an array of `array` values not included in the other given arrays @@ -18,13 +18,13 @@ import isArrayLikeObject from './isArrayLikeObject.js'; * @see union, unionBy, unionWith, without, xor, xorBy, xorWith, * @example * - * difference([2, 1], [2, 3]); + * difference([2, 1], [2, 3]) * // => [1] */ function difference(array, ...values) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) - : []; + : [] } -export default difference; +export default difference diff --git a/differenceBy.js b/differenceBy.js index 0ed66608ca..f4c063e0eb 100644 --- a/differenceBy.js +++ b/differenceBy.js @@ -1,7 +1,7 @@ -import baseDifference from './.internal/baseDifference.js'; -import baseFlatten from './.internal/baseFlatten.js'; -import isArrayLikeObject from './isArrayLikeObject.js'; -import last from './last.js'; +import baseDifference from './.internal/baseDifference.js' +import baseFlatten from './.internal/baseFlatten.js' +import isArrayLikeObject from './isArrayLikeObject.js' +import last from './last.js' /** * This method is like `difference` except that it accepts `iteratee` which @@ -20,17 +20,17 @@ import last from './last.js'; * @returns {Array} Returns the new array of filtered values. * @example * - * differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor) * // => [1.2] */ function differenceBy(array, ...values) { - let iteratee = last(values); + let iteratee = last(values) if (isArrayLikeObject(iteratee)) { - iteratee = undefined; + iteratee = undefined } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), iteratee) - : []; + : [] } -export default differenceBy; +export default differenceBy diff --git a/differenceWith.js b/differenceWith.js index e14a78c7ba..542cf2adfe 100644 --- a/differenceWith.js +++ b/differenceWith.js @@ -1,7 +1,7 @@ -import baseDifference from './.internal/baseDifference.js'; -import baseFlatten from './.internal/baseFlatten.js'; -import isArrayLikeObject from './isArrayLikeObject.js'; -import last from './last.js'; +import baseDifference from './.internal/baseDifference.js' +import baseFlatten from './.internal/baseFlatten.js' +import isArrayLikeObject from './isArrayLikeObject.js' +import last from './last.js' /** * This method is like `difference` except that it accepts `comparator` @@ -19,19 +19,19 @@ import last from './last.js'; * @returns {Array} Returns the new array of filtered values. * @example * - * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] * - * differenceWith(objects, [{ 'x': 1, 'y': 2 }], isEqual); + * differenceWith(objects, [{ 'x': 1, 'y': 2 }], isEqual) * // => [{ 'x': 2, 'y': 1 }] */ function differenceWith(array, ...values) { - let comparator = last(values); + let comparator = last(values) if (isArrayLikeObject(comparator)) { - comparator = undefined; + comparator = undefined } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) - : []; + : [] } -export default differenceWith; +export default differenceWith diff --git a/divide.js b/divide.js index 4be825307f..70f6f4d0b4 100644 --- a/divide.js +++ b/divide.js @@ -1,4 +1,4 @@ -import createMathOperation from './.internal/createMathOperation.js'; +import createMathOperation from './.internal/createMathOperation.js' /** * Divide two numbers. @@ -10,9 +10,9 @@ import createMathOperation from './.internal/createMathOperation.js'; * @returns {number} Returns the quotient. * @example * - * divide(6, 4); + * divide(6, 4) * // => 1.5 */ -const divide = createMathOperation((dividend, divisor) => dividend / divisor, 1); +const divide = createMathOperation((dividend, divisor) => dividend / divisor, 1) -export default divide; +export default divide diff --git a/drop.js b/drop.js index ce34e6d66d..3063d1492d 100644 --- a/drop.js +++ b/drop.js @@ -1,5 +1,5 @@ -import baseSlice from './.internal/baseSlice.js'; -import toInteger from './toInteger.js'; +import baseSlice from './.internal/baseSlice.js' +import toInteger from './toInteger.js' /** * Creates a slice of `array` with `n` elements dropped from the beginning. @@ -12,25 +12,25 @@ import toInteger from './toInteger.js'; * @returns {Array} Returns the slice of `array`. * @example * - * drop([1, 2, 3]); + * drop([1, 2, 3]) * // => [2, 3] * - * drop([1, 2, 3], 2); + * drop([1, 2, 3], 2) * // => [3] * - * drop([1, 2, 3], 5); + * drop([1, 2, 3], 5) * // => [] * - * drop([1, 2, 3], 0); + * drop([1, 2, 3], 0) * // => [1, 2, 3] */ function drop(array, n, guard) { - const length = array == null ? 0 : array.length; + const length = array == null ? 0 : array.length if (!length) { - return []; + return [] } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, n < 0 ? 0 : n, length); + n = (guard || n === undefined) ? 1 : toInteger(n) + return baseSlice(array, n < 0 ? 0 : n, length) } -export default drop; +export default drop diff --git a/dropRight.js b/dropRight.js index 06fcf71cc4..00d702a8a4 100644 --- a/dropRight.js +++ b/dropRight.js @@ -1,5 +1,5 @@ -import baseSlice from './.internal/baseSlice.js'; -import toInteger from './toInteger.js'; +import baseSlice from './.internal/baseSlice.js' +import toInteger from './toInteger.js' /** * Creates a slice of `array` with `n` elements dropped from the end. @@ -12,26 +12,26 @@ import toInteger from './toInteger.js'; * @returns {Array} Returns the slice of `array`. * @example * - * dropRight([1, 2, 3]); + * dropRight([1, 2, 3]) * // => [1, 2] * - * dropRight([1, 2, 3], 2); + * dropRight([1, 2, 3], 2) * // => [1] * - * dropRight([1, 2, 3], 5); + * dropRight([1, 2, 3], 5) * // => [] * - * dropRight([1, 2, 3], 0); + * dropRight([1, 2, 3], 0) * // => [1, 2, 3] */ function dropRight(array, n, guard) { - const length = array == null ? 0 : array.length; + const length = array == null ? 0 : array.length if (!length) { - return []; + return [] } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, 0, n < 0 ? 0 : n); + n = (guard || n === undefined) ? 1 : toInteger(n) + n = length - n + return baseSlice(array, 0, n < 0 ? 0 : n) } -export default dropRight; +export default dropRight diff --git a/dropRightWhile.js b/dropRightWhile.js index d5a8039baa..ab2dd5f72f 100644 --- a/dropRightWhile.js +++ b/dropRightWhile.js @@ -1,4 +1,4 @@ -import baseWhile from './.internal/baseWhile.js'; +import baseWhile from './.internal/baseWhile.js' /** * Creates a slice of `array` excluding elements dropped from the end. @@ -16,15 +16,15 @@ import baseWhile from './.internal/baseWhile.js'; * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': true }, * { 'user': 'pebbles', 'active': true } - * ]; + * ] * - * dropRightWhile(users, ({ active }) => active); + * dropRightWhile(users, ({ active }) => active) * // => objects for ['barney'] */ function dropRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, predicate, true, true) - : []; + : [] } -export default dropRightWhile; +export default dropRightWhile diff --git a/dropWhile.js b/dropWhile.js index db74193760..fc4fe43bc8 100644 --- a/dropWhile.js +++ b/dropWhile.js @@ -1,4 +1,4 @@ -import baseWhile from './.internal/baseWhile.js'; +import baseWhile from './.internal/baseWhile.js' /** * Creates a slice of `array` excluding elements dropped from the beginning. @@ -16,15 +16,15 @@ import baseWhile from './.internal/baseWhile.js'; * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': true }, * { 'user': 'pebbles', 'active': false } - * ]; + * ] * - * dropWhile(users, ({ active }) => active); + * dropWhile(users, ({ active }) => active) * // => objects for ['pebbles'] */ function dropWhile(array, predicate) { return (array && array.length) ? baseWhile(array, predicate, true) - : []; + : [] } -export default dropWhile; +export default dropWhile diff --git a/each.js b/each.js index 3032e55d99..d2fd2ffbd3 100644 --- a/each.js +++ b/each.js @@ -1 +1 @@ -export { default } from './forEach.js'; +export { default } from './forEach.js' diff --git a/eachRight.js b/eachRight.js index c485893e32..b08d8f5e0e 100644 --- a/eachRight.js +++ b/eachRight.js @@ -1 +1 @@ -export { default } from './forEachRight.js'; +export { default } from './forEachRight.js' diff --git a/endsWith.js b/endsWith.js index 1c4f5cb923..3482d9c29c 100644 --- a/endsWith.js +++ b/endsWith.js @@ -1,7 +1,7 @@ -import baseClamp from './.internal/baseClamp.js'; -import baseToString from './.internal/baseToString.js'; -import toInteger from './toInteger.js'; -import toString from './toString.js'; +import baseClamp from './.internal/baseClamp.js' +import baseToString from './.internal/baseToString.js' +import toInteger from './toInteger.js' +import toString from './toString.js' /** * Checks if `string` ends with the given target string. @@ -16,27 +16,27 @@ import toString from './toString.js'; * @see includes, startsWith * @example * - * endsWith('abc', 'c'); + * endsWith('abc', 'c') * // => true * - * endsWith('abc', 'b'); + * endsWith('abc', 'b') * // => false * - * endsWith('abc', 'b', 2); + * endsWith('abc', 'b', 2) * // => true */ function endsWith(string, target, position) { - string = toString(string); - target = baseToString(target); + string = toString(string) + target = baseToString(target) - const length = string.length; + const length = string.length position = position === undefined ? length - : baseClamp(toInteger(position), 0, length); + : baseClamp(toInteger(position), 0, length) - const end = position; - position -= target.length; - return position >= 0 && string.slice(position, end) == target; + const end = position + position -= target.length + return position >= 0 && string.slice(position, end) == target } -export default endsWith; +export default endsWith diff --git a/eq.js b/eq.js index cb6d8abab1..06333c4cd4 100644 --- a/eq.js +++ b/eq.js @@ -10,26 +10,26 @@ * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * - * const object = { 'a': 1 }; - * const other = { 'a': 1 }; + * const object = { 'a': 1 } + * const other = { 'a': 1 } * - * eq(object, object); + * eq(object, object) * // => true * - * eq(object, other); + * eq(object, other) * // => false * - * eq('a', 'a'); + * eq('a', 'a') * // => true * - * eq('a', Object('a')); + * eq('a', Object('a')) * // => false * - * eq(NaN, NaN); + * eq(NaN, NaN) * // => true */ function eq(value, other) { - return value === other || (value !== value && other !== other); + return value === other || (value !== value && other !== other) } -export default eq; +export default eq diff --git a/eqDeep.js b/eqDeep.js index 47d2d3ea84..b1870f5d6e 100644 --- a/eqDeep.js +++ b/eqDeep.js @@ -1,4 +1,4 @@ -import baseIsEqual from './.internal/baseIsEqual.js'; +import baseIsEqual from './.internal/baseIsEqual.js' /** * Performs a deep comparison between two values to determine if they are @@ -17,17 +17,17 @@ import baseIsEqual from './.internal/baseIsEqual.js'; * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * - * const object = { 'a': 1 }; - * const other = { 'a': 1 }; + * const object = { 'a': 1 } + * const other = { 'a': 1 } * - * isEqual(object, other); + * isEqual(object, other) * // => true * - * object === other; + * object === other * // => false */ function isEqual(value, other) { - return baseIsEqual(value, other); + return baseIsEqual(value, other) } -export default isEqual; +export default isEqual diff --git a/escape.js b/escape.js index a7e5ff8cbd..4a5445e94c 100644 --- a/escape.js +++ b/escape.js @@ -1,17 +1,17 @@ -import toString from './toString.js'; +import toString from './toString.js' /** Used to map characters to HTML entities. */ const htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}; + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +} /** Used to match HTML entities and HTML characters. */ -const reUnescapedHtml = /[&<>"']/g; -const reHasUnescapedHtml = RegExp(reUnescapedHtml.source); +const reUnescapedHtml = /[&<>"']/g +const reHasUnescapedHtml = RegExp(reUnescapedHtml.source) /** * Converts the characters "&", "<", ">", '"', and "'" in `string` to their @@ -37,14 +37,14 @@ const reHasUnescapedHtml = RegExp(reUnescapedHtml.source); * @see escapeRegExp, unescape * @example * - * escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' + * escape('fred, barney, & pebbles') + * // => 'fred, barney, & pebbles' */ function escape(string) { - string = toString(string); + string = toString(string) return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, chr => htmlEscapes[chr]) - : string; + : string } -export default escape; +export default escape diff --git a/escapeRegExp.js b/escapeRegExp.js index 3bfd3f170b..f2cb434b62 100644 --- a/escapeRegExp.js +++ b/escapeRegExp.js @@ -1,11 +1,11 @@ -import toString from './toString.js'; +import toString from './toString.js' /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ -const reRegExpChar = /[\\^$.*+?()[\]{}|]/g; -const reHasRegExpChar = RegExp(reRegExpChar.source); +const reRegExpChar = /[\\^$.*+?()[\]{}|]/g +const reHasRegExpChar = RegExp(reRegExpChar.source) /** * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", @@ -18,14 +18,14 @@ const reHasRegExpChar = RegExp(reRegExpChar.source); * @see escape, escapeRegExp, unescape * @example * - * escapeRegExp('[lodash](https://lodash.com/)'); + * escapeRegExp('[lodash](https://lodash.com/)') * // => '\[lodash\]\(https://lodash\.com/\)' */ function escapeRegExp(string) { - string = toString(string); + string = toString(string) return (string && reHasRegExpChar.test(string)) ? string.replace(reRegExpChar, '\\$&') - : string; + : string } -export default escapeRegExp; +export default escapeRegExp diff --git a/every.js b/every.js index 3d9acf158a..5f29f7b79b 100644 --- a/every.js +++ b/every.js @@ -1,6 +1,6 @@ -import arrayEvery from './.internal/arrayEvery.js'; -import baseEvery from './.internal/baseEvery.js'; -import isIterateeCall from './.internal/isIterateeCall.js'; +import arrayEvery from './.internal/arrayEvery.js' +import baseEvery from './.internal/baseEvery.js' +import isIterateeCall from './.internal/isIterateeCall.js' /** * Checks if `predicate` returns truthy for **all** elements of `collection`. @@ -21,15 +21,15 @@ import isIterateeCall from './.internal/isIterateeCall.js'; * else `false`. * @example * - * every([true, 1, null, 'yes'], Boolean); + * every([true, 1, null, 'yes'], Boolean) * // => false */ function every(collection, predicate, guard) { - const func = Array.isArray(collection) ? arrayEvery : baseEvery; + const func = Array.isArray(collection) ? arrayEvery : baseEvery if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; + predicate = undefined } - return func(collection, predicate); + return func(collection, predicate) } -export default every; +export default every diff --git a/filter.js b/filter.js index 3a98b75b4d..4ce334f5fe 100644 --- a/filter.js +++ b/filter.js @@ -1,5 +1,5 @@ -import arrayFilter from './.internal/arrayFilter.js'; -import baseFilter from './.internal/baseFilter.js'; +import arrayFilter from './.internal/arrayFilter.js' +import baseFilter from './.internal/baseFilter.js' /** * Iterates over elements of `collection`, returning an array of all elements @@ -19,14 +19,14 @@ import baseFilter from './.internal/baseFilter.js'; * const users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false } - * ]; + * ] * - * filter(users, ({ active }) => active); + * filter(users, ({ active }) => active) * // => objects for ['barney'] */ function filter(collection, predicate) { - const func = Array.isArray(collection) ? arrayFilter : baseFilter; - return func(collection, predicate); + const func = Array.isArray(collection) ? arrayFilter : baseFilter + return func(collection, predicate) } -export default filter; +export default filter diff --git a/find.js b/find.js index 610ed033d6..199e29aa72 100644 --- a/find.js +++ b/find.js @@ -1,5 +1,5 @@ -import createFind from './.internal/createFind.js'; -import findIndex from './findIndex.js'; +import createFind from './.internal/createFind.js' +import findIndex from './findIndex.js' /** * Iterates over elements of `collection`, returning the first element @@ -19,11 +19,11 @@ import findIndex from './findIndex.js'; * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false }, * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; + * ] * - * find(users, ({ age }) => age < 40); + * find(users, ({ age }) => age < 40) * // => object for 'barney' */ -const find = createFind(findIndex); +const find = createFind(findIndex) -export default find; +export default find diff --git a/findKey.js b/findKey.js index 4f291aea57..45dd63d982 100644 --- a/findKey.js +++ b/findKey.js @@ -1,5 +1,5 @@ -import baseFindKey from './.internal/baseFindKey.js'; -import baseForOwn from './.internal/baseForOwn.js'; +import baseFindKey from './.internal/baseFindKey.js' +import baseForOwn from './.internal/baseForOwn.js' /** * This method is like `find` except that it returns the key of the first @@ -18,13 +18,13 @@ import baseForOwn from './.internal/baseForOwn.js'; * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } - * }; + * } * - * findKey(users, ({ age }) => age < 40); + * findKey(users, ({ age }) => age < 40) * // => 'barney' (iteration order is not guaranteed) */ function findKey(object, predicate) { - return baseFindKey(object, predicate, baseForOwn); + return baseFindKey(object, predicate, baseForOwn) } -export default findKey; +export default findKey diff --git a/findLast.js b/findLast.js index c6b91d8a33..afd03ef9d3 100644 --- a/findLast.js +++ b/findLast.js @@ -1,5 +1,5 @@ -import createFind from './.internal/createFind.js'; -import findLastIndex from './findLastIndex.js'; +import createFind from './.internal/createFind.js' +import findLastIndex from './findLastIndex.js' /** * This method is like `find` except that it iterates over elements of @@ -14,9 +14,9 @@ import findLastIndex from './findLastIndex.js'; * @see find, findIndex, findKey, findLastIndex, findLastKey * @example * - * findLast([1, 2, 3, 4], n => n % 2 == 1); + * findLast([1, 2, 3, 4], n => n % 2 == 1) * // => 3 */ -const findLast = createFind(findLastIndex); +const findLast = createFind(findLastIndex) -export default findLast; +export default findLast diff --git a/findLastIndex.js b/findLastIndex.js index d0e7728373..8fd340d4e3 100644 --- a/findLastIndex.js +++ b/findLastIndex.js @@ -1,9 +1,9 @@ -import baseFindIndex from './.internal/baseFindIndex.js'; -import toInteger from './toInteger.js'; +import baseFindIndex from './.internal/baseFindIndex.js' +import toInteger from './toInteger.js' /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeMax = Math.max; -const nativeMin = Math.min; +const nativeMax = Math.max +const nativeMin = Math.min /** * This method is like `findIndex` except that it iterates over elements @@ -22,24 +22,24 @@ const nativeMin = Math.min; * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } - * ]; + * ] * - * findLastIndex(users, ({ user }) => user == 'pebbles'); + * findLastIndex(users, ({ user }) => user == 'pebbles') * // => 2 */ function findLastIndex(array, predicate, fromIndex) { - const length = array == null ? 0 : array.length; + const length = array == null ? 0 : array.length if (!length) { - return -1; + return -1 } - let index = length - 1; + let index = length - 1 if (fromIndex !== undefined) { - index = toInteger(fromIndex); + index = toInteger(fromIndex) index = fromIndex < 0 ? nativeMax(length + index, 0) - : nativeMin(index, length - 1); + : nativeMin(index, length - 1) } - return baseFindIndex(array, predicate, index, true); + return baseFindIndex(array, predicate, index, true) } -export default findLastIndex; +export default findLastIndex diff --git a/findLastKey.js b/findLastKey.js index b4907cf2cb..879f3ad5f1 100644 --- a/findLastKey.js +++ b/findLastKey.js @@ -1,5 +1,5 @@ -import baseFindKey from './.internal/baseFindKey.js'; -import baseForOwnRight from './.internal/baseForOwnRight.js'; +import baseFindKey from './.internal/baseFindKey.js' +import baseForOwnRight from './.internal/baseForOwnRight.js' /** * This method is like `findKey` except that it iterates over elements of @@ -18,13 +18,13 @@ import baseForOwnRight from './.internal/baseForOwnRight.js'; * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } - * }; + * } * - * findLastKey(users, ({ age }) => age < 40); + * findLastKey(users, ({ age }) => age < 40) * // => returns 'pebbles' assuming `findKey` returns 'barney' */ function findLastKey(object, predicate) { - return baseFindKey(object, predicate, baseForOwnRight); + return baseFindKey(object, predicate, baseForOwnRight) } -export default findLastKey; +export default findLastKey diff --git a/first.js b/first.js index b92dbb611a..db707ff9a5 100644 --- a/first.js +++ b/first.js @@ -1 +1 @@ -export { default } from './head.js'; +export { default } from './head.js' diff --git a/flatMap.js b/flatMap.js index 2f4e99d227..54d88448b1 100644 --- a/flatMap.js +++ b/flatMap.js @@ -1,5 +1,5 @@ -import baseFlatten from './.internal/baseFlatten.js'; -import map from './map.js'; +import baseFlatten from './.internal/baseFlatten.js' +import map from './map.js' /** * Creates a flattened array of values by running each element in `collection` @@ -15,14 +15,14 @@ import map from './map.js'; * @example * * function duplicate(n) { - * return [n, n]; + * return [n, n] * } * - * flatMap([1, 2], duplicate); + * flatMap([1, 2], duplicate) * // => [1, 1, 2, 2] */ function flatMap(collection, iteratee) { - return baseFlatten(map(collection, iteratee), 1); + return baseFlatten(map(collection, iteratee), 1) } -export default flatMap; +export default flatMap diff --git a/flatMapDeep.js b/flatMapDeep.js index da72762791..9c9c5d855b 100644 --- a/flatMapDeep.js +++ b/flatMapDeep.js @@ -1,8 +1,8 @@ -import baseFlatten from './.internal/baseFlatten.js'; -import map from './map.js'; +import baseFlatten from './.internal/baseFlatten.js' +import map from './map.js' /** Used as references for various `Number` constants. */ -const INFINITY = 1 / 0; +const INFINITY = 1 / 0 /** * This method is like `flatMap` except that it recursively flattens the @@ -17,14 +17,14 @@ const INFINITY = 1 / 0; * @example * * function duplicate(n) { - * return [[[n, n]]]; + * return [[[n, n]]] * } * - * flatMapDeep([1, 2], duplicate); + * flatMapDeep([1, 2], duplicate) * // => [1, 1, 2, 2] */ function flatMapDeep(collection, iteratee) { - return baseFlatten(map(collection, iteratee), INFINITY); + return baseFlatten(map(collection, iteratee), INFINITY) } -export default flatMapDeep; +export default flatMapDeep diff --git a/flatMapDepth.js b/flatMapDepth.js index 10df405851..6c8867eb00 100644 --- a/flatMapDepth.js +++ b/flatMapDepth.js @@ -1,6 +1,6 @@ -import baseFlatten from './.internal/baseFlatten.js'; -import map from './map.js'; -import toInteger from './toInteger.js'; +import baseFlatten from './.internal/baseFlatten.js' +import map from './map.js' +import toInteger from './toInteger.js' /** * This method is like `flatMap` except that it recursively flattens the @@ -16,15 +16,15 @@ import toInteger from './toInteger.js'; * @example * * function duplicate(n) { - * return [[[n, n]]]; + * return [[[n, n]]] * } * - * flatMapDepth([1, 2], duplicate, 2); + * flatMapDepth([1, 2], duplicate, 2) * // => [[1, 1], [2, 2]] */ function flatMapDepth(collection, iteratee, depth) { - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(map(collection, iteratee), depth); + depth = depth === undefined ? 1 : toInteger(depth) + return baseFlatten(map(collection, iteratee), depth) } -export default flatMapDepth; +export default flatMapDepth diff --git a/flatten.js b/flatten.js index d6b830ab9b..75a834c844 100644 --- a/flatten.js +++ b/flatten.js @@ -1,4 +1,4 @@ -import baseFlatten from './.internal/baseFlatten.js'; +import baseFlatten from './.internal/baseFlatten.js' /** * Flattens `array` a single level deep. @@ -10,12 +10,12 @@ import baseFlatten from './.internal/baseFlatten.js'; * @see flatMap, flatMapDeep, flatMapDepth, flattenDeep, flattenDepth * @example * - * flatten([1, [2, [3, [4]], 5]]); + * flatten([1, [2, [3, [4]], 5]]) * // => [1, 2, [3, [4]], 5] */ function flatten(array) { - const length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; + const length = array == null ? 0 : array.length + return length ? baseFlatten(array, 1) : [] } -export default flatten; +export default flatten diff --git a/flattenDeep.js b/flattenDeep.js index 6fa594aff0..8a96f58cf5 100644 --- a/flattenDeep.js +++ b/flattenDeep.js @@ -1,7 +1,7 @@ -import baseFlatten from './.internal/baseFlatten.js'; +import baseFlatten from './.internal/baseFlatten.js' /** Used as references for various `Number` constants. */ -const INFINITY = 1 / 0; +const INFINITY = 1 / 0 /** * Recursively flattens `array`. @@ -13,12 +13,12 @@ const INFINITY = 1 / 0; * @see flatMap, flatMapDeep, flatMapDepth, flatten, flattenDepth * @example * - * flattenDeep([1, [2, [3, [4]], 5]]); + * flattenDeep([1, [2, [3, [4]], 5]]) * // => [1, 2, 3, 4, 5] */ function flattenDeep(array) { - const length = array == null ? 0 : array.length; - return length ? baseFlatten(array, INFINITY) : []; + const length = array == null ? 0 : array.length + return length ? baseFlatten(array, INFINITY) : [] } -export default flattenDeep; +export default flattenDeep diff --git a/flattenDepth.js b/flattenDepth.js index d0aed84c5e..4d71f19d47 100644 --- a/flattenDepth.js +++ b/flattenDepth.js @@ -1,5 +1,5 @@ -import baseFlatten from './.internal/baseFlatten.js'; -import toInteger from './toInteger.js'; +import baseFlatten from './.internal/baseFlatten.js' +import toInteger from './toInteger.js' /** * Recursively flatten `array` up to `depth` times. @@ -12,21 +12,21 @@ import toInteger from './toInteger.js'; * @see flatMap, flatMapDeep, flatMapDepth, flattenDeep * @example * - * const array = [1, [2, [3, [4]], 5]]; + * const array = [1, [2, [3, [4]], 5]] * - * flattenDepth(array, 1); + * flattenDepth(array, 1) * // => [1, 2, [3, [4]], 5] * - * flattenDepth(array, 2); + * flattenDepth(array, 2) * // => [1, 2, 3, [4], 5] */ function flattenDepth(array, depth) { - const length = array == null ? 0 : array.length; + const length = array == null ? 0 : array.length if (!length) { - return []; + return [] } - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(array, depth); + depth = depth === undefined ? 1 : toInteger(depth) + return baseFlatten(array, depth) } -export default flattenDepth; +export default flattenDepth diff --git a/flip.js b/flip.js index 107731410d..5662563b7d 100644 --- a/flip.js +++ b/flip.js @@ -1,7 +1,7 @@ -import createWrap from './.internal/createWrap.js'; +import createWrap from './.internal/createWrap.js' /** Used to compose bitmasks for function metadata. */ -const WRAP_FLIP_FLAG = 512; +const WRAP_FLIP_FLAG = 512 /** * Creates a function that invokes `func` with arguments reversed. @@ -13,13 +13,13 @@ const WRAP_FLIP_FLAG = 512; * @see reverse * @example * - * const flipped = flip((...args) => args); + * const flipped = flip((...args) => args) * - * flipped('a', 'b', 'c', 'd'); + * flipped('a', 'b', 'c', 'd') * // => ['d', 'c', 'b', 'a'] */ function flip(func) { - return createWrap(func, WRAP_FLIP_FLAG); + return createWrap(func, WRAP_FLIP_FLAG) } -export default flip; +export default flip diff --git a/floor.js b/floor.js index c3ac6ae081..b9124a6ce5 100644 --- a/floor.js +++ b/floor.js @@ -1,4 +1,4 @@ -import createRound from './.internal/createRound.js'; +import createRound from './.internal/createRound.js' /** * Computes `number` rounded down to `precision`. @@ -10,15 +10,15 @@ import createRound from './.internal/createRound.js'; * @returns {number} Returns the rounded down number. * @example * - * floor(4.006); + * floor(4.006) * // => 4 * - * floor(0.046, 2); + * floor(0.046, 2) * // => 0.04 * - * floor(4060, -2); + * floor(4060, -2) * // => 4000 */ -const floor = createRound('floor'); +const floor = createRound('floor') -export default floor; +export default floor diff --git a/flow.js b/flow.js index 8b3e05cab5..398b1ef0b1 100644 --- a/flow.js +++ b/flow.js @@ -11,29 +11,29 @@ * @example * * function square(n) { - * return n * n; + * return n * n * } * - * const addSquare = flow([add, square]); - * addSquare(1, 2); + * const addSquare = flow([add, square]) + * addSquare(1, 2) * // => 9 */ function flow(funcs) { - const length = funcs ? funcs.length : 0; - let index = length; + const length = funcs ? funcs.length : 0 + let index = length while (index--) { if (typeof funcs[index] != 'function') { - throw new TypeError('Expected a function'); + throw new TypeError('Expected a function') } } return function(...args) { - let index = 0; - let result = length ? funcs[index].apply(this, args) : args[0]; + let index = 0 + let result = length ? funcs[index].apply(this, args) : args[0] while (++index < length) { - result = funcs[index].call(this, result); + result = funcs[index].call(this, result) } - return result; - }; + return result + } } -export default flow; +export default flow diff --git a/flowRight.js b/flowRight.js index 8bf9becfa0..e6776bee89 100644 --- a/flowRight.js +++ b/flowRight.js @@ -1,4 +1,4 @@ -import flow from './flow.js'; +import flow from './flow.js' /** * This method is like `flow` except that it creates a function that @@ -12,15 +12,15 @@ import flow from './flow.js'; * @example * * function square(n) { - * return n * n; + * return n * n * } * - * const addSquare = flowRight([square, add]); - * addSquare(1, 2); + * const addSquare = flowRight([square, add]) + * addSquare(1, 2) * // => 9 */ function flowRight(funcs) { - return flow(funcs.reverse()); + return flow(funcs.reverse()) } -export default flowRight; +export default flowRight diff --git a/forEach.js b/forEach.js index 30565ddd9e..facccb07a7 100644 --- a/forEach.js +++ b/forEach.js @@ -1,5 +1,5 @@ -import arrayEach from './.internal/arrayEach.js'; -import baseEach from './.internal/baseEach.js';; +import arrayEach from './.internal/arrayEach.js' +import baseEach from './.internal/baseEach.js' /** * Iterates over elements of `collection` and invokes `iteratee` for each element. @@ -19,15 +19,15 @@ import baseEach from './.internal/baseEach.js';; * @see forEachRight, forIn, forInRight, forOwn, forOwnRight * @example * - * forEach([1, 2], value => console.log(value)); + * forEach([1, 2], value => console.log(value)) * // => Logs `1` then `2`. * - * forEach({ 'a': 1, 'b': 2 }, (value, key) => console.log(key)); + * forEach({ 'a': 1, 'b': 2 }, (value, key) => console.log(key)) * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { - const func = Array.isArray(collection) ? arrayEach : baseEach; - return func(collection, iteratee); + const func = Array.isArray(collection) ? arrayEach : baseEach + return func(collection, iteratee) } -export default forEach; +export default forEach diff --git a/forEachRight.js b/forEachRight.js index 474a5ba399..b8682b94b1 100644 --- a/forEachRight.js +++ b/forEachRight.js @@ -1,5 +1,5 @@ -import arrayEachRight from './.internal/arrayEachRight.js'; -import baseEachRight from './.internal/baseEachRight.js'; +import arrayEachRight from './.internal/arrayEachRight.js' +import baseEachRight from './.internal/baseEachRight.js' /** * This method is like `forEach` except that it iterates over elements of @@ -14,12 +14,12 @@ import baseEachRight from './.internal/baseEachRight.js'; * @see forEach, forIn, forInRight, forOwn, forOwnRight * @example * - * forEachRight([1, 2], value => console.log(value)); + * forEachRight([1, 2], value => console.log(value)) * // => Logs `2` then `1`. */ function forEachRight(collection, iteratee) { - const func = Array.isArray(collection) ? arrayEachRight : baseEachRight; - return func(collection, iteratee); + const func = Array.isArray(collection) ? arrayEachRight : baseEachRight + return func(collection, iteratee) } -export default forEachRight; +export default forEachRight diff --git a/forOwn.js b/forOwn.js index ade4a70afe..220ff6031d 100644 --- a/forOwn.js +++ b/forOwn.js @@ -1,4 +1,4 @@ -import baseForOwn from './.internal/baseForOwn.js'; +import baseForOwn from './.internal/baseForOwn.js' /** * Iterates over own enumerable string keyed properties of an object and @@ -15,19 +15,19 @@ import baseForOwn from './.internal/baseForOwn.js'; * @example * * function Foo() { - * this.a = 1; - * this.b = 2; + * this.a = 1 + * this.b = 2 * } * - * Foo.prototype.c = 3; + * Foo.prototype.c = 3 * * forOwn(new Foo, function(value, key) { - * console.log(key); - * }); + * console.log(key) + * }) * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forOwn(object, iteratee) { - return object && baseForOwn(object, iteratee); + return object && baseForOwn(object, iteratee) } -export default forOwn; +export default forOwn diff --git a/forOwnRight.js b/forOwnRight.js index 93490225dd..9c33c21bdb 100644 --- a/forOwnRight.js +++ b/forOwnRight.js @@ -1,4 +1,4 @@ -import baseForOwnRight from './.internal/baseForOwnRight.js'; +import baseForOwnRight from './.internal/baseForOwnRight.js' /** * This method is like `forOwn` except that it iterates over properties of @@ -13,19 +13,19 @@ import baseForOwnRight from './.internal/baseForOwnRight.js'; * @example * * function Foo() { - * this.a = 1; - * this.b = 2; + * this.a = 1 + * this.b = 2 * } * - * Foo.prototype.c = 3; + * Foo.prototype.c = 3 * * forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); + * console.log(key) + * }) * // => Logs 'b' then 'a' assuming `forOwn` logs 'a' then 'b'. */ function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, iteratee); + return object && baseForOwnRight(object, iteratee) } -export default forOwnRight; +export default forOwnRight diff --git a/fromPairs.js b/fromPairs.js index fd10fda2b2..630d15c2a7 100644 --- a/fromPairs.js +++ b/fromPairs.js @@ -1,5 +1,5 @@ /** - * The inverse of `toPairs`; this method returns an object composed + * The inverse of `toPairs`is method returns an object composed * from key-value `pairs`. * * @since 4.0.0 @@ -8,19 +8,19 @@ * @returns {Object} Returns the new object. * @example * - * fromPairs([['a', 1], ['b', 2]]); + * fromPairs([['a', 1], ['b', 2]]) * // => { 'a': 1, 'b': 2 } */ function fromPairs(pairs) { - let index = -1; - const length = pairs == null ? 0 : pairs.length; - const result = {}; + let index = -1 + const length = pairs == null ? 0 : pairs.length + const result = {} while (++index < length) { - const pair = pairs[index]; - result[pair[0]] = pair[1]; + const pair = pairs[index] + result[pair[0]] = pair[1] } - return result; + return result } -export default fromPairs; +export default fromPairs diff --git a/functions.js b/functions.js index 5477060bd3..9d79e3678c 100644 --- a/functions.js +++ b/functions.js @@ -1,5 +1,5 @@ -import baseFunctions from './.internal/baseFunctions.js'; -import keys from './keys.js'; +import baseFunctions from './.internal/baseFunctions.js' +import keys from './keys.js' /** * Creates an array of function property names from own enumerable properties @@ -13,17 +13,17 @@ import keys from './keys.js'; * @example * * function Foo() { - * this.a = constant('a'); - * this.b = constant('b'); + * this.a = constant('a') + * this.b = constant('b') * } * - * Foo.prototype.c = constant('c'); + * Foo.prototype.c = constant('c') * - * functions(new Foo); + * functions(new Foo) * // => ['a', 'b'] */ function functions(object) { - return object == null ? [] : baseFunctions(object, keys(object)); + return object == null ? [] : baseFunctions(object, keys(object)) } -export default functions; +export default functions diff --git a/get.js b/get.js index 2f250c463b..ca4354c410 100644 --- a/get.js +++ b/get.js @@ -1,4 +1,4 @@ -import baseGet from './.internal/baseGet.js'; +import baseGet from './.internal/baseGet.js' /** * Gets the value at `path` of `object`. If the resolved value is @@ -13,20 +13,20 @@ import baseGet from './.internal/baseGet.js'; * @see has, hasIn, set, unset * @example * - * const object = { 'a': [{ 'b': { 'c': 3 } }] }; + * const object = { 'a': [{ 'b': { 'c': 3 } }] } * - * get(object, 'a[0].b.c'); + * get(object, 'a[0].b.c') * // => 3 * - * get(object, ['a', '0', 'b', 'c']); + * get(object, ['a', '0', 'b', 'c']) * // => 3 * - * get(object, 'a.b.c', 'default'); + * get(object, 'a.b.c', 'default') * // => 'default' */ function get(object, path, defaultValue) { - const result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; + const result = object == null ? undefined : baseGet(object, path) + return result === undefined ? defaultValue : result } -export default get; +export default get diff --git a/groupBy.js b/groupBy.js index 376e6c1e3d..51c109df98 100644 --- a/groupBy.js +++ b/groupBy.js @@ -1,8 +1,8 @@ -import baseAssignValue from './.internal/baseAssignValue.js'; -import reduce from './reduce.js'; +import baseAssignValue from './.internal/baseAssignValue.js' +import reduce from './reduce.js' /** Used to check objects for own properties. */ -const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwnProperty = Object.prototype.hasOwnProperty /** * Creates an object composed of keys generated from the results of running @@ -18,18 +18,18 @@ const hasOwnProperty = Object.prototype.hasOwnProperty; * @returns {Object} Returns the composed aggregate object. * @example * - * groupBy([6.1, 4.2, 6.3], Math.floor); + * groupBy([6.1, 4.2, 6.3], Math.floor) * // => { '4': [4.2], '6': [6.1, 6.3] } */ function groupBy(collection, iteratee) { return reduce(collection, (result, value, key) => { if (hasOwnProperty.call(result, key)) { - result[key].push(value); + result[key].push(value) } else { - baseAssignValue(result, key, [value]); + baseAssignValue(result, key, [value]) } - return result; - }, {}); + return result + }, {}) } -export default groupBy; +export default groupBy diff --git a/gt.js b/gt.js index 3d57f624aa..3f241386d4 100644 --- a/gt.js +++ b/gt.js @@ -1,4 +1,4 @@ -import toNumber from './toNumber.js'; +import toNumber from './toNumber.js' /** * Checks if `value` is greater than `other`. @@ -12,21 +12,21 @@ import toNumber from './toNumber.js'; * @see gte, lt, lte * @example * - * gt(3, 1); + * gt(3, 1) * // => true * - * gt(3, 3); + * gt(3, 3) * // => false * - * gt(1, 3); + * gt(1, 3) * // => false */ function gt(value, other) { if (!(typeof value == 'string' && typeof other == 'string')) { - value = toNumber(value); - other = toNumber(other); + value = toNumber(value) + other = toNumber(other) } - return value > other; + return value > other } -export default gt; +export default gt diff --git a/gte.js b/gte.js index 11c1accc9e..872d6b12f2 100644 --- a/gte.js +++ b/gte.js @@ -1,4 +1,4 @@ -import toNumber from './toNumber.js'; +import toNumber from './toNumber.js' /** * Checks if `value` is greater than or equal to `other`. @@ -12,21 +12,21 @@ import toNumber from './toNumber.js'; * @see gt, lt, lte * @example * - * gte(3, 1); + * gte(3, 1) * // => true * - * gte(3, 3); + * gte(3, 3) * // => true * - * gte(1, 3); + * gte(1, 3) * // => false */ function gte(value, other) { if (!(typeof value == 'string' && typeof other == 'string')) { - value = toNumber(value); - other = toNumber(other); + value = toNumber(value) + other = toNumber(other) } - return value >= other; + return value >= other } -export default gte; +export default gte diff --git a/has.js b/has.js index c5713be481..abb208bfa2 100644 --- a/has.js +++ b/has.js @@ -1,5 +1,5 @@ -import baseHas from './.internal/baseHas.js'; -import hasPath from './.internal/hasPath.js'; +import baseHas from './.internal/baseHas.js' +import hasPath from './.internal/hasPath.js' /** * Checks if `path` is a direct property of `object`. @@ -12,23 +12,23 @@ import hasPath from './.internal/hasPath.js'; * @see hasIn, set, get * @example * - * const object = { 'a': { 'b': 2 } }; - * const other = create({ 'a': create({ 'b': 2 }) }); + * const object = { 'a': { 'b': 2 } } + * const other = create({ 'a': create({ 'b': 2 }) }) * - * has(object, 'a'); + * has(object, 'a') * // => true * - * has(object, 'a.b'); + * has(object, 'a.b') * // => true * - * has(object, ['a', 'b']); + * has(object, ['a', 'b']) * // => true * - * has(other, 'a'); + * has(other, 'a') * // => false */ function has(object, path) { - return object != null && hasPath(object, path, baseHas); + return object != null && hasPath(object, path, baseHas) } -export default has; +export default has diff --git a/hasIn.js b/hasIn.js index ee22558a34..32499ebb77 100644 --- a/hasIn.js +++ b/hasIn.js @@ -1,5 +1,5 @@ -import baseHasIn from './.internal/baseHasIn.js'; -import hasPath from './.internal/hasPath.js'; +import baseHasIn from './.internal/baseHasIn.js' +import hasPath from './.internal/hasPath.js' /** * Checks if `path` is a direct or inherited property of `object`. @@ -12,22 +12,22 @@ import hasPath from './.internal/hasPath.js'; * @see has, get, set, unset * @example * - * const object = create({ 'a': create({ 'b': 2 }) }); + * const object = create({ 'a': create({ 'b': 2 }) }) * - * hasIn(object, 'a'); + * hasIn(object, 'a') * // => true * - * hasIn(object, 'a.b'); + * hasIn(object, 'a.b') * // => true * - * hasIn(object, ['a', 'b']); + * hasIn(object, ['a', 'b']) * // => true * - * hasIn(object, 'b'); + * hasIn(object, 'b') * // => false */ function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); + return object != null && hasPath(object, path, baseHasIn) } -export default hasIn; +export default hasIn diff --git a/head.js b/head.js index fb2dbf1c1c..60e45506c6 100644 --- a/head.js +++ b/head.js @@ -9,14 +9,14 @@ * @see last * @example * - * head([1, 2, 3]); + * head([1, 2, 3]) * // => 1 * - * head([]); + * head([]) * // => undefined */ function head(array) { - return (array && array.length) ? array[0] : undefined; + return (array && array.length) ? array[0] : undefined } -export default head; +export default head diff --git a/inRange.js b/inRange.js index 297d65ab0c..88457c7143 100644 --- a/inRange.js +++ b/inRange.js @@ -1,6 +1,6 @@ -import baseInRange from './.internal/baseInRange.js'; -import toFinite from './toFinite.js'; -import toNumber from './toNumber.js'; +import baseInRange from './.internal/baseInRange.js' +import toFinite from './toFinite.js' +import toNumber from './toNumber.js' /** * Checks if `n` is between `start` and up to, but not including, `end`. If @@ -17,37 +17,37 @@ import toNumber from './toNumber.js'; * @see range, rangeRight * @example * - * inRange(3, 2, 4); + * inRange(3, 2, 4) * // => true * - * inRange(4, 8); + * inRange(4, 8) * // => true * - * inRange(4, 2); + * inRange(4, 2) * // => false * - * inRange(2, 2); + * inRange(2, 2) * // => false * - * inRange(1.2, 2); + * inRange(1.2, 2) * // => true * - * inRange(5.2, 4); + * inRange(5.2, 4) * // => false * - * inRange(-3, -2, -6); + * inRange(-3, -2, -6) * // => true */ function inRange(number, start, end) { - start = toFinite(start); + start = toFinite(start) if (end === undefined) { - end = start; - start = 0; + end = start + start = 0 } else { - end = toFinite(end); + end = toFinite(end) } - number = toNumber(number); - return baseInRange(number, start, end); + number = toNumber(number) + return baseInRange(number, start, end) } -export default inRange; +export default inRange diff --git a/indexOf.js b/indexOf.js index 71880d0af0..25c668cb1c 100644 --- a/indexOf.js +++ b/indexOf.js @@ -1,8 +1,8 @@ -import baseIndexOf from './.internal/baseIndexOf.js'; -import toInteger from './toInteger.js'; +import baseIndexOf from './.internal/baseIndexOf.js' +import toInteger from './toInteger.js' /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeMax = Math.max; +const nativeMax = Math.max /** * Gets the index at which the first occurrence of `value` is found in `array` @@ -18,23 +18,23 @@ const nativeMax = Math.max; * @returns {number} Returns the index of the matched value, else `-1`. * @example * - * indexOf([1, 2, 1, 2], 2); + * indexOf([1, 2, 1, 2], 2) * // => 1 * * // Search from the `fromIndex`. - * indexOf([1, 2, 1, 2], 2, 2); + * indexOf([1, 2, 1, 2], 2, 2) * // => 3 */ function indexOf(array, value, fromIndex) { - const length = array == null ? 0 : array.length; + const length = array == null ? 0 : array.length if (!length) { - return -1; + return -1 } - let index = fromIndex == null ? 0 : toInteger(fromIndex); + let index = fromIndex == null ? 0 : toInteger(fromIndex) if (index < 0) { - index = nativeMax(length + index, 0); + index = nativeMax(length + index, 0) } - return baseIndexOf(array, value, index); + return baseIndexOf(array, value, index) } -export default indexOf; +export default indexOf diff --git a/initial.js b/initial.js index 4312028b96..96c3ce6ce0 100644 --- a/initial.js +++ b/initial.js @@ -1,4 +1,4 @@ -import baseSlice from './.internal/baseSlice.js'; +import baseSlice from './.internal/baseSlice.js' /** * Gets all but the last element of `array`. @@ -9,12 +9,12 @@ import baseSlice from './.internal/baseSlice.js'; * @returns {Array} Returns the slice of `array`. * @example * - * initial([1, 2, 3]); + * initial([1, 2, 3]) * // => [1, 2] */ function initial(array) { - const length = array == null ? 0 : array.length; - return length ? baseSlice(array, 0, -1) : []; + const length = array == null ? 0 : array.length + return length ? baseSlice(array, 0, -1) : [] } -export default initial; +export default initial diff --git a/intersection.js b/intersection.js index ddf5cbf5b7..30b85b04be 100644 --- a/intersection.js +++ b/intersection.js @@ -1,6 +1,6 @@ -import arrayMap from './.internal/arrayMap.js'; -import baseIntersection from './.internal/baseIntersection.js'; -import castArrayLikeObject from './.internal/castArrayLikeObject.js'; +import arrayMap from './.internal/arrayMap.js' +import baseIntersection from './.internal/baseIntersection.js' +import castArrayLikeObject from './.internal/castArrayLikeObject.js' /** * Creates an array of unique values that are included in all given arrays @@ -14,14 +14,14 @@ import castArrayLikeObject from './.internal/castArrayLikeObject.js'; * @returns {Array} Returns the new array of intersecting values. * @example * - * intersection([2, 1], [2, 3]); + * intersection([2, 1], [2, 3]) * // => [2] */ function intersection(...arrays) { - const mapped = arrayMap(arrays, castArrayLikeObject); + const mapped = arrayMap(arrays, castArrayLikeObject) return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped) - : []; + : [] } -export default intersection; +export default intersection diff --git a/intersectionBy.js b/intersectionBy.js index e93c16dd80..37901adee1 100644 --- a/intersectionBy.js +++ b/intersectionBy.js @@ -1,7 +1,7 @@ -import arrayMap from './.internal/arrayMap.js'; -import baseIntersection from './.internal/baseIntersection.js'; -import castArrayLikeObject from './.internal/castArrayLikeObject.js'; -import last from './last.js'; +import arrayMap from './.internal/arrayMap.js' +import baseIntersection from './.internal/baseIntersection.js' +import castArrayLikeObject from './.internal/castArrayLikeObject.js' +import last from './last.js' /** * This method is like `intersection` except that it accepts `iteratee` @@ -17,21 +17,21 @@ import last from './last.js'; * @returns {Array} Returns the new array of intersecting values. * @example * - * intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor) * // => [2.1] */ function intersectionBy(...arrays) { - let iteratee = last(arrays); - const mapped = arrayMap(arrays, castArrayLikeObject); + let iteratee = last(arrays) + const mapped = arrayMap(arrays, castArrayLikeObject) if (iteratee === last(mapped)) { - iteratee = undefined; + iteratee = undefined } else { - mapped.pop(); + mapped.pop() } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, iteratee) - : []; + : [] } -export default intersectionBy; +export default intersectionBy diff --git a/intersectionWith.js b/intersectionWith.js index 24602cee7e..5490bbba89 100644 --- a/intersectionWith.js +++ b/intersectionWith.js @@ -1,7 +1,7 @@ -import arrayMap from './.internal/arrayMap.js'; -import baseIntersection from './.internal/baseIntersection.js'; -import castArrayLikeObject from './.internal/castArrayLikeObject.js'; -import last from './last.js'; +import arrayMap from './.internal/arrayMap.js' +import baseIntersection from './.internal/baseIntersection.js' +import castArrayLikeObject from './.internal/castArrayLikeObject.js' +import last from './last.js' /** * This method is like `intersection` except that it accepts `comparator` @@ -16,23 +16,23 @@ import last from './last.js'; * @returns {Array} Returns the new array of intersecting values. * @example * - * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * const others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + * const others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }] * - * intersectionWith(objects, others, isEqual); + * intersectionWith(objects, others, isEqual) * // => [{ 'x': 1, 'y': 2 }] */ function intersectionWith(...arrays) { - let comparator = last(arrays); - const mapped = arrayMap(arrays, castArrayLikeObject); + let comparator = last(arrays) + const mapped = arrayMap(arrays, castArrayLikeObject) - comparator = typeof comparator == 'function' ? comparator : undefined; + comparator = typeof comparator == 'function' ? comparator : undefined if (comparator) { - mapped.pop(); + mapped.pop() } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, undefined, comparator) - : []; + : [] } -export default intersectionWith; +export default intersectionWith diff --git a/invert.js b/invert.js index ce40e967d3..f978f253bd 100644 --- a/invert.js +++ b/invert.js @@ -1,4 +1,4 @@ -import baseForOwn from './baseForOwn.js'; +import baseForOwn from './baseForOwn.js' /** * Creates an object composed of the inverted keys and values of `object`. @@ -11,17 +11,17 @@ import baseForOwn from './baseForOwn.js'; * @returns {Object} Returns the new inverted object. * @example * - * const object = { 'a': 1, 'b': 2, 'c': 1 }; + * const object = { 'a': 1, 'b': 2, 'c': 1 } * - * invert(object); + * invert(object) * // => { '1': 'c', '2': 'b' } */ function invert(object) { - const result = {}; + const result = {} baseForOwn(object, (value, key) => { - result[value] = key; - }); - return result; + result[value] = key + }) + return result } -export default invert; +export default invert diff --git a/invertBy.js b/invertBy.js index 3f9e8702b8..6a948ce48d 100644 --- a/invertBy.js +++ b/invertBy.js @@ -1,7 +1,7 @@ -import baseForOwn from './baseForOwn.js'; +import baseForOwn from './baseForOwn.js' /** Used to check objects for own properties. */ -const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwnProperty = Object.prototype.hasOwnProperty /** * This method is like `invert` except that the inverted object is generated @@ -17,22 +17,22 @@ const hasOwnProperty = Object.prototype.hasOwnProperty; * @returns {Object} Returns the new inverted object. * @example * - * const object = { 'a': 1, 'b': 2, 'c': 1 }; + * const object = { 'a': 1, 'b': 2, 'c': 1 } * - * invertBy(object, value => `group${ value }`); + * invertBy(object, value => `group${ value }`) * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ function invertBy(object, iteratee) { - const result = {}; + const result = {} baseForOwn(object, (value, key) => { - value = iteratee(value); + value = iteratee(value) if (hasOwnProperty.call(result, value)) { - result[value].push(key); + result[value].push(key) } else { - result[value] = [key]; + result[value] = [key] } - }); - return result; + }) + return result } -export default invertBy; +export default invertBy diff --git a/invoke.js b/invoke.js index f67f765013..4efed1a582 100644 --- a/invoke.js +++ b/invoke.js @@ -1,8 +1,8 @@ -import apply from './apply.js'; -import castPath from './castPath.js'; -import last from '../last.js'; -import parent from './parent.js'; -import toKey from './toKey.js'; +import apply from './apply.js' +import castPath from './castPath.js' +import last from '../last.js' +import parent from './parent.js' +import toKey from './toKey.js' /** * Invokes the method at `path` of `object`. @@ -15,16 +15,16 @@ import toKey from './toKey.js'; * @returns {*} Returns the result of the invoked method. * @example * - * const object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * const object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] } * - * invoke(object, 'a[0].b.c.slice', [1, 3]); + * invoke(object, 'a[0].b.c.slice', [1, 3]) * // => [2, 3] */ function invoke(object, path, args) { - path = castPath(path, object); - object = parent(object, path); - const func = object == null ? object : object[toKey(last(path))]; - return func == null ? undefined : apply(func, object, args); + path = castPath(path, object) + object = parent(object, path) + const func = object == null ? object : object[toKey(last(path))] + return func == null ? undefined : apply(func, object, args) } -export default invoke; +export default invoke diff --git a/invokeMap.js b/invokeMap.js index fc3454d0f0..b485c2d8f1 100644 --- a/invokeMap.js +++ b/invokeMap.js @@ -1,7 +1,7 @@ -import apply from './.internal/apply.js'; -import baseEach from './.internal/baseEach.js'; -import invoke from './invoke.js'; -import isArrayLike from './isArrayLike.js'; +import apply from './.internal/apply.js' +import baseEach from './.internal/baseEach.js' +import invoke from './invoke.js' +import isArrayLike from './isArrayLike.js' /** * Invokes the method at `path` of each element in `collection`, returning @@ -18,21 +18,21 @@ import isArrayLike from './isArrayLike.js'; * @returns {Array} Returns the array of results. * @example * - * invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * invokeMap([[5, 1, 7], [3, 2, 1]], 'sort') * // => [[1, 5, 7], [1, 2, 3]] * - * invokeMap([123, 456], String.prototype.split, ['']); + * invokeMap([123, 456], String.prototype.split, ['']) * // => [['1', '2', '3'], ['4', '5', '6']] */ function invokeMap(collection, path, args) { - let index = -1; - const isFunc = typeof path == 'function'; - const result = isArrayLike(collection) ? Array(collection.length) : []; + let index = -1 + const isFunc = typeof path == 'function' + const result = isArrayLike(collection) ? Array(collection.length) : [] baseEach(collection, value => { - result[++index] = isFunc ? apply(path, value, args) : invoke(value, path, args); - }); - return result; + result[++index] = isFunc ? apply(path, value, args) : invoke(value, path, args) + }) + return result } -export default invokeMap; +export default invokeMap diff --git a/isArguments.js b/isArguments.js index 8a9423ce9b..c69cceb693 100644 --- a/isArguments.js +++ b/isArguments.js @@ -1,5 +1,5 @@ -import baseGetTag from './.internal/baseGetTag.js'; -import isObjectLike from './isObjectLike.js'; +import baseGetTag from './.internal/baseGetTag.js' +import isObjectLike from './isObjectLike.js' /** * Checks if `value` is likely an `arguments` object. @@ -11,14 +11,14 @@ import isObjectLike from './isObjectLike.js'; * else `false`. * @example * - * isArguments(function() { return arguments; }()); + * isArguments(function() { return arguments }()) * // => true * - * isArguments([1, 2, 3]); + * isArguments([1, 2, 3]) * // => false */ function isArguments(value) { - return isObjectLike(value) && baseGetTag(value) == '[object Arguments]'; + return isObjectLike(value) && baseGetTag(value) == '[object Arguments]' } -export default isArguments; +export default isArguments diff --git a/isArrayBuffer.js b/isArrayBuffer.js index dabb7144b5..83f5c0786c 100644 --- a/isArrayBuffer.js +++ b/isArrayBuffer.js @@ -1,9 +1,9 @@ -import baseGetTag from './.internal/baseGetTag.js'; -import isObjectLike from './isObjectLike.js'; -import nodeUtil from './.internal/nodeUtil.js'; +import baseGetTag from './.internal/baseGetTag.js' +import isObjectLike from './isObjectLike.js' +import nodeUtil from './.internal/nodeUtil.js' /* Node.js helper references. */ -const nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer; +const nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer /** * Checks if `value` is classified as an `ArrayBuffer` object. @@ -14,14 +14,14 @@ const nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer; * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. * @example * - * isArrayBuffer(new ArrayBuffer(2)); + * isArrayBuffer(new ArrayBuffer(2)) * // => true * - * isArrayBuffer(new Array(2)); + * isArrayBuffer(new Array(2)) * // => false */ const isArrayBuffer = nodeIsArrayBuffer ? value => nodeIsArrayBuffer(value) - : value => isObjectLike(value) && baseGetTag(value) == '[object ArrayBuffer]'; + : value => isObjectLike(value) && baseGetTag(value) == '[object ArrayBuffer]' -export default isArrayBuffer; +export default isArrayBuffer diff --git a/isArrayLike.js b/isArrayLike.js index 4a70d1fa17..ff8e1823cc 100644 --- a/isArrayLike.js +++ b/isArrayLike.js @@ -1,5 +1,5 @@ -import isFunction from './isFunction.js'; -import isLength from './isLength.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 @@ -12,20 +12,20 @@ import isLength from './isLength.js'; * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * - * isArrayLike([1, 2, 3]); + * isArrayLike([1, 2, 3]) * // => true * - * isArrayLike(document.body.children); + * isArrayLike(document.body.children) * // => true * - * isArrayLike('abc'); + * isArrayLike('abc') * // => true * - * isArrayLike(Function); + * isArrayLike(Function) * // => false */ function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); + return value != null && isLength(value.length) && !isFunction(value) } -export default isArrayLike; +export default isArrayLike diff --git a/isArrayLikeObject.js b/isArrayLikeObject.js index de5aecf790..50ac56bd2b 100644 --- a/isArrayLikeObject.js +++ b/isArrayLikeObject.js @@ -1,5 +1,5 @@ -import isArrayLike from './isArrayLike.js'; -import isObjectLike from './isObjectLike.js'; +import isArrayLike from './isArrayLike.js' +import isObjectLike from './isObjectLike.js' /** * This method is like `isArrayLike` except that it also checks if `value` @@ -12,20 +12,20 @@ import isObjectLike from './isObjectLike.js'; * else `false`. * @example * - * isArrayLikeObject([1, 2, 3]); + * isArrayLikeObject([1, 2, 3]) * // => true * - * isArrayLikeObject(document.body.children); + * isArrayLikeObject(document.body.children) * // => true * - * isArrayLikeObject('abc'); + * isArrayLikeObject('abc') * // => false * - * isArrayLikeObject(Function); + * isArrayLikeObject(Function) * // => false */ function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); + return isObjectLike(value) && isArrayLike(value) } -export default isArrayLikeObject; +export default isArrayLikeObject diff --git a/isBoolean.js b/isBoolean.js index 4df8691ce8..0ac7edef07 100644 --- a/isBoolean.js +++ b/isBoolean.js @@ -1,5 +1,5 @@ -import baseGetTag from './.internal/baseGetTag.js'; -import isObjectLike from './isObjectLike.js'; +import baseGetTag from './.internal/baseGetTag.js' +import isObjectLike from './isObjectLike.js' /** * Checks if `value` is classified as a boolean primitive or object. @@ -10,15 +10,15 @@ import isObjectLike from './isObjectLike.js'; * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. * @example * - * isBoolean(false); + * isBoolean(false) * // => true * - * isBoolean(null); + * isBoolean(null) * // => false */ function isBoolean(value) { return value === true || value === false || - (isObjectLike(value) && baseGetTag(value) == '[object Boolean]'); + (isObjectLike(value) && baseGetTag(value) == '[object Boolean]') } -export default isBoolean; +export default isBoolean diff --git a/isBuffer.js b/isBuffer.js index af23e37e15..0cdf7cb574 100644 --- a/isBuffer.js +++ b/isBuffer.js @@ -1,20 +1,20 @@ -import root from './.internal/root.js'; -import stubFalse from './stubFalse.js'; +import root from './.internal/root.js' +import stubFalse from './stubFalse.js' /** Detect free variable `exports`. */ -const freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; +const freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports /** Detect free variable `module`. */ -const freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; +const freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module /** Detect the popular CommonJS extension `module.exports`. */ -const moduleExports = freeModule && freeModule.exports === freeExports; +const moduleExports = freeModule && freeModule.exports === freeExports /** Built-in value references. */ -const Buffer = moduleExports ? root.Buffer : undefined; +const Buffer = moduleExports ? root.Buffer : undefined /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; +const nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined /** * Checks if `value` is a buffer. @@ -25,12 +25,12 @@ const nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * - * isBuffer(new Buffer(2)); + * isBuffer(new Buffer(2)) * // => true * - * isBuffer(new Uint8Array(2)); + * isBuffer(new Uint8Array(2)) * // => false */ -const isBuffer = nativeIsBuffer || stubFalse; +const isBuffer = nativeIsBuffer || stubFalse -export default isBuffer; +export default isBuffer diff --git a/isDate.js b/isDate.js index c9fa85124e..2a202ba02a 100644 --- a/isDate.js +++ b/isDate.js @@ -1,9 +1,9 @@ -import baseGetTag from './.internal/baseGetTag.js'; -import isObjectLike from './isObjectLike.js'; -import nodeUtil from './.internal/nodeUtil.js'; +import baseGetTag from './.internal/baseGetTag.js' +import isObjectLike from './isObjectLike.js' +import nodeUtil from './.internal/nodeUtil.js' /* Node.js helper references. */ -const nodeIsDate = nodeUtil && nodeUtil.isDate; +const nodeIsDate = nodeUtil && nodeUtil.isDate /** * Checks if `value` is classified as a `Date` object. @@ -14,14 +14,14 @@ const nodeIsDate = nodeUtil && nodeUtil.isDate; * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * - * isDate(new Date); + * isDate(new Date) * // => true * - * isDate('Mon April 23 2012'); + * isDate('Mon April 23 2012') * // => false */ const isDate = nodeIsDate ? value => nodeIsDate(value) - : value => isObjectLike(value) && baseGetTag(value) == '[object Date]'; + : value => isObjectLike(value) && baseGetTag(value) == '[object Date]' -export default isDate; +export default isDate diff --git a/isElement.js b/isElement.js index 2ede0d1a30..636d792eda 100644 --- a/isElement.js +++ b/isElement.js @@ -1,5 +1,5 @@ -import isObjectLike from './isObjectLike.js'; -import isPlainObject from './isPlainObject.js'; +import isObjectLike from './isObjectLike.js' +import isPlainObject from './isPlainObject.js' /** * Checks if `value` is likely a DOM element. @@ -10,14 +10,14 @@ import isPlainObject from './isPlainObject.js'; * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. * @example * - * isElement(document.body); + * isElement(document.body) * // => true * - * isElement(''); + * isElement('') * // => false */ function isElement(value) { - return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value) } -export default isElement; +export default isElement diff --git a/isEmpty.js b/isEmpty.js index bfa12e5746..6b5d824992 100644 --- a/isEmpty.js +++ b/isEmpty.js @@ -1,13 +1,13 @@ -import baseKeys from './.internal/baseKeys.js'; -import getTag from './.internal/getTag.js'; -import isArguments from './isArguments.js'; -import isArrayLike from './isArrayLike.js'; -import isBuffer from './isBuffer.js'; -import isPrototype from './.internal/isPrototype.js'; -import isTypedArray from './isTypedArray.js'; +import baseKeys from './.internal/baseKeys.js' +import getTag from './.internal/getTag.js' +import isArguments from './isArguments.js' +import isArrayLike from './isArrayLike.js' +import isBuffer from './isBuffer.js' +import isPrototype from './.internal/isPrototype.js' +import isTypedArray from './isTypedArray.js' /** Used to check objects for own properties. */ -const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwnProperty = Object.prototype.hasOwnProperty /** * Checks if `value` is an empty object, collection, map, or set. @@ -25,43 +25,43 @@ const hasOwnProperty = Object.prototype.hasOwnProperty; * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * - * isEmpty(null); + * isEmpty(null) * // => true * - * isEmpty(true); + * isEmpty(true) * // => true * - * isEmpty(1); + * isEmpty(1) * // => true * - * isEmpty([1, 2, 3]); + * isEmpty([1, 2, 3]) * // => false * - * isEmpty({ 'a': 1 }); + * isEmpty({ 'a': 1 }) * // => false */ function isEmpty(value) { if (value == null) { - return true; + return true } if (isArrayLike(value) && (Array.isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) { - return !value.length; + return !value.length } - const tag = getTag(value); + const tag = getTag(value) if (tag == '[object Map]' || tag == '[object Set]') { - return !value.size; + return !value.size } if (isPrototype(value)) { - return !baseKeys(value).length; + return !baseKeys(value).length } for (const key in value) { if (hasOwnProperty.call(value, key)) { - return false; + return false } } - return true; + return true } -export default isEmpty; +export default isEmpty diff --git a/isEqualWith.js b/isEqualWith.js index 0e0703a4ed..4db2a33d97 100644 --- a/isEqualWith.js +++ b/isEqualWith.js @@ -1,4 +1,4 @@ -import baseIsEqual from './.internal/baseIsEqual.js'; +import baseIsEqual from './.internal/baseIsEqual.js' /** * This method is like `isEqual` except that it accepts `customizer` which @@ -15,25 +15,25 @@ import baseIsEqual from './.internal/baseIsEqual.js'; * @example * * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); + * return /^h(?:i|ello)$/.test(value) * } * * function customizer(objValue, othValue) { * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; + * return true * } * } * - * const array = ['hello', 'goodbye']; - * const other = ['hi', 'goodbye']; + * const array = ['hello', 'goodbye'] + * const other = ['hi', 'goodbye'] * - * isEqualWith(array, other, customizer); + * isEqualWith(array, other, customizer) * // => true */ function isEqualWith(value, other, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - const result = customizer ? customizer(value, other) : undefined; - return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + customizer = typeof customizer == 'function' ? customizer : undefined + const result = customizer ? customizer(value, other) : undefined + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result } -export default isEqualWith; +export default isEqualWith diff --git a/isError.js b/isError.js index 3cf650bfca..6ac9bb4ef2 100644 --- a/isError.js +++ b/isError.js @@ -1,6 +1,6 @@ -import baseGetTag from './.internal/baseGetTag.js'; -import isObjectLike from './isObjectLike.js'; -import isPlainObject from './isPlainObject.js'; +import baseGetTag from './.internal/baseGetTag.js' +import isObjectLike from './isObjectLike.js' +import isPlainObject from './isPlainObject.js' /** * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, @@ -12,19 +12,19 @@ import isPlainObject from './isPlainObject.js'; * @returns {boolean} Returns `true` if `value` is an error object, else `false`. * @example * - * isError(new Error); + * isError(new Error) * // => true * - * isError(Error); + * isError(Error) * // => false */ function isError(value) { if (!isObjectLike(value)) { - return false; + return false } - const tag = baseGetTag(value); + const tag = baseGetTag(value) return tag == '[object Error]' || tag == '[object DOMException]' || - (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)) } -export default isError; +export default isError diff --git a/isFunction.js b/isFunction.js index feaf661a25..7f593cbcff 100644 --- a/isFunction.js +++ b/isFunction.js @@ -1,5 +1,5 @@ -import baseGetTag from './.internal/baseGetTag.js'; -import isObject from './isObject.js'; +import baseGetTag from './.internal/baseGetTag.js' +import isObject from './isObject.js' /** * Checks if `value` is classified as a `Function` object. @@ -10,21 +10,21 @@ import isObject from './isObject.js'; * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * - * isFunction(_); + * isFunction(_) * // => true * - * isFunction(/abc/); + * isFunction(/abc/) * // => false */ function isFunction(value) { if (!isObject(value)) { - return false; + return false } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. - const tag = baseGetTag(value); + const tag = baseGetTag(value) return tag == '[object Function]' || tag == '[object AsyncFunction]' || - tag == '[object GeneratorFunction]' || tag == '[object Proxy]'; + tag == '[object GeneratorFunction]' || tag == '[object Proxy]' } -export default isFunction; +export default isFunction diff --git a/isLength.js b/isLength.js index 677c45c47a..cd34a53eda 100644 --- a/isLength.js +++ b/isLength.js @@ -1,5 +1,5 @@ /** Used as references for various `Number` constants. */ -const MAX_SAFE_INTEGER = 9007199254740991; +const MAX_SAFE_INTEGER = 9007199254740991 /** * Checks if `value` is a valid array-like length. @@ -13,21 +13,21 @@ const MAX_SAFE_INTEGER = 9007199254740991; * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * - * isLength(3); + * isLength(3) * // => true * - * isLength(Number.MIN_VALUE); + * isLength(Number.MIN_VALUE) * // => false * - * isLength(Infinity); + * isLength(Infinity) * // => false * - * isLength('3'); + * isLength('3') * // => false */ function isLength(value) { return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER } -export default isLength; +export default isLength diff --git a/isMap.js b/isMap.js index 10ef917d8a..b1f9650e14 100644 --- a/isMap.js +++ b/isMap.js @@ -1,9 +1,9 @@ -import getTag from './.internal/getTag.js'; -import isObjectLike from './isObjectLike.js'; -import nodeUtil from './.internal/nodeUtil.js'; +import getTag from './.internal/getTag.js' +import isObjectLike from './isObjectLike.js' +import nodeUtil from './.internal/nodeUtil.js' /* Node.js helper references. */ -const nodeIsMap = nodeUtil && nodeUtil.isMap; +const nodeIsMap = nodeUtil && nodeUtil.isMap /** * Checks if `value` is classified as a `Map` object. @@ -14,14 +14,14 @@ const nodeIsMap = nodeUtil && nodeUtil.isMap; * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * - * isMap(new Map); + * isMap(new Map) * // => true * - * isMap(new WeakMap); + * isMap(new WeakMap) * // => false */ const isMap = nodeIsMap ? value => nodeIsMap(value) - : value => isObjectLike(value) && getTag(value) == '[object Map]'; + : value => isObjectLike(value) && getTag(value) == '[object Map]' -export default isMap; +export default isMap diff --git a/isMatch.js b/isMatch.js index ebee45374f..a9c46ad218 100644 --- a/isMatch.js +++ b/isMatch.js @@ -1,5 +1,5 @@ -import baseIsMatch from './.internal/baseIsMatch.js'; -import getMatchData from './.internal/getMatchData.js'; +import baseIsMatch from './.internal/baseIsMatch.js' +import getMatchData from './.internal/getMatchData.js' /** * Performs a partial deep comparison between `object` and `source` to @@ -19,16 +19,16 @@ import getMatchData from './.internal/getMatchData.js'; * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * - * const object = { 'a': 1, 'b': 2 }; + * const object = { 'a': 1, 'b': 2 } * - * isMatch(object, { 'b': 2 }); + * isMatch(object, { 'b': 2 }) * // => true * - * isMatch(object, { 'b': 1 }); + * isMatch(object, { 'b': 1 }) * // => false */ function isMatch(object, source) { - return object === source || baseIsMatch(object, source, getMatchData(source)); + return object === source || baseIsMatch(object, source, getMatchData(source)) } -export default isMatch; +export default isMatch diff --git a/isMatchWith.js b/isMatchWith.js index d48fa74fb7..7c62e184c1 100644 --- a/isMatchWith.js +++ b/isMatchWith.js @@ -1,5 +1,5 @@ -import baseIsMatch from './.internal/baseIsMatch.js'; -import getMatchData from './.internal/getMatchData.js'; +import baseIsMatch from './.internal/baseIsMatch.js' +import getMatchData from './.internal/getMatchData.js' /** * This method is like `isMatch` except that it accepts `customizer` which @@ -16,24 +16,24 @@ import getMatchData from './.internal/getMatchData.js'; * @example * * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); + * return /^h(?:i|ello)$/.test(value) * } * * function customizer(objValue, srcValue) { * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; + * return true * } * } * - * const object = { 'greeting': 'hello' }; - * const source = { 'greeting': 'hi' }; + * const object = { 'greeting': 'hello' } + * const source = { 'greeting': 'hi' } * - * isMatchWith(object, source, customizer); + * isMatchWith(object, source, customizer) * // => true */ function isMatchWith(object, source, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseIsMatch(object, source, getMatchData(source), customizer); + customizer = typeof customizer == 'function' ? customizer : undefined + return baseIsMatch(object, source, getMatchData(source), customizer) } -export default isMatchWith; +export default isMatchWith diff --git a/isNative.js b/isNative.js index d2862c67e0..42ba66e4be 100644 --- a/isNative.js +++ b/isNative.js @@ -1,22 +1,22 @@ -import isFunction from './isFunction.js'; -import isObject from './isObject.js'; -import toSource from './.internal/toSource.js'; +import isFunction from './isFunction.js' +import isObject from './isObject.js' +import toSource from './.internal/toSource.js' /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ -const reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +const reRegExpChar = /[\\^$.*+?()[\]{}|]/g /** Used to detect host constructors (Safari). */ -const reIsHostCtor = /^\[object .+?Constructor\]$/; +const reIsHostCtor = /^\[object .+?Constructor\]$/ /** Used to detect if a method is native. */ const reIsNative = RegExp(`^${ Function.prototype.toString.call(Object.prototype.hasOwnProperty) .replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') -}$`); +}$`) /** * Checks if `value` is a pristine native function. @@ -28,18 +28,18 @@ const reIsNative = RegExp(`^${ * else `false`. * @example * - * isNative(Array.prototype.push); + * isNative(Array.prototype.push) * // => true * - * isNative(isDate); + * isNative(isDate) * // => false */ function isNative(value) { if (!isObject(value)) { - return false; + return false } - const pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); + const pattern = isFunction(value) ? reIsNative : reIsHostCtor + return pattern.test(toSource(value)) } -export default isNative; +export default isNative diff --git a/isNil.js b/isNil.js index 638e4b1855..4a70c9a563 100644 --- a/isNil.js +++ b/isNil.js @@ -7,17 +7,17 @@ * @returns {boolean} Returns `true` if `value` is nullish, else `false`. * @example * - * isNil(null); + * isNil(null) * // => true * - * isNil(void 0); + * isNil(void 0) * // => true * - * isNil(NaN); + * isNil(NaN) * // => false */ function isNil(value) { - return value == null; + return value == null } -export default isNil; +export default isNil diff --git a/isNull.js b/isNull.js index 6140656fd4..1627b3ce71 100644 --- a/isNull.js +++ b/isNull.js @@ -7,14 +7,14 @@ * @returns {boolean} Returns `true` if `value` is `null`, else `false`. * @example * - * isNull(null); + * isNull(null) * // => true * - * isNull(void 0); + * isNull(void 0) * // => false */ function isNull(value) { - return value === null; + return value === null } -export default isNull; +export default isNull diff --git a/isNumber.js b/isNumber.js index 3c1ab469a7..d70572b95e 100644 --- a/isNumber.js +++ b/isNumber.js @@ -1,5 +1,5 @@ -import baseGetTag from './.internal/baseGetTag.js'; -import isObjectLike from './isObjectLike.js'; +import baseGetTag from './.internal/baseGetTag.js' +import isObjectLike from './isObjectLike.js' /** * Checks if `value` is classified as a `Number` primitive or object. @@ -14,21 +14,21 @@ import isObjectLike from './isObjectLike.js'; * @see isInteger, toInteger, toNumber * @example * - * isNumber(3); + * isNumber(3) * // => true * - * isNumber(Number.MIN_VALUE); + * isNumber(Number.MIN_VALUE) * // => true * - * isNumber(Infinity); + * isNumber(Infinity) * // => true * - * isNumber('3'); + * isNumber('3') * // => false */ function isNumber(value) { return typeof value == 'number' || - (isObjectLike(value) && baseGetTag(value) == '[object Number]'); + (isObjectLike(value) && baseGetTag(value) == '[object Number]') } -export default isNumber; +export default isNumber diff --git a/isObject.js b/isObject.js index dcd9841729..5ad8eaff83 100644 --- a/isObject.js +++ b/isObject.js @@ -9,21 +9,21 @@ * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * - * isObject({}); + * isObject({}) * // => true * - * isObject([1, 2, 3]); + * isObject([1, 2, 3]) * // => true * - * isObject(Function); + * isObject(Function) * // => true * - * isObject(null); + * isObject(null) * // => false */ function isObject(value) { - const type = typeof value; - return value != null && (type == 'object' || type == 'function'); + const type = typeof value + return value != null && (type == 'object' || type == 'function') } -export default isObject; +export default isObject diff --git a/isObjectLike.js b/isObjectLike.js index 1ac0c6c7ee..8fead699af 100644 --- a/isObjectLike.js +++ b/isObjectLike.js @@ -8,20 +8,20 @@ * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * - * isObjectLike({}); + * isObjectLike({}) * // => true * - * isObjectLike([1, 2, 3]); + * isObjectLike([1, 2, 3]) * // => true * - * isObjectLike(Function); + * isObjectLike(Function) * // => false * - * isObjectLike(null); + * isObjectLike(null) * // => false */ function isObjectLike(value) { - return value != null && typeof value == 'object'; + return value != null && typeof value == 'object' } -export default isObjectLike; +export default isObjectLike diff --git a/isPlainObject.js b/isPlainObject.js index 5352ee434f..beba9ec218 100644 --- a/isPlainObject.js +++ b/isPlainObject.js @@ -1,14 +1,14 @@ -import baseGetTag from './.internal/baseGetTag.js'; -import isObjectLike from './isObjectLike.js'; +import baseGetTag from './.internal/baseGetTag.js' +import isObjectLike from './isObjectLike.js' /** Used to resolve the decompiled source of functions. */ -const funcToString = Function.prototype.toString; +const funcToString = Function.prototype.toString /** Used to check objects for own properties. */ -const hasOwnProperty = Object.prototype.hasOwnProperty; +const hasOwnProperty = Object.prototype.hasOwnProperty /** Used to infer the `Object` constructor. */ -const objectCtorString = funcToString.call(Object); +const objectCtorString = funcToString.call(Object) /** * Checks if `value` is a plain object, that is, an object created by the @@ -21,32 +21,32 @@ const objectCtorString = funcToString.call(Object); * @example * * function Foo() { - * this.a = 1; + * this.a = 1 * } * - * isPlainObject(new Foo); + * isPlainObject(new Foo) * // => false * - * isPlainObject([1, 2, 3]); + * isPlainObject([1, 2, 3]) * // => false * - * isPlainObject({ 'x': 0, 'y': 0 }); + * isPlainObject({ 'x': 0, 'y': 0 }) * // => true * - * isPlainObject(Object.create(null)); + * isPlainObject(Object.create(null)) * // => true */ function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != '[object Object]') { - return false; + return false } - const proto = Object.getPrototypeOf(value); + const proto = Object.getPrototypeOf(value) if (proto === null) { - return true; + return true } - const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; + funcToString.call(Ctor) == objectCtorString } -export default isPlainObject; +export default isPlainObject diff --git a/isRegExp.js b/isRegExp.js index b84f5f2545..c409582c23 100644 --- a/isRegExp.js +++ b/isRegExp.js @@ -1,9 +1,9 @@ -import baseGetTag from './.internal/baseGetTag.js'; -import isObjectLike from './isObjectLike.js'; -import nodeUtil from './.internal/nodeUtil.js'; +import baseGetTag from './.internal/baseGetTag.js' +import isObjectLike from './isObjectLike.js' +import nodeUtil from './.internal/nodeUtil.js' /* Node.js helper references. */ -const nodeIsRegExp = nodeUtil && nodeUtil.isRegExp; +const nodeIsRegExp = nodeUtil && nodeUtil.isRegExp /** * Checks if `value` is classified as a `RegExp` object. @@ -14,14 +14,14 @@ const nodeIsRegExp = nodeUtil && nodeUtil.isRegExp; * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. * @example * - * isRegExp(/abc/); + * isRegExp(/abc/) * // => true * - * isRegExp('/abc/'); + * isRegExp('/abc/') * // => false */ const isRegExp = nodeIsRegExp ? value => nodeIsRegExp(value) - : value => isObjectLike(value) && baseGetTag(value) == '[object RegExp]'; + : value => isObjectLike(value) && baseGetTag(value) == '[object RegExp]' -export default isRegExp; +export default isRegExp diff --git a/isSet.js b/isSet.js index 6dc28fb047..ffdb7fb4b0 100644 --- a/isSet.js +++ b/isSet.js @@ -1,9 +1,9 @@ -import getTag from './.internal/getTag.js'; -import isObjectLike from './isObjectLike.js'; -import nodeUtil from './.internal/nodeUtil.js'; +import getTag from './.internal/getTag.js' +import isObjectLike from './isObjectLike.js' +import nodeUtil from './.internal/nodeUtil.js' /* Node.js helper references. */ -const nodeIsSet = nodeUtil && nodeUtil.isSet; +const nodeIsSet = nodeUtil && nodeUtil.isSet /** * Checks if `value` is classified as a `Set` object. @@ -14,14 +14,14 @@ const nodeIsSet = nodeUtil && nodeUtil.isSet; * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * - * isSet(new Set); + * isSet(new Set) * // => true * - * isSet(new WeakSet); + * isSet(new WeakSet) * // => false */ const isSet = nodeIsSet ? value => nodeIsSet(value) - : value => isObjectLike(value) && getTag(value) == '[object Set]'; + : value => isObjectLike(value) && getTag(value) == '[object Set]' -export default isSet; +export default isSet diff --git a/isString.js b/isString.js index 7e2be4b2e3..710f9ba364 100644 --- a/isString.js +++ b/isString.js @@ -1,5 +1,5 @@ -import baseGetTag from './.internal/baseGetTag.js'; -import isObjectLike from './isObjectLike.js'; +import baseGetTag from './.internal/baseGetTag.js' +import isObjectLike from './isObjectLike.js' /** * Checks if `value` is classified as a `String` primitive or object. @@ -10,15 +10,15 @@ import isObjectLike from './isObjectLike.js'; * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * - * isString('abc'); + * isString('abc') * // => true * - * isString(1); + * isString(1) * // => false */ function isString(value) { return typeof value == 'string' || - (!Array.isArray(value) && isObjectLike(value) && baseGetTag(value) == '[object String]'); + (!Array.isArray(value) && isObjectLike(value) && baseGetTag(value) == '[object String]') } -export default isString; +export default isString diff --git a/isSymbol.js b/isSymbol.js index 9d6f195d20..f1d387fb4b 100644 --- a/isSymbol.js +++ b/isSymbol.js @@ -1,5 +1,5 @@ -import baseGetTag from './.internal/baseGetTag.js'; -import isObjectLike from './isObjectLike.js'; +import baseGetTag from './.internal/baseGetTag.js' +import isObjectLike from './isObjectLike.js' /** * Checks if `value` is classified as a `Symbol` primitive or object. @@ -10,15 +10,15 @@ import isObjectLike from './isObjectLike.js'; * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * - * isSymbol(Symbol.iterator); + * isSymbol(Symbol.iterator) * // => true * - * isSymbol('abc'); + * isSymbol('abc') * // => false */ function isSymbol(value) { return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == '[object Symbol]'); + (isObjectLike(value) && baseGetTag(value) == '[object Symbol]') } -export default isSymbol; +export default isSymbol diff --git a/isTypedArray.js b/isTypedArray.js index 4eb9c36496..c51f45abfc 100644 --- a/isTypedArray.js +++ b/isTypedArray.js @@ -1,13 +1,13 @@ -import baseGetTag from './.internal/baseGetTag.js'; -import isLength from './isLength.js'; -import isObjectLike from './isObjectLike.js'; -import nodeUtil from './.internal/nodeUtil.js'; +import baseGetTag from './.internal/baseGetTag.js' +import isLength from './isLength.js' +import isObjectLike from './isObjectLike.js' +import nodeUtil from './.internal/nodeUtil.js' /** Used to match `toStringTag` values of typed arrays. */ -const reTypedTag = /^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)\]$/; +const reTypedTag = /^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)\]$/ /* Node.js helper references. */ -const nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; +const nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray /** * Checks if `value` is classified as a typed array. @@ -18,14 +18,14 @@ const nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * - * isTypedArray(new Uint8Array); + * isTypedArray(new Uint8Array) * // => true * - * isTypedArray([]); + * isTypedArray([]) * // => false */ const isTypedArray = nodeIsTypedArray ? value => nodeIsTypedArray(value) - : value => isObjectLike(value) && isLength(value.length) && reTypedTag.test(baseGetTag(value)); + : value => isObjectLike(value) && isLength(value.length) && reTypedTag.test(baseGetTag(value)) -export default isTypedArray; +export default isTypedArray diff --git a/isUndefined.js b/isUndefined.js index 19ad5a22ff..e92c558c80 100644 --- a/isUndefined.js +++ b/isUndefined.js @@ -7,14 +7,14 @@ * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. * @example * - * isUndefined(void 0); + * isUndefined(void 0) * // => true * - * isUndefined(null); + * isUndefined(null) * // => false */ function isUndefined(value) { - return value === undefined; + return value === undefined } -export default isUndefined; +export default isUndefined diff --git a/isWeakMap.js b/isWeakMap.js index f449403c6b..0271dca456 100644 --- a/isWeakMap.js +++ b/isWeakMap.js @@ -1,5 +1,5 @@ -import getTag from './.internal/getTag.js'; -import isObjectLike from './isObjectLike.js'; +import getTag from './.internal/getTag.js' +import isObjectLike from './isObjectLike.js' /** * Checks if `value` is classified as a `WeakMap` object. @@ -10,14 +10,14 @@ import isObjectLike from './isObjectLike.js'; * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. * @example * - * isWeakMap(new WeakMap); + * isWeakMap(new WeakMap) * // => true * - * isWeakMap(new Map); + * isWeakMap(new Map) * // => false */ function isWeakMap(value) { - return isObjectLike(value) && getTag(value) == '[object WeakMap]'; + return isObjectLike(value) && getTag(value) == '[object WeakMap]' } -export default isWeakMap; +export default isWeakMap diff --git a/isWeakSet.js b/isWeakSet.js index c7577f44ca..d0ad9f4a81 100644 --- a/isWeakSet.js +++ b/isWeakSet.js @@ -1,5 +1,5 @@ -import baseGetTag from './.internal/baseGetTag.js'; -import isObjectLike from './isObjectLike.js'; +import baseGetTag from './.internal/baseGetTag.js' +import isObjectLike from './isObjectLike.js' /** * Checks if `value` is classified as a `WeakSet` object. @@ -10,14 +10,14 @@ import isObjectLike from './isObjectLike.js'; * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. * @example * - * isWeakSet(new WeakSet); + * isWeakSet(new WeakSet) * // => true * - * isWeakSet(new Set); + * isWeakSet(new Set) * // => false */ function isWeakSet(value) { - return isObjectLike(value) && baseGetTag(value) == '[object WeakSet]'; + return isObjectLike(value) && baseGetTag(value) == '[object WeakSet]' } -export default isWeakSet; +export default isWeakSet diff --git a/join.js b/join.js index 2fc2c197f5..f1e5477792 100644 --- a/join.js +++ b/join.js @@ -1,5 +1,5 @@ /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeJoin = Array.prototype.join; +const nativeJoin = Array.prototype.join /** * Converts all elements in `array` into a string separated by `separator`. @@ -11,11 +11,11 @@ const nativeJoin = Array.prototype.join; * @returns {string} Returns the joined string. * @example * - * join(['a', 'b', 'c'], '~'); + * join(['a', 'b', 'c'], '~') * // => 'a~b~c' */ function join(array, separator) { - return array == null ? '' : nativeJoin.call(array, separator); + return array == null ? '' : nativeJoin.call(array, separator) } -export default join; +export default join diff --git a/kebabCase.js b/kebabCase.js index 5e170c9005..a296a6e8d7 100644 --- a/kebabCase.js +++ b/kebabCase.js @@ -1,4 +1,4 @@ -import createCompounder from './.internal/createCompounder.js'; +import createCompounder from './.internal/createCompounder.js' /** * Converts `string` to @@ -11,17 +11,17 @@ import createCompounder from './.internal/createCompounder.js'; * @see camelCase, lowerCase, snakeCase, startCase, upperCase, upperFirst * @example * - * kebabCase('Foo Bar'); + * kebabCase('Foo Bar') * // => 'foo-bar' * - * kebabCase('fooBar'); + * kebabCase('fooBar') * // => 'foo-bar' * - * kebabCase('__FOO_BAR__'); + * kebabCase('__FOO_BAR__') * // => 'foo-bar' */ const kebabCase = createCompounder((result, word, index) => result + (index ? '-' : '') + word.toLowerCase() -); +) -export default kebabCase; +export default kebabCase diff --git a/keyBy.js b/keyBy.js index d9f141ff60..d1755349c4 100644 --- a/keyBy.js +++ b/keyBy.js @@ -1,5 +1,5 @@ -import baseAssignValue from './.internal/baseAssignValue.js'; -import reduce from './reduce.js'; +import baseAssignValue from './.internal/baseAssignValue.js' +import reduce from './reduce.js' /** * Creates an object composed of keys generated from the results of running @@ -18,15 +18,15 @@ import reduce from './reduce.js'; * const array = [ * { 'dir': 'left', 'code': 97 }, * { 'dir': 'right', 'code': 100 } - * ]; + * ] * - * keyBy(array, ({ code }) => String.fromCharCode(code)); + * keyBy(array, ({ code }) => String.fromCharCode(code)) * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } */ function keyBy(collection, iteratee) { return reduce(collection, (result, value, key) => ( baseAssignValue(result, key, value) - ), {}); + ), {}) } -export default keyBy; +export default keyBy diff --git a/keys.js b/keys.js index 928a860141..0af002410f 100644 --- a/keys.js +++ b/keys.js @@ -1,6 +1,6 @@ -import arrayLikeKeys from './.internal/arrayLikeKeys.js'; -import baseKeys from './.internal/baseKeys.js'; -import isArrayLike from './isArrayLike.js'; +import arrayLikeKeys from './.internal/arrayLikeKeys.js' +import baseKeys from './.internal/baseKeys.js' +import isArrayLike from './isArrayLike.js' /** * Creates an array of the own enumerable property names of `object`. @@ -17,20 +17,20 @@ import isArrayLike from './isArrayLike.js'; * @example * * function Foo() { - * this.a = 1; - * this.b = 2; + * this.a = 1 + * this.b = 2 * } * - * Foo.prototype.c = 3; + * Foo.prototype.c = 3 * - * keys(new Foo); + * keys(new Foo) * // => ['a', 'b'] (iteration order is not guaranteed) * - * keys('hi'); + * keys('hi') * // => ['0', '1'] */ function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object) } -export default keys; +export default keys diff --git a/last.js b/last.js index 738bd6c18e..3bb7dfd8b8 100644 --- a/last.js +++ b/last.js @@ -7,12 +7,12 @@ * @returns {*} Returns the last element of `array`. * @example * - * last([1, 2, 3]); + * last([1, 2, 3]) * // => 3 */ function last(array) { - const length = array == null ? 0 : array.length; - return length ? array[length - 1] : undefined; + const length = array == null ? 0 : array.length + return length ? array[length - 1] : undefined } -export default last; +export default last diff --git a/lastIndexOf.js b/lastIndexOf.js index 0c078a1c76..c01cbaf18a 100644 --- a/lastIndexOf.js +++ b/lastIndexOf.js @@ -1,11 +1,11 @@ -import baseFindIndex from './.internal/baseFindIndex.js'; -import baseIsNaN from './.internal/baseIsNaN.js'; -import strictLastIndexOf from './.internal/strictLastIndexOf.js'; -import toInteger from './toInteger.js'; +import baseFindIndex from './.internal/baseFindIndex.js' +import baseIsNaN from './.internal/baseIsNaN.js' +import strictLastIndexOf from './.internal/strictLastIndexOf.js' +import toInteger from './toInteger.js' /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeMax = Math.max; -const nativeMin = Math.min; +const nativeMax = Math.max +const nativeMin = Math.min /** * This method is like `indexOf` except that it iterates over elements of @@ -19,26 +19,26 @@ const nativeMin = Math.min; * @returns {number} Returns the index of the matched value, else `-1`. * @example * - * lastIndexOf([1, 2, 1, 2], 2); + * lastIndexOf([1, 2, 1, 2], 2) * // => 3 * * // Search from the `fromIndex`. - * lastIndexOf([1, 2, 1, 2], 2, 2); + * lastIndexOf([1, 2, 1, 2], 2, 2) * // => 1 */ function lastIndexOf(array, value, fromIndex) { - const length = array == null ? 0 : array.length; + const length = array == null ? 0 : array.length if (!length) { - return -1; + return -1 } - let index = length; + let index = length if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + index = toInteger(fromIndex) + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1) } return value === value ? strictLastIndexOf(array, value, index) - : baseFindIndex(array, baseIsNaN, index, true); + : baseFindIndex(array, baseIsNaN, index, true) } -export default lastIndexOf; +export default lastIndexOf diff --git a/lowerCase.js b/lowerCase.js index cb9a70d503..11f28eba23 100644 --- a/lowerCase.js +++ b/lowerCase.js @@ -1,4 +1,4 @@ -import createCompounder from './.internal/createCompounder.js'; +import createCompounder from './.internal/createCompounder.js' /** * Converts `string`, as space separated words, to lower case. @@ -10,17 +10,17 @@ import createCompounder from './.internal/createCompounder.js'; * @see camelCase, kebabCase, snakeCase, startCase, upperCase, upperFirst * @example * - * lowerCase('--Foo-Bar--'); + * lowerCase('--Foo-Bar--') * // => 'foo bar' * - * lowerCase('fooBar'); + * lowerCase('fooBar') * // => 'foo bar' * - * lowerCase('__FOO_BAR__'); + * lowerCase('__FOO_BAR__') * // => 'foo bar' */ const lowerCase = createCompounder((result, word, index) => result + (index ? ' ' : '') + word.toLowerCase() -); +) -export default lowerCase; +export default lowerCase diff --git a/lowerFirst.js b/lowerFirst.js index ab84a119ab..f569521919 100644 --- a/lowerFirst.js +++ b/lowerFirst.js @@ -1,4 +1,4 @@ -import createCaseFirst from './.internal/createCaseFirst.js'; +import createCaseFirst from './.internal/createCaseFirst.js' /** * Converts the first character of `string` to lower case. @@ -9,12 +9,12 @@ import createCaseFirst from './.internal/createCaseFirst.js'; * @returns {string} Returns the converted string. * @example * - * lowerFirst('Fred'); + * lowerFirst('Fred') * // => 'fred' * - * lowerFirst('FRED'); + * lowerFirst('FRED') * // => 'fRED' */ -const lowerFirst = createCaseFirst('toLowerCase'); +const lowerFirst = createCaseFirst('toLowerCase') -export default lowerFirst; +export default lowerFirst diff --git a/lt.js b/lt.js index 9606d183a1..560c79073f 100644 --- a/lt.js +++ b/lt.js @@ -1,4 +1,4 @@ -import toNumber from './toNumber.js'; +import toNumber from './toNumber.js' /** * Checks if `value` is less than `other`. @@ -12,21 +12,21 @@ import toNumber from './toNumber.js'; * @see gt, gte, lte * @example * - * lt(1, 3); + * lt(1, 3) * // => true * - * lt(3, 3); + * lt(3, 3) * // => false * - * lt(3, 1); + * lt(3, 1) * // => false */ function lt(value, other) { if (!(typeof value == 'string' && typeof other == 'string')) { - value = toNumber(value); - other = toNumber(other); + value = toNumber(value) + other = toNumber(other) } - return value < other; + return value < other } -export default lt; +export default lt diff --git a/lte.js b/lte.js index 924cc26d23..4a4b4416bf 100644 --- a/lte.js +++ b/lte.js @@ -1,4 +1,4 @@ -import toNumber from './toNumber.js'; +import toNumber from './toNumber.js' /** * Checks if `value` is less than or equal to `other`. @@ -12,21 +12,21 @@ import toNumber from './toNumber.js'; * @see gt, gte, lt * @example * - * lte(1, 3); + * lte(1, 3) * // => true * - * lte(3, 3); + * lte(3, 3) * // => true * - * lte(3, 1); + * lte(3, 1) * // => false */ function lte(value, other) { if (!(typeof value == 'string' && typeof other == 'string')) { - value = toNumber(value); - other = toNumber(other); + value = toNumber(value) + other = toNumber(other) } - return value <= other; + return value <= other } -export default lte; +export default lte diff --git a/map.js b/map.js index c784b94f7e..dab1700519 100644 --- a/map.js +++ b/map.js @@ -1,5 +1,5 @@ -import arrayMap from './.internal/arrayMap.js'; -import baseMap from './.internal/baseMap.js'; +import arrayMap from './.internal/arrayMap.js' +import baseMap from './.internal/baseMap.js' /** * Creates an array of values by running each element in `collection` thru @@ -23,18 +23,18 @@ import baseMap from './.internal/baseMap.js'; * @example * * function square(n) { - * return n * n; + * return n * n * } * - * map([4, 8], square); + * map([4, 8], square) * // => [16, 64] * - * map({ 'a': 4, 'b': 8 }, square); + * map({ 'a': 4, 'b': 8 }, square) * // => [16, 64] (iteration order is not guaranteed) */ function map(collection, iteratee) { - const func = Array.isArray(collection) ? arrayMap : baseMap; - return func(collection, iteratee); + const func = Array.isArray(collection) ? arrayMap : baseMap + return func(collection, iteratee) } -export default map; +export default map diff --git a/mapKeys.js b/mapKeys.js index c0dc6fda3e..6b0571d39e 100644 --- a/mapKeys.js +++ b/mapKeys.js @@ -1,8 +1,8 @@ -import baseAssignValue from './.internal/baseAssignValue.js'; -import baseForOwn from './.internal/baseForOwn.js'; +import baseAssignValue from './.internal/baseAssignValue.js' +import baseForOwn from './.internal/baseForOwn.js' /** - * The opposite of `mapValues`; this method creates an object with the + * The opposite of `mapValues` this method creates an object with the * same values as `object` and keys generated by running each own enumerable * string keyed property of `object` thru `iteratee`. The iteratee is invoked * with three arguments: (value, key, object). @@ -16,16 +16,16 @@ import baseForOwn from './.internal/baseForOwn.js'; * @example * * mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { - * return key + value; - * }); + * return key + value + * }) * // => { 'a1': 1, 'b2': 2 } */ function mapKeys(object, iteratee) { - const result = {}; + const result = {} baseForOwn(object, (value, key, object) => { - baseAssignValue(result, iteratee(value, key, object), value); - }); - return result; + baseAssignValue(result, iteratee(value, key, object), value) + }) + return result } -export default mapKeys; +export default mapKeys diff --git a/mapValues.js b/mapValues.js index 0269a256ea..5d62bac56a 100644 --- a/mapValues.js +++ b/mapValues.js @@ -1,5 +1,5 @@ -import baseAssignValue from './.internal/baseAssignValue.js'; -import baseForOwn from './.internal/baseForOwn.js'; +import baseAssignValue from './.internal/baseAssignValue.js' +import baseForOwn from './.internal/baseForOwn.js' /** * Creates an object with the same keys as `object` and values generated @@ -18,17 +18,17 @@ import baseForOwn from './.internal/baseForOwn.js'; * const users = { * 'fred': { 'user': 'fred', 'age': 40 }, * 'pebbles': { 'user': 'pebbles', 'age': 1 } - * }; + * } * - * mapValues(users, ({ age }) => age); + * mapValues(users, ({ age }) => age) * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ function mapValues(object, iteratee) { - const result = {}; + const result = {} baseForOwn(object, (value, key, object) => { - baseAssignValue(result, key, iteratee(value, key, object)); - }); - return result; + baseAssignValue(result, key, iteratee(value, key, object)) + }) + return result } -export default mapValues; +export default mapValues diff --git a/matches.js b/matches.js index d15085bbb2..a0ae76a844 100644 --- a/matches.js +++ b/matches.js @@ -1,8 +1,8 @@ -import baseClone from './.internal/baseClone.js'; -import baseMatches from './.internal/baseMatches.js'; +import baseClone from './.internal/baseClone.js' +import baseMatches from './.internal/baseMatches.js' /** Used to compose bitmasks for cloning. */ -const CLONE_DEEP_FLAG = 1; +const CLONE_DEEP_FLAG = 1 /** * Creates a function that performs a partial deep comparison between a given @@ -25,13 +25,13 @@ const CLONE_DEEP_FLAG = 1; * const objects = [ * { 'a': 1, 'b': 2, 'c': 3 }, * { 'a': 4, 'b': 5, 'c': 6 } - * ]; + * ] * - * filter(objects, matches({ 'a': 4, 'c': 6 })); + * filter(objects, matches({ 'a': 4, 'c': 6 })) * // => [{ 'a': 4, 'b': 5, 'c': 6 }] */ function matches(source) { - return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); + return baseMatches(baseClone(source, CLONE_DEEP_FLAG)) } -export default matches; +export default matches diff --git a/matchesProperty.js b/matchesProperty.js index f3c0389f63..cf6122e8f7 100644 --- a/matchesProperty.js +++ b/matchesProperty.js @@ -1,8 +1,8 @@ -import baseClone from './.internal/baseClone.js'; -import baseMatchesProperty from './.internal/baseMatchesProperty.js'; +import baseClone from './.internal/baseClone.js' +import baseMatchesProperty from './.internal/baseMatchesProperty.js' /** Used to compose bitmasks for cloning. */ -const CLONE_DEEP_FLAG = 1; +const CLONE_DEEP_FLAG = 1 /** * Creates a function that performs a partial deep comparison between the @@ -23,13 +23,13 @@ const CLONE_DEEP_FLAG = 1; * const objects = [ * { 'a': 1, 'b': 2, 'c': 3 }, * { 'a': 4, 'b': 5, 'c': 6 } - * ]; + * ] * - * find(objects, matchesProperty('a', 4)); + * find(objects, matchesProperty('a', 4)) * // => { 'a': 4, 'b': 5, 'c': 6 } */ function matchesProperty(path, srcValue) { - return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); + return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)) } -export default matchesProperty; +export default matchesProperty diff --git a/maxBy.js b/maxBy.js index ffef3f78ee..440f153d08 100644 --- a/maxBy.js +++ b/maxBy.js @@ -1,4 +1,4 @@ -import isSymbol from './isSymbol.js'; +import isSymbol from './isSymbol.js' /** * This method is like `max` except that it accepts `iteratee` which is @@ -12,30 +12,30 @@ import isSymbol from './isSymbol.js'; * @returns {*} Returns the maximum value. * @example * - * const objects = [{ 'n': 1 }, { 'n': 2 }]; + * const objects = [{ 'n': 1 }, { 'n': 2 }] * - * maxBy(objects, ({ n }) => n); + * maxBy(objects, ({ n }) => n) * // => { 'n': 2 } */ function maxBy(array, iteratee) { - let result; - let index = -1; - const length = array ? array.length : 0; + let result + let index = -1 + const length = array ? array.length : 0 while (++index < length) { - let computed; - const value = array[index]; - const current = iteratee(value); + let computed + const value = array[index] + const current = iteratee(value) if (current != null && (computed === undefined ? (current === current && !isSymbol(current)) : (current > computed) )) { - computed = current; - result = value; + computed = current + result = value } } - return result; + return result } -export default maxBy; +export default maxBy diff --git a/mean.js b/mean.js index 75f3a95734..9d4a57711f 100644 --- a/mean.js +++ b/mean.js @@ -1,5 +1,5 @@ -import baseMean from './meanBy.js'; -import identity from './identity.js'; +import baseMean from './meanBy.js' +import identity from './identity.js' /** * Computes the mean of the values in `array`. @@ -10,11 +10,11 @@ import identity from './identity.js'; * @returns {number} Returns the mean. * @example * - * mean([4, 2, 8, 6]); + * mean([4, 2, 8, 6]) * // => 5 */ function mean(array) { - return mean(array, identity); + return mean(array, identity) } -export default mean; +export default mean diff --git a/meanBy.js b/meanBy.js index 1c57c25d4e..d365c89726 100644 --- a/meanBy.js +++ b/meanBy.js @@ -1,7 +1,7 @@ -import baseSum from './.internal/baseSum.js'; +import baseSum from './.internal/baseSum.js' /** Used as references for various `Number` constants. */ -const NAN = 0 / 0; +const NAN = 0 / 0 /** * This method is like `mean` except that it accepts `iteratee` which is @@ -15,14 +15,14 @@ const NAN = 0 / 0; * @returns {number} Returns the mean. * @example * - * const objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; + * const objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }] * - * meanBy(objects, ({ n }) => n); + * meanBy(objects, ({ n }) => n) * // => 5 */ function meanBy(array, iteratee) { - const length = array == null ? 0 : array.length; - return length ? (baseSum(array, iteratee) / length) : NAN; + const length = array == null ? 0 : array.length + return length ? (baseSum(array, iteratee) / length) : NAN } -export default meanBy; +export default meanBy diff --git a/memoize.js b/memoize.js index 8a57c309d0..3fb4c32bec 100644 --- a/memoize.js +++ b/memoize.js @@ -1,4 +1,4 @@ -import MapCache from './.internal/MapCache.js'; +import MapCache from './.internal/MapCache.js' /** * Creates a function that memoizes the result of `func`. If `resolver` is @@ -20,47 +20,47 @@ import MapCache from './.internal/MapCache.js'; * @returns {Function} Returns the new memoized function. * @example * - * const object = { 'a': 1, 'b': 2 }; - * const other = { 'c': 3, 'd': 4 }; + * const object = { 'a': 1, 'b': 2 } + * const other = { 'c': 3, 'd': 4 } * - * const values = memoize(values); - * values(object); + * const values = memoize(values) + * values(object) * // => [1, 2] * - * values(other); + * values(other) * // => [3, 4] * - * object.a = 2; - * values(object); + * object.a = 2 + * values(object) * // => [1, 2] * * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); + * values.cache.set(object, ['a', 'b']) + * values(object) * // => ['a', 'b'] * * // Replace `memoize.Cache`. - * memoize.Cache = WeakMap; + * memoize.Cache = WeakMap */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { - throw new TypeError('Expected a function'); + throw new TypeError('Expected a function') } const memoized = function(...args) { - const key = resolver ? resolver.apply(this, args) : args[0]; - const cache = memoized.cache; + const key = resolver ? resolver.apply(this, args) : args[0] + const cache = memoized.cache if (cache.has(key)) { - return cache.get(key); + return cache.get(key) } - const result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; + const result = func.apply(this, args) + memoized.cache = cache.set(key, result) || cache + return result + } + memoized.cache = new (memoize.Cache || MapCache) + return memoized } -memoize.Cache = MapCache; +memoize.Cache = MapCache -export default memoize; +export default memoize diff --git a/merge.js b/merge.js index aeb9595cbf..730b296347 100644 --- a/merge.js +++ b/merge.js @@ -1,5 +1,5 @@ -import baseMerge from './.internal/baseMerge.js'; -import createAssigner from './.internal/createAssigner.js'; +import baseMerge from './.internal/baseMerge.js' +import createAssigner from './.internal/createAssigner.js' /** * This method is like `assign` except that it recursively merges own and @@ -21,17 +21,17 @@ import createAssigner from './.internal/createAssigner.js'; * * const object = { * 'a': [{ 'b': 2 }, { 'd': 4 }] - * }; + * } * * const other = { * 'a': [{ 'c': 3 }, { 'e': 5 }] - * }; + * } * - * merge(object, other); + * merge(object, other) * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ const merge = createAssigner((object, source, srcIndex) => { - baseMerge(object, source, srcIndex); -}); + baseMerge(object, source, srcIndex) +}) -export default merge; +export default merge diff --git a/mergeWith.js b/mergeWith.js index 02db25828c..dc930be41f 100644 --- a/mergeWith.js +++ b/mergeWith.js @@ -1,5 +1,5 @@ -import baseMerge from './.internal/baseMerge.js'; -import createAssigner from './.internal/createAssigner.js'; +import baseMerge from './.internal/baseMerge.js' +import createAssigner from './.internal/createAssigner.js' /** * This method is like `merge` except that it accepts `customizer` which @@ -20,18 +20,18 @@ import createAssigner from './.internal/createAssigner.js'; * * function customizer(objValue, srcValue) { * if (Array.isArray(objValue)) { - * return objValue.concat(srcValue); + * return objValue.concat(srcValue) * } * } * - * const object = { 'a': [1], 'b': [2] }; - * const other = { 'a': [3], 'b': [4] }; + * const object = { 'a': [1], 'b': [2] } + * const other = { 'a': [3], 'b': [4] } * - * mergeWith(object, other, customizer); + * mergeWith(object, other, customizer) * // => { 'a': [1, 3], 'b': [2, 4] } */ const mergeWith = createAssigner((object, source, srcIndex, customizer) => { - baseMerge(object, source, srcIndex, customizer); -}); + baseMerge(object, source, srcIndex, customizer) +}) -export default mergeWith; +export default mergeWith diff --git a/method.js b/method.js index 89368d4e4a..74f1e36a1c 100644 --- a/method.js +++ b/method.js @@ -1,4 +1,4 @@ -import invoke from './invoke.js'; +import invoke from './invoke.js' /** * Creates a function that invokes the method at `path` of a given object. @@ -14,16 +14,16 @@ import invoke from './invoke.js'; * const objects = [ * { 'a': { 'b': constant(2) } }, * { 'a': { 'b': constant(1) } } - * ]; + * ] * - * map(objects, method('a.b')); + * map(objects, method('a.b')) * // => [2, 1] * - * map(objects, method(['a', 'b'])); + * map(objects, method(['a', 'b'])) * // => [2, 1] */ function method(path, args) { - return object => invoke(object, path, args); + return object => invoke(object, path, args) } -export default method; +export default method diff --git a/methodOf.js b/methodOf.js index 687d74c75a..cc66a6196d 100644 --- a/methodOf.js +++ b/methodOf.js @@ -1,7 +1,7 @@ -import invoke from './invoke.js'; +import invoke from './invoke.js' /** - * The opposite of `method`; this method creates a function that invokes + * The opposite of `method` this method creates a function that invokes * the method at a given path of `object`. Any additional arguments are * provided to the invoked method. * @@ -12,17 +12,17 @@ import invoke from './invoke.js'; * @returns {Function} Returns the new invoker function. * @example * - * const array = times(3, constant); - * const object = { 'a': array, 'b': array, 'c': array }; + * const array = times(3, constant) + * const object = { 'a': array, 'b': array, 'c': array } * - * map(['a[2]', 'c[0]'], methodOf(object)); + * map(['a[2]', 'c[0]'], methodOf(object)) * // => [2, 0] * - * map([['a', '2'], ['c', '0']], methodOf(object)); + * map([['a', '2'], ['c', '0']], methodOf(object)) * // => [2, 0] */ function methodOf(object, args) { - return path => invoke(object, path, args); + return path => invoke(object, path, args) } -export default methodOf; +export default methodOf diff --git a/minBy.js b/minBy.js index c0fc65904d..57355341da 100644 --- a/minBy.js +++ b/minBy.js @@ -1,4 +1,4 @@ -import isSymbol from './isSymbol.js'; +import isSymbol from './isSymbol.js' /** * This method is like `min` except that it accepts `iteratee` which is @@ -12,30 +12,30 @@ import isSymbol from './isSymbol.js'; * @returns {*} Returns the minimum value. * @example * - * const objects = [{ 'n': 1 }, { 'n': 2 }]; + * const objects = [{ 'n': 1 }, { 'n': 2 }] * - * minBy(objects, ({ n }) => n); + * minBy(objects, ({ n }) => n) * // => { 'n': 1 } */ function minBy(array, iteratee) { - let result; - let index = -1; - const length = array ? array.length : 0; + let result + let index = -1 + const length = array ? array.length : 0 while (++index < length) { - let computed; - const value = array[index]; - const current = iteratee(value); + let computed + const value = array[index] + const current = iteratee(value) if (current != null && (computed === undefined ? (current === current && !isSymbol(current)) : (current < computed) )) { - computed = current; - result = value; + computed = current + result = value } } - return result; + return result } -export default minBy; +export default minBy diff --git a/multiply.js b/multiply.js index cc70da3e5e..8ccba1406f 100644 --- a/multiply.js +++ b/multiply.js @@ -1,4 +1,4 @@ -import createMathOperation from './.internal/createMathOperation.js'; +import createMathOperation from './.internal/createMathOperation.js' /** * Multiply two numbers. @@ -10,9 +10,9 @@ import createMathOperation from './.internal/createMathOperation.js'; * @returns {number} Returns the product. * @example * - * multiply(6, 4); + * multiply(6, 4) * // => 24 */ -const multiply = createMathOperation((multiplier, multiplicand) => multiplier * multiplicand, 1); +const multiply = createMathOperation((multiplier, multiplicand) => multiplier * multiplicand, 1) -export default multiply; +export default multiply diff --git a/negate.js b/negate.js index 97945adab7..d1175e969c 100644 --- a/negate.js +++ b/negate.js @@ -10,19 +10,19 @@ * @example * * function isEven(n) { - * return n % 2 == 0; + * return n % 2 == 0 * } * - * filter([1, 2, 3, 4, 5, 6], negate(isEven)); + * filter([1, 2, 3, 4, 5, 6], negate(isEven)) * // => [1, 3, 5] */ function negate(predicate) { if (typeof predicate != 'function') { - throw new TypeError('Expected a function'); + throw new TypeError('Expected a function') } return function(...args) { - return !predicate.apply(this, args); - }; + return !predicate.apply(this, args) + } } -export default negate; +export default negate diff --git a/nth.js b/nth.js index 17e85be30d..906b5633b3 100644 --- a/nth.js +++ b/nth.js @@ -1,5 +1,5 @@ -import baseNth from './.internal/baseNth.js'; -import toInteger from './toInteger.js'; +import baseNth from './.internal/baseNth.js' +import toInteger from './toInteger.js' /** * Gets the element at index `n` of `array`. If `n` is negative, the nth @@ -12,16 +12,16 @@ import toInteger from './toInteger.js'; * @returns {*} Returns the nth element of `array`. * @example * - * const array = ['a', 'b', 'c', 'd']; + * const array = ['a', 'b', 'c', 'd'] * - * nth(array, 1); + * nth(array, 1) * // => 'b' * - * nth(array, -2); - * // => 'c'; + * nth(array, -2) + * // => 'c' */ function nth(array, n) { - return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined } -export default nth; +export default nth diff --git a/nthArg.js b/nthArg.js index 40eaccb4f6..4612f599b6 100644 --- a/nthArg.js +++ b/nthArg.js @@ -1,5 +1,5 @@ -import baseNth from './.internal/baseNth.js'; -import toInteger from './toInteger.js'; +import baseNth from './.internal/baseNth.js' +import toInteger from './toInteger.js' /** * Creates a function that gets the argument at index `n`. If `n` is negative, @@ -11,17 +11,17 @@ import toInteger from './toInteger.js'; * @returns {Function} Returns the new pass-thru function. * @example * - * const func = nthArg(1); - * func('a', 'b', 'c', 'd'); + * const func = nthArg(1) + * func('a', 'b', 'c', 'd') * // => 'b' * - * const func = nthArg(-2); - * func('a', 'b', 'c', 'd'); + * const func = nthArg(-2) + * func('a', 'b', 'c', 'd') * // => 'c' */ function nthArg(n) { - n = toInteger(n); - return (...args) => baseNth(args, n); + n = toInteger(n) + return (...args) => baseNth(args, n) } -export default nthArg; +export default nthArg diff --git a/once.js b/once.js index 696c00f7e1..653000bea0 100644 --- a/once.js +++ b/once.js @@ -1,4 +1,4 @@ -import before from './before.js'; +import before from './before.js' /** * Creates a function that is restricted to invoking `func` once. Repeat calls @@ -11,13 +11,13 @@ import before from './before.js'; * @returns {Function} Returns the new restricted function. * @example * - * const initialize = once(createApplication); - * initialize(); - * initialize(); + * const initialize = once(createApplication) + * initialize() + * initialize() * // => `createApplication` is invoked once */ function once(func) { - return before(2, func); + return before(2, func) } -export default once; +export default once diff --git a/orderBy.js b/orderBy.js index b4c78c1d02..3f1726bcc8 100644 --- a/orderBy.js +++ b/orderBy.js @@ -1,4 +1,4 @@ -import baseOrderBy from './.internal/baseOrderBy.js'; +import baseOrderBy from './.internal/baseOrderBy.js' /** * This method is like `sortBy` except that it allows specifying the sort @@ -22,24 +22,24 @@ import baseOrderBy from './.internal/baseOrderBy.js'; * { 'user': 'barney', 'age': 34 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 36 } - * ]; + * ] * * // Sort by `user` in ascending order and by `age` in descending order. - * orderBy(users, ['user', 'age'], ['asc', 'desc']); + * orderBy(users, ['user', 'age'], ['asc', 'desc']) * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ function orderBy(collection, iteratees, orders, guard) { if (collection == null) { - return []; + return [] } if (!Array.isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; + iteratees = iteratees == null ? [] : [iteratees] } - orders = guard ? undefined : orders; + orders = guard ? undefined : orders if (!Array.isArray(orders)) { - orders = orders == null ? [] : [orders]; + orders = orders == null ? [] : [orders] } - return baseOrderBy(collection, iteratees, orders); + return baseOrderBy(collection, iteratees, orders) } -export default orderBy; +export default orderBy diff --git a/over.js b/over.js index 530b33372c..a769a24ae1 100644 --- a/over.js +++ b/over.js @@ -1,5 +1,5 @@ -import apply from './.internal/apply.js'; -import arrayMap from './.internal/arrayMap.js'; +import apply from './.internal/apply.js' +import arrayMap from './.internal/arrayMap.js' /** * Creates a function that invokes `iteratees` with the arguments it receives @@ -12,16 +12,16 @@ import arrayMap from './.internal/arrayMap.js'; * @returns {Function} Returns the new function. * @example * - * const func = over([Math.max, Math.min]); + * const func = over([Math.max, Math.min]) * - * func(1, 2, 3, 4); + * func(1, 2, 3, 4) * // => [4, 1] */ function over(iteratees) { return function(...args) { - const thisArg = this; - return arrayMap(iteratees, iteratee => apply(iteratee, thisArg, args)); - }; + const thisArg = this + return arrayMap(iteratees, iteratee => apply(iteratee, thisArg, args)) + } } -export default over; +export default over diff --git a/overArgs.js b/overArgs.js index 3d7620bcbc..b0b13df2e8 100644 --- a/overArgs.js +++ b/overArgs.js @@ -1,4 +1,4 @@ -import apply from './.internal/apply.js'; +import apply from './.internal/apply.js' /** * Creates a function that invokes `func` with its arguments transformed. @@ -12,31 +12,31 @@ import apply from './.internal/apply.js'; * @example * * function doubled(n) { - * return n * 2; + * return n * 2 * } * * function square(n) { - * return n * n; + * return n * n * } * - * const func = overArgs((x, y) => [x, y], [square, doubled]); + * const func = overArgs((x, y) => [x, y], [square, doubled]) * - * func(9, 3); + * func(9, 3) * // => [81, 6] * - * func(10, 5); + * func(10, 5) * // => [100, 10] */ function overArgs(func, transforms) { - const funcsLength = transforms.length; + const funcsLength = transforms.length return function(...args) { - let index = -1; - const length = Math.min(args.length, funcsLength); + let index = -1 + const length = Math.min(args.length, funcsLength) while (++index < length) { - args[index] = transforms[index].call(this, args[index]); + args[index] = transforms[index].call(this, args[index]) } - return apply(func, this, args); - }; + return apply(func, this, args) + } } -export default overArgs; +export default overArgs diff --git a/overEvery.js b/overEvery.js index 0715b9ad3b..6607435b42 100644 --- a/overEvery.js +++ b/overEvery.js @@ -1,5 +1,5 @@ -import apply from './.internal/apply.js'; -import arrayEvery from './.internal/arrayEvery.js'; +import apply from './.internal/apply.js' +import arrayEvery from './.internal/arrayEvery.js' /** * Creates a function that checks if **all** of the `predicates` return @@ -12,22 +12,22 @@ import arrayEvery from './.internal/arrayEvery.js'; * @returns {Function} Returns the new function. * @example * - * const func = overEvery([Boolean, isFinite]); + * const func = overEvery([Boolean, isFinite]) * - * func('1'); + * func('1') * // => true * - * func(null); + * func(null) * // => false * - * func(NaN); + * func(NaN) * // => false */ function overEvery(iteratees) { return function(...args) { - const thisArg = this; - return arrayEvery(iteratees, iteratee => apply(iteratee, thisArg, args)); - }; + const thisArg = this + return arrayEvery(iteratees, iteratee => apply(iteratee, thisArg, args)) + } } -export default overEvery; +export default overEvery diff --git a/overSome.js b/overSome.js index 6308c0890f..b9342caefb 100644 --- a/overSome.js +++ b/overSome.js @@ -1,5 +1,5 @@ -import apply from './.internal/apply.js'; -import arraySome from './.internal/arraySome.js'; +import apply from './.internal/apply.js' +import arraySome from './.internal/arraySome.js' /** * Creates a function that checks if **any** of the `predicates` return @@ -12,22 +12,22 @@ import arraySome from './.internal/arraySome.js'; * @returns {Function} Returns the new function. * @example * - * const func = overSome([Boolean, isFinite]); + * const func = overSome([Boolean, isFinite]) * - * func('1'); + * func('1') * // => true * - * func(null); + * func(null) * // => true * - * func(NaN); + * func(NaN) * // => false */ function overSome(iteratees) { return function(...args) { - const thisArg = this; - return arraySome(iteratees, iteratee => apply(iteratee, thisArg, args)); - }; + const thisArg = this + return arraySome(iteratees, iteratee => apply(iteratee, thisArg, args)) + } } -export default overSome; +export default overSome diff --git a/pad.js b/pad.js index 3adeb78e5d..216ff864a1 100644 --- a/pad.js +++ b/pad.js @@ -1,11 +1,11 @@ -import createPadding from './.internal/createPadding.js'; -import stringSize from './.internal/stringSize.js'; -import toInteger from './toInteger.js'; -import toString from './toString.js'; +import createPadding from './.internal/createPadding.js' +import stringSize from './.internal/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. */ -const nativeCeil = Math.ceil; -const nativeFloor = Math.floor; +const nativeCeil = Math.ceil +const nativeFloor = Math.floor /** * Pads `string` on the left and right sides if it's shorter than `length`. @@ -19,29 +19,29 @@ const nativeFloor = Math.floor; * @returns {string} Returns the padded string. * @example * - * pad('abc', 8); + * pad('abc', 8) * // => ' abc ' * - * pad('abc', 8, '_-'); + * pad('abc', 8, '_-') * // => '_-abc_-_' * - * pad('abc', 3); + * pad('abc', 3) * // => 'abc' */ function pad(string, length, chars) { - string = toString(string); - length = toInteger(length); + string = toString(string) + length = toInteger(length) - const strLength = length ? stringSize(string) : 0; + const strLength = length ? stringSize(string) : 0 if (!length || strLength >= length) { - return string; + return string } - const mid = (length - strLength) / 2; + const mid = (length - strLength) / 2 return ( createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars) - ); + ) } -export default pad; +export default pad diff --git a/padEnd.js b/padEnd.js index 513690ac2a..8795bc5cb9 100644 --- a/padEnd.js +++ b/padEnd.js @@ -1,7 +1,7 @@ -import createPadding from './.internal/createPadding.js'; -import stringSize from './.internal/stringSize.js'; -import toInteger from './toInteger.js'; -import toString from './toString.js'; +import createPadding from './.internal/createPadding.js' +import stringSize from './.internal/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 @@ -15,23 +15,23 @@ import toString from './toString.js'; * @returns {string} Returns the padded string. * @example * - * padEnd('abc', 6); + * padEnd('abc', 6) * // => 'abc ' * - * padEnd('abc', 6, '_-'); + * padEnd('abc', 6, '_-') * // => 'abc_-_' * - * padEnd('abc', 3); + * padEnd('abc', 3) * // => 'abc' */ function padEnd(string, length, chars) { - string = toString(string); - length = toInteger(length); + string = toString(string) + length = toInteger(length) - const strLength = length ? stringSize(string) : 0; + const strLength = length ? stringSize(string) : 0 return (length && strLength < length) ? (string + createPadding(length - strLength, chars)) - : string; + : string } -export default padEnd; +export default padEnd diff --git a/padStart.js b/padStart.js index 6d57c2e75b..704b718227 100644 --- a/padStart.js +++ b/padStart.js @@ -1,7 +1,7 @@ -import createPadding from './.internal/createPadding.js'; -import stringSize from './.internal/stringSize.js'; -import toInteger from './toInteger.js'; -import toString from './toString.js'; +import createPadding from './.internal/createPadding.js' +import stringSize from './.internal/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 @@ -15,23 +15,23 @@ import toString from './toString.js'; * @returns {string} Returns the padded string. * @example * - * padStart('abc', 6); + * padStart('abc', 6) * // => ' abc' * - * padStart('abc', 6, '_-'); + * padStart('abc', 6, '_-') * // => '_-_abc' * - * padStart('abc', 3); + * padStart('abc', 3) * // => 'abc' */ function padStart(string, length, chars) { - string = toString(string); - length = toInteger(length); + string = toString(string) + length = toInteger(length) - const strLength = length ? stringSize(string) : 0; + const strLength = length ? stringSize(string) : 0 return (length && strLength < length) ? (createPadding(length - strLength, chars) + string) - : string; + : string } -export default padStart; +export default padStart diff --git a/parseInt.js b/parseInt.js index 9b7186a752..51b3012871 100644 --- a/parseInt.js +++ b/parseInt.js @@ -1,11 +1,11 @@ -import root from './.internal/root.js'; -import toString from './toString.js'; +import root from './.internal/root.js' +import toString from './toString.js' /** Used to match leading and trailing whitespace. */ -const reTrimStart = /^\s+/; +const reTrimStart = /^\s+/ /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeParseInt = root.parseInt; +const nativeParseInt = root.parseInt /** * Converts `string` to an integer of the specified radix. If `radix` is @@ -23,19 +23,19 @@ const nativeParseInt = root.parseInt; * @returns {number} Returns the converted integer. * @example * - * parseInt('08'); + * parseInt('08') * // => 8 * - * map(['6', '08', '10'], parseInt); + * map(['6', '08', '10'], parseInt) * // => [6, 8, 10] */ function parseInt(string, radix, guard) { if (guard || radix == null) { - radix = 0; + radix = 0 } else if (radix) { - radix = +radix; + radix = +radix } - return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0) } -export default parseInt; +export default parseInt diff --git a/partition.js b/partition.js index 3973e996ab..3cd274b8ea 100644 --- a/partition.js +++ b/partition.js @@ -1,4 +1,4 @@ -import reduce from './reduce.js'; +import reduce from './reduce.js' /** * Creates an array of elements split into two groups, the first of which @@ -18,15 +18,15 @@ import reduce from './reduce.js'; * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true }, * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; + * ] * - * partition(users, ({ active }) => active); + * partition(users, ({ active }) => active) * // => objects for [['fred'], ['barney', 'pebbles']] */ function partition(collection, predicate) { return reduce(collection, (result, value, key) => ( result[key ? 0 : 1].push(value) - ), [[], []]); + ), [[], []]) } -export default partition; +export default partition diff --git a/pick.js b/pick.js index f9da4c4aee..8878cb013f 100644 --- a/pick.js +++ b/pick.js @@ -1,4 +1,4 @@ -import basePick from './.internal/basePick.js'; +import basePick from './.internal/basePick.js' /** * Creates an object composed of the picked `object` properties. @@ -10,13 +10,13 @@ import basePick from './.internal/basePick.js'; * @returns {Object} Returns the new object. * @example * - * const object = { 'a': 1, 'b': '2', 'c': 3 }; + * const object = { 'a': 1, 'b': '2', 'c': 3 } * - * pick(object, ['a', 'c']); + * pick(object, ['a', 'c']) * // => { 'a': 1, 'c': 3 } */ function pick(object, ...paths) { - return object == null ? {} : basePick(object, paths); + return object == null ? {} : basePick(object, paths) } -export default pick; +export default pick diff --git a/pickBy.js b/pickBy.js index 0c213f05f6..b3f807cc6f 100644 --- a/pickBy.js +++ b/pickBy.js @@ -1,6 +1,6 @@ -import arrayMap from './.internal/arrayMap.js'; -import basePickBy from './.internal/basePickBy.js'; -import getAllKeysIn from './.internal/getAllKeysIn.js'; +import arrayMap from './.internal/arrayMap.js' +import basePickBy from './.internal/basePickBy.js' +import getAllKeysIn from './.internal/getAllKeysIn.js' /** * Creates an object composed of the `object` properties `predicate` returns @@ -13,17 +13,17 @@ import getAllKeysIn from './.internal/getAllKeysIn.js'; * @returns {Object} Returns the new object. * @example * - * const object = { 'a': 1, 'b': '2', 'c': 3 }; + * const object = { 'a': 1, 'b': '2', 'c': 3 } * - * pickBy(object, isNumber); + * pickBy(object, isNumber) * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { if (object == null) { - return {}; + return {} } - const props = arrayMap(getAllKeysIn(object), prop => [prop]); - return basePickBy(object, props, (value, path) => predicate(value, path[0])); + const props = arrayMap(getAllKeysIn(object), prop => [prop]) + return basePickBy(object, props, (value, path) => predicate(value, path[0])) } -export default pickBy; +export default pickBy diff --git a/property.js b/property.js index ae80f201d0..20520c32a9 100644 --- a/property.js +++ b/property.js @@ -1,7 +1,7 @@ -import baseProperty from './.internal/baseProperty.js'; -import basePropertyDeep from './.internal/basePropertyDeep.js'; -import isKey from './.internal/isKey.js'; -import toKey from './.internal/toKey.js'; +import baseProperty from './.internal/baseProperty.js' +import basePropertyDeep from './.internal/basePropertyDeep.js' +import isKey from './.internal/isKey.js' +import toKey from './.internal/toKey.js' /** * Creates a function that returns the value at `path` of a given object. @@ -15,16 +15,16 @@ import toKey from './.internal/toKey.js'; * const objects = [ * { 'a': { 'b': 2 } }, * { 'a': { 'b': 1 } } - * ]; + * ] * - * map(objects, property('a.b')); + * map(objects, property('a.b')) * // => [2, 1] * - * map(sortBy(objects, property(['a', 'b'])), 'a.b'); + * map(sortBy(objects, property(['a', 'b'])), 'a.b') * // => [1, 2] */ function property(path) { - return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path) } -export default property; +export default property diff --git a/propertyOf.js b/propertyOf.js index e9672b58e2..fd8d9b8eae 100644 --- a/propertyOf.js +++ b/propertyOf.js @@ -1,7 +1,7 @@ -import baseGet from './.internal/baseGet.js'; +import baseGet from './.internal/baseGet.js' /** - * The opposite of `property`; this method creates a function that returns + * The opposite of `property`s method creates a function that returns * the value at a given path of `object`. * * @since 3.0.0 @@ -10,17 +10,17 @@ import baseGet from './.internal/baseGet.js'; * @returns {Function} Returns the new accessor function. * @example * - * const array = [0, 1, 2]; - * const object = { 'a': array, 'b': array, 'c': array }; + * const array = [0, 1, 2] + * const object = { 'a': array, 'b': array, 'c': array } * - * map(['a[2]', 'c[0]'], propertyOf(object)); + * map(['a[2]', 'c[0]'], propertyOf(object)) * // => [2, 0] * - * map([['a', '2'], ['c', '0']], propertyOf(object)); + * map([['a', '2'], ['c', '0']], propertyOf(object)) * // => [2, 0] */ function propertyOf(object) { - return path => object == null ? undefined : baseGet(object, path); + return path => object == null ? undefined : baseGet(object, path) } -export default propertyOf; +export default propertyOf diff --git a/pull.js b/pull.js index 8a5a18362e..8c4c3d7d5d 100644 --- a/pull.js +++ b/pull.js @@ -1,4 +1,4 @@ -import pullAll from './pullAll.js'; +import pullAll from './pullAll.js' /** * Removes all given values from `array` using @@ -16,14 +16,14 @@ import pullAll from './pullAll.js'; * @see pullAll, pullAllBy, pullAllWith, pullAt, remove, reject * @example * - * const array = ['a', 'b', 'c', 'a', 'b', 'c']; + * const array = ['a', 'b', 'c', 'a', 'b', 'c'] * - * pull(array, 'a', 'c'); - * console.log(array); + * pull(array, 'a', 'c') + * console.log(array) * // => ['b', 'b'] */ function pull(array, ...values) { - return pullAll(array, values); + return pullAll(array, values) } -export default pull; +export default pull diff --git a/pullAll.js b/pullAll.js index 9a28c17584..9dcb4da7a1 100644 --- a/pullAll.js +++ b/pullAll.js @@ -1,4 +1,4 @@ -import basePullAll from './.internal/basePullAll.js'; +import basePullAll from './.internal/basePullAll.js' /** * This method is like `pull` except that it accepts an array of values to remove. @@ -13,16 +13,16 @@ import basePullAll from './.internal/basePullAll.js'; * @see pull, pullAllBy, pullAllWith, pullAt, remove, reject * @example * - * const array = ['a', 'b', 'c', 'a', 'b', 'c']; + * const array = ['a', 'b', 'c', 'a', 'b', 'c'] * - * pullAll(array, ['a', 'c']); - * console.log(array); + * pullAll(array, ['a', 'c']) + * console.log(array) * // => ['b', 'b'] */ function pullAll(array, values) { return (array && array.length && values && values.length) ? basePullAll(array, values) - : array; + : array } -export default pullAll; +export default pullAll diff --git a/pullAllBy.js b/pullAllBy.js index ad03ffa3f2..09b98ecdbd 100644 --- a/pullAllBy.js +++ b/pullAllBy.js @@ -1,4 +1,4 @@ -import basePullAll from './.internal/basePullAll.js'; +import basePullAll from './.internal/basePullAll.js' /** * This method is like `pullAll` except that it accepts `iteratee` which is @@ -16,16 +16,16 @@ import basePullAll from './.internal/basePullAll.js'; * @see pull, pullAll, pullAllWith, pullAt, remove, reject * @example * - * const array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * const array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }] * - * pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); + * pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x') + * console.log(array) * // => [{ 'x': 2 }] */ function pullAllBy(array, values, iteratee) { return (array && array.length && values && values.length) ? basePullAll(array, values, iteratee) - : array; + : array } -export default pullAllBy; +export default pullAllBy diff --git a/pullAllWith.js b/pullAllWith.js index 682b576807..c8e426901d 100644 --- a/pullAllWith.js +++ b/pullAllWith.js @@ -1,4 +1,4 @@ -import basePullAll from './.internal/basePullAll.js'; +import basePullAll from './.internal/basePullAll.js' /** * This method is like `pullAll` except that it accepts `comparator` which @@ -16,16 +16,16 @@ import basePullAll from './.internal/basePullAll.js'; * @see pull, pullAll, pullAllBy, pullAt, remove, reject * @example * - * const array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * const array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }] * - * pullAllWith(array, [{ 'x': 3, 'y': 4 }], isEqual); - * console.log(array); + * pullAllWith(array, [{ 'x': 3, 'y': 4 }], isEqual) + * console.log(array) * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] */ function pullAllWith(array, values, comparator) { return (array && array.length && values && values.length) ? basePullAll(array, values, undefined, comparator) - : array; + : array } -export default pullAllWith; +export default pullAllWith diff --git a/pullAt.js b/pullAt.js index bb7e0661af..0d25dcb325 100644 --- a/pullAt.js +++ b/pullAt.js @@ -1,8 +1,8 @@ -import arrayMap from './.internal/arrayMap.js'; -import baseAt from './.internal/baseAt.js'; -import basePullAt from './.internal/basePullAt.js'; -import compareAscending from './.internal/compareAscending.js'; -import isIndex from './.internal/isIndex.js'; +import arrayMap from './.internal/arrayMap.js' +import baseAt from './.internal/baseAt.js' +import basePullAt from './.internal/basePullAt.js' +import compareAscending from './.internal/compareAscending.js' +import isIndex from './.internal/isIndex.js' /** * Removes elements from `array` corresponding to `indexes` and returns an @@ -18,21 +18,21 @@ import isIndex from './.internal/isIndex.js'; * @see pull, pullAll, pullAllBy, pullAllWith, remove, reject * @example * - * const array = ['a', 'b', 'c', 'd']; - * const pulled = pullAt(array, [1, 3]); + * const array = ['a', 'b', 'c', 'd'] + * const pulled = pullAt(array, [1, 3]) * - * console.log(array); + * console.log(array) * // => ['a', 'c'] * - * console.log(pulled); + * console.log(pulled) * // => ['b', 'd'] */ function pullAt(array, ...indexes) { - const length = array == null ? 0 : array.length; - const result = baseAt(array, indexes); + const length = array == null ? 0 : array.length + const result = baseAt(array, indexes) - basePullAt(array, arrayMap(indexes, index => isIndex(index, length) ? +index : index).sort(compareAscending)); - return result; + basePullAt(array, arrayMap(indexes, index => isIndex(index, length) ? +index : index).sort(compareAscending)) + return result } -export default pullAt; +export default pullAt diff --git a/random.js b/random.js index 4039467602..d53078d3f7 100644 --- a/random.js +++ b/random.js @@ -1,13 +1,13 @@ -import baseRandom from './.internal/baseRandom.js'; -import isIterateeCall from './.internal/isIterateeCall.js'; -import toFinite from './toFinite.js'; +import baseRandom from './.internal/baseRandom.js' +import isIterateeCall from './.internal/isIterateeCall.js' +import toFinite from './toFinite.js' /** Built-in method references without a dependency on `root`. */ -const freeParseFloat = parseFloat; +const freeParseFloat = parseFloat /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeMin = Math.min; -const nativeRandom = Math.random; +const nativeMin = Math.min +const nativeRandom = Math.random /** * Produces a random number between the inclusive `lower` and `upper` bounds. @@ -27,55 +27,55 @@ const nativeRandom = Math.random; * @see uniqueId * @example * - * random(0, 5); + * random(0, 5) * // => an integer between 0 and 5 * - * random(5); + * random(5) * // => also an integer between 0 and 5 * - * random(5, true); + * random(5, true) * // => a floating-point number between 0 and 5 * - * random(1.2, 5.2); + * random(1.2, 5.2) * // => a floating-point number between 1.2 and 5.2 */ function random(lower, upper, floating) { if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { - upper = floating = undefined; + upper = floating = undefined } if (floating === undefined) { if (typeof upper == 'boolean') { - floating = upper; - upper = undefined; + floating = upper + upper = undefined } else if (typeof lower == 'boolean') { - floating = lower; - lower = undefined; + floating = lower + lower = undefined } } if (lower === undefined && upper === undefined) { - lower = 0; - upper = 1; + lower = 0 + upper = 1 } else { - lower = toFinite(lower); + lower = toFinite(lower) if (upper === undefined) { - upper = lower; - lower = 0; + upper = lower + lower = 0 } else { - upper = toFinite(upper); + upper = toFinite(upper) } } if (lower > upper) { - const temp = lower; - lower = upper; - upper = temp; + const temp = lower + lower = upper + upper = temp } if (floating || lower % 1 || upper % 1) { - const rand = nativeRandom(); - return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + const rand = nativeRandom() + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper) } - return baseRandom(lower, upper); + return baseRandom(lower, upper) } -export default random; +export default random diff --git a/range.js b/range.js index 5b26cc4111..351163bc41 100644 --- a/range.js +++ b/range.js @@ -1,4 +1,4 @@ -import createRange from './.internal/createRange.js'; +import createRange from './.internal/createRange.js' /** * Creates an array of numbers (positive and/or negative) progressing from @@ -18,27 +18,27 @@ import createRange from './.internal/createRange.js'; * @see inRange, rangeRight * @example * - * range(4); + * range(4) * // => [0, 1, 2, 3] * - * range(-4); + * range(-4) * // => [0, -1, -2, -3] * - * range(1, 5); + * range(1, 5) * // => [1, 2, 3, 4] * - * range(0, 20, 5); + * range(0, 20, 5) * // => [0, 5, 10, 15] * - * range(0, -4, -1); + * range(0, -4, -1) * // => [0, -1, -2, -3] * - * range(1, 4, 0); + * range(1, 4, 0) * // => [1, 1, 1] * - * range(0); + * range(0) * // => [] */ -const range = createRange(); +const range = createRange() -export default range; +export default range diff --git a/rangeRight.js b/rangeRight.js index 8c4ac80fa8..139f14c434 100644 --- a/rangeRight.js +++ b/rangeRight.js @@ -1,4 +1,4 @@ -import createRange from './.internal/createRange.js'; +import createRange from './.internal/createRange.js' /** * This method is like `range` except that it populates values in @@ -13,27 +13,27 @@ import createRange from './.internal/createRange.js'; * @see inRange, range * @example * - * rangeRight(4); + * rangeRight(4) * // => [3, 2, 1, 0] * - * rangeRight(-4); + * rangeRight(-4) * // => [-3, -2, -1, 0] * - * rangeRight(1, 5); + * rangeRight(1, 5) * // => [4, 3, 2, 1] * - * rangeRight(0, 20, 5); + * rangeRight(0, 20, 5) * // => [15, 10, 5, 0] * - * rangeRight(0, -4, -1); + * rangeRight(0, -4, -1) * // => [-3, -2, -1, 0] * - * rangeRight(1, 4, 0); + * rangeRight(1, 4, 0) * // => [1, 1, 1] * - * rangeRight(0); + * rangeRight(0) * // => [] */ -const rangeRight = createRange(true); +const rangeRight = createRange(true) -export default rangeRight; +export default rangeRight diff --git a/rearg.js b/rearg.js index 1ceaa8a892..1f507cd134 100644 --- a/rearg.js +++ b/rearg.js @@ -1,7 +1,7 @@ -import createWrap from './.internal/createWrap.js'; +import createWrap from './.internal/createWrap.js' /** Used to compose bitmasks for function metadata. */ -const WRAP_REARG_FLAG = 256; +const WRAP_REARG_FLAG = 256 /** * Creates a function that invokes `func` with arguments arranged according @@ -16,13 +16,13 @@ const WRAP_REARG_FLAG = 256; * @returns {Function} Returns the new function. * @example * - * const rearged = rearg((a, b, c) => [a, b, c], [2, 0, 1]); + * const rearged = rearg((a, b, c) => [a, b, c], [2, 0, 1]) * - * rearged('b', 'c', 'a'); + * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] */ function rearg(func, ...indexes) { - return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes) } -export default rearg; +export default rearg diff --git a/reduce.js b/reduce.js index 11ae3d544a..0ad5dfe86b 100644 --- a/reduce.js +++ b/reduce.js @@ -1,6 +1,6 @@ -import arrayReduce from './.internal/arrayReduce.js'; -import baseEach from './.internal/baseEach.js'; -import baseReduce from './.internal/baseReduce.js'; +import arrayReduce from './.internal/arrayReduce.js' +import baseEach from './.internal/baseEach.js' +import baseReduce from './.internal/baseReduce.js' /** * Reduces `collection` to a value which is the accumulated result of running @@ -26,19 +26,19 @@ import baseReduce from './.internal/baseReduce.js'; * @see reduceRight, transform * @example * - * reduce([1, 2], (sum, n) => sum + n, 0); + * reduce([1, 2], (sum, n) => sum + n, 0) * // => 3 * * reduce({ 'a': 1, 'b': 2, 'c': 1 }, (result, value, key) => { - * (result[value] || (result[value] = [])).push(key); - * return result; - * }, {}); + * (result[value] || (result[value] = [])).push(key) + * return result + * }, {}) * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) */ function reduce(collection, iteratee, accumulator) { - const func = Array.isArray(collection) ? arrayReduce : baseReduce; - const initAccum = arguments.length < 3; - return func(collection, iteratee, accumulator, initAccum, baseEach); + const func = Array.isArray(collection) ? arrayReduce : baseReduce + const initAccum = arguments.length < 3 + return func(collection, iteratee, accumulator, initAccum, baseEach) } -export default reduce; +export default reduce diff --git a/reduceRight.js b/reduceRight.js index e9d833b085..810c96dae5 100644 --- a/reduceRight.js +++ b/reduceRight.js @@ -1,6 +1,6 @@ -import arrayReduceRight from './.internal/arrayReduceRight.js'; -import baseEachRight from './.internal/baseEachRight.js'; -import baseReduce from './.internal/baseReduce.js'; +import arrayReduceRight from './.internal/arrayReduceRight.js' +import baseEachRight from './.internal/baseEachRight.js' +import baseReduce from './.internal/baseReduce.js' /** * This method is like `reduce` except that it iterates over elements of @@ -15,15 +15,15 @@ import baseReduce from './.internal/baseReduce.js'; * @see reduce * @example * - * const array = [[0, 1], [2, 3], [4, 5]]; + * const array = [[0, 1], [2, 3], [4, 5]] * - * reduceRight(array, (flattened, other) => flattened.concat(other), []); + * reduceRight(array, (flattened, other) => flattened.concat(other), []) * // => [4, 5, 2, 3, 0, 1] */ function reduceRight(collection, iteratee, accumulator) { - const func = Array.isArray(collection) ? arrayReduceRight : baseReduce; - const initAccum = arguments.length < 3; - return func(collection, iteratee, accumulator, initAccum, baseEachRight); + const func = Array.isArray(collection) ? arrayReduceRight : baseReduce + const initAccum = arguments.length < 3 + return func(collection, iteratee, accumulator, initAccum, baseEachRight) } -export default reduceRight; +export default reduceRight diff --git a/reject.js b/reject.js index af84b6a924..96024fadf4 100644 --- a/reject.js +++ b/reject.js @@ -1,9 +1,9 @@ -import arrayFilter from './.internal/arrayFilter.js'; -import baseFilter from './.internal/baseFilter.js'; -import negate from './negate.js'; +import arrayFilter from './.internal/arrayFilter.js' +import baseFilter from './.internal/baseFilter.js' +import negate from './negate.js' /** - * The opposite of `filter`; this method returns the elements of `collection` + * The opposite of `filter` this method returns the elements of `collection` * that `predicate` does **not** return truthy for. * * @since 0.1.0 @@ -17,14 +17,14 @@ import negate from './negate.js'; * const users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false } - * ]; + * ] * - * reject(users, ({ active }) => active); + * reject(users, ({ active }) => active) * // => objects for ['fred'] */ function reject(collection, predicate) { - const func = Array.isArray(collection) ? arrayFilter : baseFilter; - return func(collection, negate(predicate)); + const func = Array.isArray(collection) ? arrayFilter : baseFilter + return func(collection, negate(predicate)) } -export default reject; +export default reject diff --git a/remove.js b/remove.js index a213103041..91d8ab3fd3 100644 --- a/remove.js +++ b/remove.js @@ -1,4 +1,4 @@ -import basePullAt from './.internal/basePullAt.js'; +import basePullAt from './.internal/basePullAt.js' /** * Removes all elements from `array` that `predicate` returns truthy for @@ -16,33 +16,33 @@ import basePullAt from './.internal/basePullAt.js'; * @see pull, pullAll, pullAllBy, pullAllWith, pullAt, reject, filter * @example * - * const array = [1, 2, 3, 4]; - * const evens = remove(array, n => n % 2 == 0); + * const array = [1, 2, 3, 4] + * const evens = remove(array, n => n % 2 == 0) * - * console.log(array); + * console.log(array) * // => [1, 3] * - * console.log(evens); + * console.log(evens) * // => [2, 4] */ function remove(array, predicate) { - const result = []; + const result = [] if (!(array && array.length)) { - return result; + return result } - let index = -1; - const indexes = []; - const length = array.length; + let index = -1 + const indexes = [] + const length = array.length while (++index < length) { - const value = array[index]; + const value = array[index] if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); + result.push(value) + indexes.push(index) } } - basePullAt(array, indexes); - return result; + basePullAt(array, indexes) + return result } -export default remove; +export default remove diff --git a/repeat.js b/repeat.js index c39d3ec645..856edaed0d 100644 --- a/repeat.js +++ b/repeat.js @@ -1,7 +1,7 @@ -import baseRepeat from './.internal/baseRepeat.js'; -import isIterateeCall from './.internal/isIterateeCall.js'; -import toInteger from './toInteger.js'; -import toString from './toString.js'; +import baseRepeat from './.internal/baseRepeat.js' +import isIterateeCall from './.internal/isIterateeCall.js' +import toInteger from './toInteger.js' +import toString from './toString.js' /** * Repeats the given string `n` times. @@ -14,22 +14,22 @@ import toString from './toString.js'; * @returns {string} Returns the repeated string. * @example * - * repeat('*', 3); + * repeat('*', 3) * // => '***' * - * repeat('abc', 2); + * repeat('abc', 2) * // => 'abcabc' * - * repeat('abc', 0); + * repeat('abc', 0) * // => '' */ function repeat(string, n, guard) { if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { - n = 1; + n = 1 } else { - n = toInteger(n); + n = toInteger(n) } - return baseRepeat(toString(string), n); + return baseRepeat(toString(string), n) } -export default repeat; +export default repeat diff --git a/replace.js b/replace.js index fc062aa5e4..f87b713dee 100644 --- a/replace.js +++ b/replace.js @@ -1,4 +1,4 @@ -import toString from './toString.js'; +import toString from './toString.js' /** * Replaces matches for `pattern` in `string` with `replacement`. @@ -15,14 +15,14 @@ import toString from './toString.js'; * @see truncate, trim * @example * - * replace('Hi Fred', 'Fred', 'Barney'); + * replace('Hi Fred', 'Fred', 'Barney') * // => 'Hi Barney' */ function replace() { - const args = arguments; - const string = toString(args[0]); + const args = arguments + const string = toString(args[0]) - return args.length < 3 ? string : string.replace(args[1], args[2]); + return args.length < 3 ? string : string.replace(args[1], args[2]) } -export default replace; +export default replace diff --git a/result.js b/result.js index a41fcad03b..0f5c2ee6c0 100644 --- a/result.js +++ b/result.js @@ -1,6 +1,6 @@ -import castPath from './.internal/castPath.js'; -import isFunction from './isFunction.js'; -import toKey from './.internal/toKey.js'; +import castPath from './.internal/castPath.js' +import isFunction from './isFunction.js' +import toKey from './.internal/toKey.js' /** * This method is like `get` except that if the resolved value is a @@ -15,40 +15,40 @@ import toKey from './.internal/toKey.js'; * @returns {*} Returns the resolved value. * @example * - * const object = { 'a': [{ 'b': { 'c1': 3, 'c2': constant(4) } }] }; + * const object = { 'a': [{ 'b': { 'c1': 3, 'c2': constant(4) } }] } * - * result(object, 'a[0].b.c1'); + * result(object, 'a[0].b.c1') * // => 3 * - * result(object, 'a[0].b.c2'); + * result(object, 'a[0].b.c2') * // => 4 * - * result(object, 'a[0].b.c3', 'default'); + * result(object, 'a[0].b.c3', 'default') * // => 'default' * - * result(object, 'a[0].b.c3', constant('default')); + * result(object, 'a[0].b.c3', constant('default')) * // => 'default' */ function result(object, path, defaultValue) { - path = castPath(path, object); + path = castPath(path, object) - let index = -1; - let length = path.length; + let index = -1 + let length = path.length // Ensure the loop is entered when path is empty. if (!length) { - length = 1; - object = undefined; + length = 1 + object = undefined } while (++index < length) { - let value = object == null ? undefined : object[toKey(path[index])]; + let value = object == null ? undefined : object[toKey(path[index])] if (value === undefined) { - index = length; - value = defaultValue; + index = length + value = defaultValue } - object = isFunction(value) ? value.call(object) : value; + object = isFunction(value) ? value.call(object) : value } - return object; + return object } -export default result; +export default result diff --git a/reverse.js b/reverse.js index 43779d2262..f49c83bd80 100644 --- a/reverse.js +++ b/reverse.js @@ -1,5 +1,5 @@ /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeReverse = Array.prototype.reverse; +const nativeReverse = Array.prototype.reverse /** * Reverses `array` so that the first element becomes the last, the second @@ -15,16 +15,16 @@ const nativeReverse = Array.prototype.reverse; * @see flip, sortBy * @example * - * const array = [1, 2, 3]; + * const array = [1, 2, 3] * - * reverse(array); + * reverse(array) * // => [3, 2, 1] * - * console.log(array); + * console.log(array) * // => [3, 2, 1] */ function reverse(array) { - return array == null ? array : nativeReverse.call(array); + return array == null ? array : nativeReverse.call(array) } -export default reverse; +export default reverse diff --git a/round.js b/round.js index 3f6dc113d3..b8be056216 100644 --- a/round.js +++ b/round.js @@ -1,4 +1,4 @@ -import createRound from './.internal/createRound.js'; +import createRound from './.internal/createRound.js' /** * Computes `number` rounded to `precision`. @@ -10,15 +10,15 @@ import createRound from './.internal/createRound.js'; * @returns {number} Returns the rounded number. * @example * - * round(4.006); + * round(4.006) * // => 4 * - * round(4.006, 2); + * round(4.006, 2) * // => 4.01 * - * round(4060, -2); + * round(4060, -2) * // => 4100 */ -const round = createRound('round'); +const round = createRound('round') -export default round; +export default round diff --git a/sample.js b/sample.js index 753f226f00..0e3b6e6c0f 100644 --- a/sample.js +++ b/sample.js @@ -1,5 +1,5 @@ -import arraySample from './.internal/arraySample.js'; -import baseSample from './.internal/baseSample.js'; +import arraySample from './.internal/arraySample.js' +import baseSample from './.internal/baseSample.js' /** * Gets a random element from `collection`. @@ -10,12 +10,12 @@ import baseSample from './.internal/baseSample.js'; * @returns {*} Returns the random element. * @example * - * sample([1, 2, 3, 4]); + * sample([1, 2, 3, 4]) * // => 2 */ function sample(collection) { - const func = Array.isArray(collection) ? arraySample : baseSample; - return func(collection); + const func = Array.isArray(collection) ? arraySample : baseSample + return func(collection) } -export default sample; +export default sample diff --git a/sampleSize.js b/sampleSize.js index 0344336416..f92badb960 100644 --- a/sampleSize.js +++ b/sampleSize.js @@ -1,7 +1,7 @@ -import arraySampleSize from './.internal/arraySampleSize.js'; -import baseSampleSize from './.internal/baseSampleSize.js'; -import isIterateeCall from './.internal/isIterateeCall.js'; -import toInteger from './toInteger.js'; +import arraySampleSize from './.internal/arraySampleSize.js' +import baseSampleSize from './.internal/baseSampleSize.js' +import isIterateeCall from './.internal/isIterateeCall.js' +import toInteger from './toInteger.js' /** * Gets `n` random elements at unique keys from `collection` up to the @@ -15,20 +15,20 @@ import toInteger from './toInteger.js'; * @returns {Array} Returns the random elements. * @example * - * sampleSize([1, 2, 3], 2); + * sampleSize([1, 2, 3], 2) * // => [3, 1] * - * sampleSize([1, 2, 3], 4); + * sampleSize([1, 2, 3], 4) * // => [2, 3, 1] */ function sampleSize(collection, n, guard) { if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { - n = 1; + n = 1 } else { - n = toInteger(n); + n = toInteger(n) } - const func = Array.isArray(collection) ? arraySampleSize : baseSampleSize; - return func(collection, n); + const func = Array.isArray(collection) ? arraySampleSize : baseSampleSize + return func(collection, n) } -export default sampleSize; +export default sampleSize diff --git a/set.js b/set.js index 1753a853aa..3004ec5b95 100644 --- a/set.js +++ b/set.js @@ -1,4 +1,4 @@ -import baseSet from './.internal/baseSet.js'; +import baseSet from './.internal/baseSet.js' /** * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, @@ -17,18 +17,18 @@ import baseSet from './.internal/baseSet.js'; * @see has, hasIn, get, unset * @example * - * const object = { 'a': [{ 'b': { 'c': 3 } }] }; + * const object = { 'a': [{ 'b': { 'c': 3 } }] } * - * set(object, 'a[0].b.c', 4); - * console.log(object.a[0].b.c); + * set(object, 'a[0].b.c', 4) + * console.log(object.a[0].b.c) * // => 4 * - * set(object, ['x', '0', 'y', 'z'], 5); - * console.log(object.x[0].y.z); + * set(object, ['x', '0', 'y', 'z'], 5) + * console.log(object.x[0].y.z) * // => 5 */ function set(object, path, value) { - return object == null ? object : baseSet(object, path, value); + return object == null ? object : baseSet(object, path, value) } -export default set; +export default set diff --git a/setWith.js b/setWith.js index a19d9c5dda..80ae1a3aab 100644 --- a/setWith.js +++ b/setWith.js @@ -1,4 +1,4 @@ -import baseSet from './.internal/baseSet.js'; +import baseSet from './.internal/baseSet.js' /** * This method is like `set` except that it accepts `customizer` which is @@ -17,14 +17,14 @@ import baseSet from './.internal/baseSet.js'; * @returns {Object} Returns `object`. * @example * - * const object = {}; + * const object = {} * - * setWith(object, '[0][1]', 'a', Object); + * setWith(object, '[0][1]', 'a', Object) * // => { '0': { '1': 'a' } } */ function setWith(object, path, value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseSet(object, path, value, customizer); + customizer = typeof customizer == 'function' ? customizer : undefined + return object == null ? object : baseSet(object, path, value, customizer) } -export default setWith; +export default setWith diff --git a/shuffle.js b/shuffle.js index 9d571f4d5f..ad5f627c88 100644 --- a/shuffle.js +++ b/shuffle.js @@ -1,5 +1,5 @@ -import arrayShuffle from './.internal/arrayShuffle.js'; -import baseShuffle from './.internal/baseShuffle.js'; +import arrayShuffle from './.internal/arrayShuffle.js' +import baseShuffle from './.internal/baseShuffle.js' /** * Creates an array of shuffled values, using a version of the @@ -11,12 +11,12 @@ import baseShuffle from './.internal/baseShuffle.js'; * @returns {Array} Returns the new shuffled array. * @example * - * shuffle([1, 2, 3, 4]); + * shuffle([1, 2, 3, 4]) * // => [4, 1, 3, 2] */ function shuffle(collection) { - const func = Array.isArray(collection) ? arrayShuffle : baseShuffle; - return func(collection); + const func = Array.isArray(collection) ? arrayShuffle : baseShuffle + return func(collection) } -export default shuffle; +export default shuffle diff --git a/size.js b/size.js index abeca84328..5b2c40ef46 100644 --- a/size.js +++ b/size.js @@ -1,12 +1,12 @@ -import baseKeys from './.internal/baseKeys.js'; -import getTag from './.internal/getTag.js'; -import isArrayLike from './isArrayLike.js'; -import isString from './isString.js'; -import stringSize from './.internal/stringSize.js'; +import baseKeys from './.internal/baseKeys.js' +import getTag from './.internal/getTag.js' +import isArrayLike from './isArrayLike.js' +import isString from './isString.js' +import stringSize from './.internal/stringSize.js' /** `Object#toString` result references. */ -const mapTag = '[object Map]'; -const setTag = '[object Set]'; +const mapTag = '[object Map]' +const setTag = '[object Set]' /** * Gets the size of `collection` by returning its length for array-like @@ -18,27 +18,27 @@ const setTag = '[object Set]'; * @returns {number} Returns the collection size. * @example * - * size([1, 2, 3]); + * size([1, 2, 3]) * // => 3 * - * size({ 'a': 1, 'b': 2 }); + * size({ 'a': 1, 'b': 2 }) * // => 2 * - * size('pebbles'); + * size('pebbles') * // => 7 */ function size(collection) { if (collection == null) { - return 0; + return 0 } if (isArrayLike(collection)) { - return isString(collection) ? stringSize(collection) : collection.length; + return isString(collection) ? stringSize(collection) : collection.length } - const tag = getTag(collection); + const tag = getTag(collection) if (tag == mapTag || tag == setTag) { - return collection.size; + return collection.size } - return baseKeys(collection).length; + return baseKeys(collection).length } -export default size; +export default size diff --git a/slice.js b/slice.js index a691733f70..378bdb781b 100644 --- a/slice.js +++ b/slice.js @@ -1,6 +1,6 @@ -import baseSlice from './.internal/baseSlice.js'; -import isIterateeCall from './.internal/isIterateeCall.js'; -import toInteger from './toInteger.js'; +import baseSlice from './.internal/baseSlice.js' +import isIterateeCall from './.internal/isIterateeCall.js' +import toInteger from './toInteger.js' /** * Creates a slice of `array` from `start` up to, but not including, `end`. @@ -17,19 +17,19 @@ import toInteger from './toInteger.js'; * @returns {Array} Returns the slice of `array`. */ function slice(array, start, end) { - const length = array == null ? 0 : array.length; + const length = array == null ? 0 : array.length if (!length) { - return []; + return [] } if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; + start = 0 + end = length } else { - start = start == null ? 0 : toInteger(start); - end = end === undefined ? length : toInteger(end); + start = start == null ? 0 : toInteger(start) + end = end === undefined ? length : toInteger(end) } - return baseSlice(array, start, end); + return baseSlice(array, start, end) } -export default slice; +export default slice diff --git a/snakeCase.js b/snakeCase.js index f3127b55e3..7a4cc26675 100644 --- a/snakeCase.js +++ b/snakeCase.js @@ -1,4 +1,4 @@ -import createCompounder from './.internal/createCompounder.js'; +import createCompounder from './.internal/createCompounder.js' /** * Converts `string` to @@ -11,17 +11,17 @@ import createCompounder from './.internal/createCompounder.js'; * @see camelCase, lowerCase, kebabCase, startCase, upperCase, upperFirst * @example * - * snakeCase('Foo Bar'); + * snakeCase('Foo Bar') * // => 'foo_bar' * - * snakeCase('fooBar'); + * snakeCase('fooBar') * // => 'foo_bar' * - * snakeCase('--FOO-BAR--'); + * snakeCase('--FOO-BAR--') * // => 'foo_bar' */ const snakeCase = createCompounder((result, word, index) => result + (index ? '_' : '') + word.toLowerCase() -); +) -export default snakeCase; +export default snakeCase diff --git a/some.js b/some.js index b8af1f8ce4..3992094857 100644 --- a/some.js +++ b/some.js @@ -1,6 +1,6 @@ -import arraySome from './.internal/arraySome.js'; -import baseSome from './.internal/baseSome.js'; -import isIterateeCall from './.internal/isIterateeCall.js'; +import arraySome from './.internal/arraySome.js' +import baseSome from './.internal/baseSome.js' +import isIterateeCall from './.internal/isIterateeCall.js' /** * Checks if `predicate` returns truthy for **any** element of `collection`. @@ -16,15 +16,15 @@ import isIterateeCall from './.internal/isIterateeCall.js'; * else `false`. * @example * - * some([null, 0, 'yes', false], Boolean); + * some([null, 0, 'yes', false], Boolean) * // => true */ function some(collection, predicate, guard) { - const func = Array.isArray(collection) ? arraySome : baseSome; + const func = Array.isArray(collection) ? arraySome : baseSome if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; + predicate = undefined } - return func(collection, predicate); + return func(collection, predicate) } -export default some; +export default some diff --git a/sortedIndex.js b/sortedIndex.js index a460f14949..fa84fe9b7c 100644 --- a/sortedIndex.js +++ b/sortedIndex.js @@ -1,4 +1,4 @@ -import baseSortedIndex from './.internal/baseSortedIndex.js'; +import baseSortedIndex from './.internal/baseSortedIndex.js' /** * Uses a binary search to determine the lowest index at which `value` @@ -12,11 +12,11 @@ import baseSortedIndex from './.internal/baseSortedIndex.js'; * into `array`. * @example * - * sortedIndex([30, 50], 40); + * sortedIndex([30, 50], 40) * // => 1 */ function sortedIndex(array, value) { - return baseSortedIndex(array, value); + return baseSortedIndex(array, value) } -export default sortedIndex; +export default sortedIndex diff --git a/sortedIndexBy.js b/sortedIndexBy.js index de914f543a..61c1c6fae6 100644 --- a/sortedIndexBy.js +++ b/sortedIndexBy.js @@ -1,4 +1,4 @@ -import baseSortedIndexBy from './.internal/baseSortedIndexBy.js'; +import baseSortedIndexBy from './.internal/baseSortedIndexBy.js' /** * This method is like `sortedIndex` except that it accepts `iteratee` @@ -14,13 +14,13 @@ import baseSortedIndexBy from './.internal/baseSortedIndexBy.js'; * into `array`. * @example * - * const objects = [{ 'n': 4 }, { 'n': 5 }]; + * const objects = [{ 'n': 4 }, { 'n': 5 }] * - * sortedIndexBy(objects, { 'n': 4 }, ({ n }) => n); + * sortedIndexBy(objects, { 'n': 4 }, ({ n }) => n) * // => 0 */ function sortedIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, iteratee); + return baseSortedIndexBy(array, value, iteratee) } -export default sortedIndexBy; +export default sortedIndexBy diff --git a/sortedIndexOf.js b/sortedIndexOf.js index fe85a104ac..d30324091f 100644 --- a/sortedIndexOf.js +++ b/sortedIndexOf.js @@ -1,5 +1,5 @@ -import baseSortedIndex from './.internal/baseSortedIndex.js'; -import eq from './eq.js'; +import baseSortedIndex from './.internal/baseSortedIndex.js' +import eq from './eq.js' /** * This method is like `indexOf` except that it performs a binary @@ -12,18 +12,18 @@ import eq from './eq.js'; * @returns {number} Returns the index of the matched value, else `-1`. * @example * - * sortedIndexOf([4, 5, 5, 5, 6], 5); + * sortedIndexOf([4, 5, 5, 5, 6], 5) * // => 1 */ function sortedIndexOf(array, value) { - const length = array == null ? 0 : array.length; + const length = array == null ? 0 : array.length if (length) { - const index = baseSortedIndex(array, value); + const index = baseSortedIndex(array, value) if (index < length && eq(array[index], value)) { - return index; + return index } } - return -1; + return -1 } -export default sortedIndexOf; +export default sortedIndexOf diff --git a/sortedLastIndex.js b/sortedLastIndex.js index eba9ddba5c..aee639fcae 100644 --- a/sortedLastIndex.js +++ b/sortedLastIndex.js @@ -1,4 +1,4 @@ -import baseSortedIndex from './.internal/baseSortedIndex.js'; +import baseSortedIndex from './.internal/baseSortedIndex.js' /** * This method is like `sortedIndex` except that it returns the highest @@ -13,11 +13,11 @@ import baseSortedIndex from './.internal/baseSortedIndex.js'; * into `array`. * @example * - * sortedLastIndex([4, 5, 5, 5, 6], 5); + * sortedLastIndex([4, 5, 5, 5, 6], 5) * // => 4 */ function sortedLastIndex(array, value) { - return baseSortedIndex(array, value, true); + return baseSortedIndex(array, value, true) } -export default sortedLastIndex; +export default sortedLastIndex diff --git a/sortedLastIndexBy.js b/sortedLastIndexBy.js index 519027bd04..a2a14dd063 100644 --- a/sortedLastIndexBy.js +++ b/sortedLastIndexBy.js @@ -1,4 +1,4 @@ -import baseSortedIndexBy from './.internal/baseSortedIndexBy.js'; +import baseSortedIndexBy from './.internal/baseSortedIndexBy.js' /** * This method is like `sortedLastIndex` except that it accepts `iteratee` @@ -14,13 +14,13 @@ import baseSortedIndexBy from './.internal/baseSortedIndexBy.js'; * into `array`. * @example * - * const objects = [{ 'n': 4 }, { 'n': 5 }]; + * const objects = [{ 'n': 4 }, { 'n': 5 }] * - * sortedLastIndexBy(objects, { 'n': 4 }, ({ n }) => n); + * sortedLastIndexBy(objects, { 'n': 4 }, ({ n }) => n) * // => 1 */ function sortedLastIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, iteratee, true); + return baseSortedIndexBy(array, value, iteratee, true) } -export default sortedLastIndexBy; +export default sortedLastIndexBy diff --git a/sortedLastIndexOf.js b/sortedLastIndexOf.js index 8a6e585797..f4d4ea3357 100644 --- a/sortedLastIndexOf.js +++ b/sortedLastIndexOf.js @@ -1,5 +1,5 @@ -import baseSortedIndex from './.internal/baseSortedIndex.js'; -import eq from './eq.js'; +import baseSortedIndex from './.internal/baseSortedIndex.js' +import eq from './eq.js' /** * This method is like `lastIndexOf` except that it performs a binary @@ -12,18 +12,18 @@ import eq from './eq.js'; * @returns {number} Returns the index of the matched value, else `-1`. * @example * - * sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * sortedLastIndexOf([4, 5, 5, 5, 6], 5) * // => 3 */ function sortedLastIndexOf(array, value) { - const length = array == null ? 0 : array.length; + const length = array == null ? 0 : array.length if (length) { - const index = baseSortedIndex(array, value, true) - 1; + const index = baseSortedIndex(array, value, true) - 1 if (eq(array[index], value)) { - return index; + return index } } - return -1; + return -1 } -export default sortedLastIndexOf; +export default sortedLastIndexOf diff --git a/sortedUniq.js b/sortedUniq.js index 222fceb1ec..f2a426cfd8 100644 --- a/sortedUniq.js +++ b/sortedUniq.js @@ -1,4 +1,4 @@ -import baseSortedUniq from './.internal/baseSortedUniq.js'; +import baseSortedUniq from './.internal/baseSortedUniq.js' /** * This method is like `uniq` except that it's designed and optimized @@ -10,13 +10,13 @@ import baseSortedUniq from './.internal/baseSortedUniq.js'; * @returns {Array} Returns the new duplicate free array. * @example * - * sortedUniq([1, 1, 2]); + * sortedUniq([1, 1, 2]) * // => [1, 2] */ function sortedUniq(array) { return (array && array.length) ? baseSortedUniq(array) - : []; + : [] } -export default sortedUniq; +export default sortedUniq diff --git a/sortedUniqBy.js b/sortedUniqBy.js index ecb599e088..11684babda 100644 --- a/sortedUniqBy.js +++ b/sortedUniqBy.js @@ -1,4 +1,4 @@ -import baseSortedUniq from './.internal/baseSortedUniq.js'; +import baseSortedUniq from './.internal/baseSortedUniq.js' /** * This method is like `uniqBy` except that it's designed and optimized @@ -11,13 +11,13 @@ import baseSortedUniq from './.internal/baseSortedUniq.js'; * @returns {Array} Returns the new duplicate free array. * @example * - * sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor) * // => [1.1, 2.3] */ function sortedUniqBy(array, iteratee) { return (array && array.length) ? baseSortedUniq(array, iteratee) - : []; + : [] } -export default sortedUniqBy; +export default sortedUniqBy diff --git a/split.js b/split.js index a8bea37fcb..4c8d756ccd 100644 --- a/split.js +++ b/split.js @@ -1,13 +1,13 @@ -import baseToString from './.internal/baseToString.js'; -import castSlice from './.internal/castSlice.js'; -import hasUnicode from './.internal/hasUnicode.js'; -import isIterateeCall from './.internal/isIterateeCall.js'; -import isRegExp from './isRegExp.js'; -import stringToArray from './.internal/stringToArray.js'; -import toString from './toString.js'; +import baseToString from './.internal/baseToString.js' +import castSlice from './.internal/castSlice.js' +import hasUnicode from './.internal/hasUnicode.js' +import isIterateeCall from './.internal/isIterateeCall.js' +import isRegExp from './isRegExp.js' +import stringToArray from './.internal/stringToArray.js' +import toString from './toString.js' /** Used as references for the maximum length and index of an array. */ -const MAX_ARRAY_LENGTH = 4294967295; +const MAX_ARRAY_LENGTH = 4294967295 /** * Splits `string` by `separator`. @@ -23,28 +23,28 @@ const MAX_ARRAY_LENGTH = 4294967295; * @returns {Array} Returns the string segments. * @example * - * split('a-b-c', '-', 2); + * split('a-b-c', '-', 2) * // => ['a', 'b'] */ function split(string, separator, limit) { if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { - separator = limit = undefined; + separator = limit = undefined } - limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0 if (!limit) { - return []; + return [] } - string = toString(string); + string = toString(string) if (string && ( typeof separator == 'string' || (separator != null && !isRegExp(separator)) )) { - separator = baseToString(separator); + separator = baseToString(separator) if (!separator && hasUnicode(string)) { - return castSlice(stringToArray(string), 0, limit); + return castSlice(stringToArray(string), 0, limit) } } - return string.split(separator, limit); + return string.split(separator, limit) } -export default split; +export default split diff --git a/spread.js b/spread.js index 0a80af3ee4..eba9fb982d 100644 --- a/spread.js +++ b/spread.js @@ -1,10 +1,10 @@ -import apply from './.internal/apply.js'; -import arrayPush from './.internal/arrayPush.js'; -import castSlice from './.internal/castSlice.js'; -import toInteger from './toInteger.js'; +import apply from './.internal/apply.js' +import arrayPush from './.internal/arrayPush.js' +import castSlice from './.internal/castSlice.js' +import toInteger from './toInteger.js' /* Built-in method references for those with the same name as other `lodash` methods. */ -const nativeMax = Math.max; +const nativeMax = Math.max /** * Creates a function that invokes `func` with the `this` binding of the @@ -21,33 +21,33 @@ const nativeMax = Math.max; * @returns {Function} Returns the new function. * @example * - * const say = spread((who, what) => `${ who } says ${ what }`); + * const say = spread((who, what) => `${ who } says ${ what }`) * - * say(['fred', 'hello']); + * say(['fred', 'hello']) * // => 'fred says hello' * * const numbers = Promise.all([ * Promise.resolve(40), * Promise.resolve(36) - * ]); + * ]) * - * numbers.then(spread((x, y) => x + y)); + * numbers.then(spread((x, y) => x + y)) * // => a Promise of 76 */ function spread(func, start) { if (typeof func != 'function') { - throw new TypeError('Expected a function'); + throw new TypeError('Expected a function') } - start = start == null ? 0 : nativeMax(toInteger(start), 0); + start = start == null ? 0 : nativeMax(toInteger(start), 0) return (...args) => { - const array = args[start]; - const otherArgs = castSlice(args, 0, start); + const array = args[start] + const otherArgs = castSlice(args, 0, start) if (array) { - arrayPush(otherArgs, array); + arrayPush(otherArgs, array) } - return apply(func, this, otherArgs); - }; + return apply(func, this, otherArgs) + } } -export default spread; +export default spread diff --git a/startCase.js b/startCase.js index 6ecfe263ff..4c6b6e8553 100644 --- a/startCase.js +++ b/startCase.js @@ -1,5 +1,5 @@ -import createCompounder from './.internal/createCompounder.js'; -import upperFirst from './upperFirst.js'; +import createCompounder from './.internal/createCompounder.js' +import upperFirst from './upperFirst.js' /** * Converts `string` to @@ -12,17 +12,17 @@ import upperFirst from './upperFirst.js'; * @see camelCase, lowerCase, kebabCase, snakeCase, upperCase, upperFirst * @example * - * startCase('--foo-bar--'); + * startCase('--foo-bar--') * // => 'Foo Bar' * - * startCase('fooBar'); + * startCase('fooBar') * // => 'Foo Bar' * - * startCase('__FOO_BAR__'); + * startCase('__FOO_BAR__') * // => 'FOO BAR' */ const startCase = createCompounder((result, word, index) => result + (index ? ' ' : '') + upperFirst(word) -); +) -export default startCase; +export default startCase diff --git a/startsWith.js b/startsWith.js index 9df13e1b06..e6f6067e52 100644 --- a/startsWith.js +++ b/startsWith.js @@ -1,7 +1,7 @@ -import baseClamp from './.internal/baseClamp.js'; -import baseToString from './.internal/baseToString.js'; -import toInteger from './toInteger.js'; -import toString from './toString.js'; +import baseClamp from './.internal/baseClamp.js' +import baseToString from './.internal/baseToString.js' +import toInteger from './toInteger.js' +import toString from './toString.js' /** * Checks if `string` starts with the given target string. @@ -16,23 +16,23 @@ import toString from './toString.js'; * @see endsWith, includes * @example * - * startsWith('abc', 'a'); + * startsWith('abc', 'a') * // => true * - * startsWith('abc', 'b'); + * startsWith('abc', 'b') * // => false * - * startsWith('abc', 'b', 1); + * startsWith('abc', 'b', 1) * // => true */ function startsWith(string, target, position) { - string = toString(string); + string = toString(string) position = position == null ? 0 - : baseClamp(toInteger(position), 0, string.length); + : baseClamp(toInteger(position), 0, string.length) - target = baseToString(target); - return string.slice(position, position + target.length) == target; + target = baseToString(target) + return string.slice(position, position + target.length) == target } -export default startsWith; +export default startsWith diff --git a/subtract.js b/subtract.js index 42c84fd67e..bf8ca6dce0 100644 --- a/subtract.js +++ b/subtract.js @@ -1,4 +1,4 @@ -import createMathOperation from './.internal/createMathOperation.js'; +import createMathOperation from './.internal/createMathOperation.js' /** * Subtract two numbers. @@ -10,9 +10,9 @@ import createMathOperation from './.internal/createMathOperation.js'; * @returns {number} Returns the difference. * @example * - * subtract(6, 4); + * subtract(6, 4) * // => 2 */ -const subtract = createMathOperation((minuend, subtrahend) => minuend - subtrahend, 0); +const subtract = createMathOperation((minuend, subtrahend) => minuend - subtrahend, 0) -export default subtract; +export default subtract diff --git a/sum.js b/sum.js index 179f759341..6d3faa3401 100644 --- a/sum.js +++ b/sum.js @@ -1,5 +1,5 @@ -import baseSum from './.internal/baseSum.js'; -import identity from './identity.js'; +import baseSum from './.internal/baseSum.js' +import identity from './identity.js' /** * Computes the sum of the values in `array`. @@ -10,13 +10,13 @@ import identity from './identity.js'; * @returns {number} Returns the sum. * @example * - * sum([4, 2, 8, 6]); + * sum([4, 2, 8, 6]) * // => 20 */ function sum(array) { return (array && array.length) ? baseSum(array, identity) - : 0; + : 0 } -export default sum; +export default sum diff --git a/sumBy.js b/sumBy.js index 596742d637..1f92cf2093 100644 --- a/sumBy.js +++ b/sumBy.js @@ -1,4 +1,4 @@ -import baseSum from './.internal/baseSum.js'; +import baseSum from './.internal/baseSum.js' /** * This method is like `sum` except that it accepts `iteratee` which is @@ -12,15 +12,15 @@ import baseSum from './.internal/baseSum.js'; * @returns {number} Returns the sum. * @example * - * const objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; + * const objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }] * - * sumBy(objects, ({ n }) => n); + * sumBy(objects, ({ n }) => n) * // => 20 */ function sumBy(array, iteratee) { return (array && array.length) ? baseSum(array, iteratee) - : 0; + : 0 } -export default sumBy; +export default sumBy diff --git a/tail.js b/tail.js index ea0954af3d..4a778fb328 100644 --- a/tail.js +++ b/tail.js @@ -1,4 +1,4 @@ -import baseSlice from './.internal/baseSlice.js'; +import baseSlice from './.internal/baseSlice.js' /** * Gets all but the first element of `array`. @@ -9,12 +9,12 @@ import baseSlice from './.internal/baseSlice.js'; * @returns {Array} Returns the slice of `array`. * @example * - * tail([1, 2, 3]); + * tail([1, 2, 3]) * // => [2, 3] */ function tail(array) { - const length = array == null ? 0 : array.length; - return length ? baseSlice(array, 1, length) : []; + const length = array == null ? 0 : array.length + return length ? baseSlice(array, 1, length) : [] } -export default tail; +export default tail diff --git a/take.js b/take.js index ea22d8e625..b9bdc4f839 100644 --- a/take.js +++ b/take.js @@ -1,5 +1,5 @@ -import baseSlice from './.internal/baseSlice.js'; -import toInteger from './toInteger.js'; +import baseSlice from './.internal/baseSlice.js' +import toInteger from './toInteger.js' /** * Creates a slice of `array` with `n` elements taken from the beginning. @@ -12,24 +12,24 @@ import toInteger from './toInteger.js'; * @returns {Array} Returns the slice of `array`. * @example * - * take([1, 2, 3]); + * take([1, 2, 3]) * // => [1] * - * take([1, 2, 3], 2); + * take([1, 2, 3], 2) * // => [1, 2] * - * take([1, 2, 3], 5); + * take([1, 2, 3], 5) * // => [1, 2, 3] * - * take([1, 2, 3], 0); + * take([1, 2, 3], 0) * // => [] */ function take(array, n, guard) { if (!(array && array.length)) { - return []; + return [] } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, 0, n < 0 ? 0 : n); + n = (guard || n === undefined) ? 1 : toInteger(n) + return baseSlice(array, 0, n < 0 ? 0 : n) } -export default take; +export default take diff --git a/takeRight.js b/takeRight.js index aa94179dc0..2b0978f12e 100644 --- a/takeRight.js +++ b/takeRight.js @@ -1,5 +1,5 @@ -import baseSlice from './.internal/baseSlice.js'; -import toInteger from './toInteger.js'; +import baseSlice from './.internal/baseSlice.js' +import toInteger from './toInteger.js' /** * Creates a slice of `array` with `n` elements taken from the end. @@ -12,26 +12,26 @@ import toInteger from './toInteger.js'; * @returns {Array} Returns the slice of `array`. * @example * - * takeRight([1, 2, 3]); + * takeRight([1, 2, 3]) * // => [3] * - * takeRight([1, 2, 3], 2); + * takeRight([1, 2, 3], 2) * // => [2, 3] * - * takeRight([1, 2, 3], 5); + * takeRight([1, 2, 3], 5) * // => [1, 2, 3] * - * takeRight([1, 2, 3], 0); + * takeRight([1, 2, 3], 0) * // => [] */ function takeRight(array, n, guard) { - const length = array == null ? 0 : array.length; + const length = array == null ? 0 : array.length if (!length) { - return []; + return [] } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, n < 0 ? 0 : n, length); + n = (guard || n === undefined) ? 1 : toInteger(n) + n = length - n + return baseSlice(array, n < 0 ? 0 : n, length) } -export default takeRight; +export default takeRight diff --git a/takeRightWhile.js b/takeRightWhile.js index 0c468006ea..4d6c0e2961 100644 --- a/takeRightWhile.js +++ b/takeRightWhile.js @@ -1,4 +1,4 @@ -import baseWhile from './.internal/baseWhile.js'; +import baseWhile from './.internal/baseWhile.js' /** * Creates a slice of `array` with elements taken from the end. Elements are @@ -16,15 +16,15 @@ import baseWhile from './.internal/baseWhile.js'; * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': true }, * { 'user': 'pebbles', 'active': true } - * ]; + * ] * - * takeRightWhile(users, ({ active }) => active); + * takeRightWhile(users, ({ active }) => active) * // => objects for ['fred', 'pebbles'] */ function takeRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, predicate, false, true) - : []; + : [] } -export default takeRightWhile; +export default takeRightWhile diff --git a/takeWhile.js b/takeWhile.js index 51458714a8..9ebfd811a7 100644 --- a/takeWhile.js +++ b/takeWhile.js @@ -1,4 +1,4 @@ -import baseWhile from './.internal/baseWhile.js'; +import baseWhile from './.internal/baseWhile.js' /** * Creates a slice of `array` with elements taken from the beginning. Elements @@ -16,15 +16,15 @@ import baseWhile from './.internal/baseWhile.js'; * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': true }, * { 'user': 'pebbles', 'active': false } - * ]; + * ] * - * takeWhile(users, ({ active }) => active); + * takeWhile(users, ({ active }) => active) * // => objects for ['barney', 'fred'] */ function takeWhile(array, predicate) { return (array && array.length) ? baseWhile(array, predicate) - : []; + : [] } -export default takeWhile; +export default takeWhile diff --git a/template.js b/template.js index d9717a2383..abede1bcb9 100644 --- a/template.js +++ b/template.js @@ -1,30 +1,30 @@ -import assignInWith from './assignInWith.js'; -import attempt from './attempt.js'; -import baseValues from './.internal/baseValues.js'; -import customDefaultsAssignIn from './.internal/customDefaultsAssignIn.js'; -import isError from './isError.js'; -import isIterateeCall from './.internal/isIterateeCall.js'; -import keys from './keys.js'; -import reInterpolate from './.internal/reInterpolate.js'; -import templateSettings from './templateSettings.js'; -import toString from './toString.js'; +import assignInWith from './assignInWith.js' +import attempt from './attempt.js' +import baseValues from './.internal/baseValues.js' +import customDefaultsAssignIn from './.internal/customDefaultsAssignIn.js' +import isError from './isError.js' +import isIterateeCall from './.internal/isIterateeCall.js' +import keys from './keys.js' +import reInterpolate from './.internal/reInterpolate.js' +import templateSettings from './templateSettings.js' +import toString from './toString.js' /** Used to match empty string literals in compiled template source. */ -const reEmptyStringLeading = /\b__p \+= '';/g; -const reEmptyStringMiddle = /\b(__p \+=) '' \+/g; -const reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; +const reEmptyStringLeading = /\b__p \+= ''g +const reEmptyStringMiddle = /\b(__p \+=) '' \+/g +const reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n''g /** * Used to match * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). */ -const reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; +const reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g /** Used to ensure capturing order of template delimiters. */ -const reNoMatch = /($^)/; +const reNoMatch = /($^)/ /** Used to match unescaped characters in compiled string literals. */ -const reUnescapedString = /['\n\r\u2028\u2029\\]/g; +const reUnescapedString = /['\n\r\u2028\u2029\\]/g /** Used to escape characters for inclusion in compiled string literals. */ const stringEscapes = { @@ -34,7 +34,7 @@ const stringEscapes = { '\r': 'r', '\u2028': 'u2028', '\u2029': 'u2029' -}; +} /** * Creates a compiled template function that can interpolate data properties @@ -74,60 +74,60 @@ const stringEscapes = { * @example * * // Use the "interpolate" delimiter to create a compiled template. - * let compiled = template('hello <%= user %>!'); - * compiled({ 'user': 'fred' }); + * let compiled = template('hello <%= user %>!') + * compiled({ 'user': 'fred' }) * // => 'hello fred!' * * // Use the HTML "escape" delimiter to escape data property values. - * let compiled = template('<%- value %>'); - * compiled({ 'value': '