diff --git a/.eslintrc.js b/.eslintrc.js index abedf9c43..7420ca1a4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -38,9 +38,7 @@ module.exports = { 'requireReturnForObjectLiteral': false }], - 'arrow-parens': ['error', 'as-needed', { - 'requireForBlockBody': true - }], + 'arrow-parens': ['error', 'always'], 'arrow-spacing': ['error', { 'before': true, diff --git a/.internal/baseConforms.js b/.internal/baseConforms.js index 53e2fd54f..1df2aed16 100644 --- a/.internal/baseConforms.js +++ b/.internal/baseConforms.js @@ -10,7 +10,7 @@ import keys from '../keys.js' */ function baseConforms(source) { const props = keys(source) - return object => baseConformsTo(object, source, props) + return (object) => baseConformsTo(object, source, props) } export default baseConforms diff --git a/.internal/baseDifference.js b/.internal/baseDifference.js index f68a09895..07d1eefea 100644 --- a/.internal/baseDifference.js +++ b/.internal/baseDifference.js @@ -30,7 +30,7 @@ function baseDifference(array, values, iteratee, comparator) { return result } if (iteratee) { - values = arrayMap(values, value => iteratee(value)) + values = arrayMap(values, (value) => iteratee(value)) } if (comparator) { includes = arrayIncludesWith diff --git a/.internal/baseIntersection.js b/.internal/baseIntersection.js index fcbe9f259..c038ecc8b 100644 --- a/.internal/baseIntersection.js +++ b/.internal/baseIntersection.js @@ -31,7 +31,7 @@ function baseIntersection(arrays, iteratee, comparator) { while (othIndex--) { array = arrays[othIndex] if (othIndex && iteratee) { - array = arrayMap(array, value => iteratee(value)) + array = arrayMap(array, (value) => iteratee(value)) } maxLength = nativeMin(array.length, maxLength) caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) diff --git a/.internal/baseMatches.js b/.internal/baseMatches.js index 012a04e5c..f6145fd2d 100644 --- a/.internal/baseMatches.js +++ b/.internal/baseMatches.js @@ -14,7 +14,7 @@ function baseMatches(source) { if (matchData.length == 1 && matchData[0][2]) { 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 diff --git a/.internal/baseOrderBy.js b/.internal/baseOrderBy.js index fe6c459b6..1e2fd0c8d 100644 --- a/.internal/baseOrderBy.js +++ b/.internal/baseOrderBy.js @@ -14,10 +14,10 @@ import compareMultiple from './compareMultiple.js' */ function baseOrderBy(collection, iteratees, orders) { let index = -1 - iteratees = iteratees.length ? iteratees : [value => value] + iteratees = iteratees.length ? iteratees : [(value) => value] const result = baseMap(collection, (value, key, collection) => { - const criteria = arrayMap(iteratees, iteratee => iteratee(value)) + const criteria = arrayMap(iteratees, (iteratee) => iteratee(value)) return { 'criteria': criteria, 'index': ++index, 'value': value } }) diff --git a/.internal/baseProperty.js b/.internal/baseProperty.js index a26fe0d8b..48b94ce74 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 diff --git a/.internal/basePropertyDeep.js b/.internal/basePropertyDeep.js index 2dbe3f2ef..32a12b9d3 100644 --- a/.internal/basePropertyDeep.js +++ b/.internal/basePropertyDeep.js @@ -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 diff --git a/.internal/basePropertyOf.js b/.internal/basePropertyOf.js index d9ecf59a3..a9485296d 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 diff --git a/.internal/basePullAll.js b/.internal/basePullAll.js index 83dba6f44..7ddfa5440 100644 --- a/.internal/basePullAll.js +++ b/.internal/basePullAll.js @@ -27,7 +27,7 @@ function basePullAll(array, values, iteratee, comparator) { values = copyArray(values) } if (iteratee) { - seen = arrayMap(array, value => iteratee(value)) + seen = arrayMap(array, (value) => iteratee(value)) } while (++index < length) { let fromIndex = 0 diff --git a/.internal/baseSortedIndex.js b/.internal/baseSortedIndex.js index 6deb1b391..87e5db485 100644 --- a/.internal/baseSortedIndex.js +++ b/.internal/baseSortedIndex.js @@ -34,7 +34,7 @@ function baseSortedIndex(array, value, retHighest) { } return high } - return baseSortedIndexBy(array, value, value => value, retHighest) + return baseSortedIndexBy(array, value, (value) => value, retHighest) } export default baseSortedIndex diff --git a/.internal/baseValues.js b/.internal/baseValues.js index 1ec119bc8..6a43d9baa 100644 --- a/.internal/baseValues.js +++ b/.internal/baseValues.js @@ -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 diff --git a/.internal/createCompounder.js b/.internal/createCompounder.js index 4b9b88936..15b0157ab 100644 --- a/.internal/createCompounder.js +++ b/.internal/createCompounder.js @@ -13,7 +13,7 @@ const reApos = /['\u2019]/g * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { - return string => ( + return (string) => ( arrayReduce(words(toString(string).replace(reApos, '')), callback, '') ) } diff --git a/.internal/createSet.js b/.internal/createSet.js index bb624bd2b..0e86dc5c7 100644 --- a/.internal/createSet.js +++ b/.internal/createSet.js @@ -11,7 +11,7 @@ const INFINITY = 1 / 0 * @returns {Object} Returns the new set. */ const createSet = (Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) - ? values => new Set(values) + ? (values) => new Set(values) : () => {} export default createSet diff --git a/.internal/getSymbols.js b/.internal/getSymbols.js index 4b51a3da8..cc1b78598 100644 --- a/.internal/getSymbols.js +++ b/.internal/getSymbols.js @@ -18,7 +18,7 @@ const getSymbols = !nativeGetSymbols ? () => [] : (object) => { return [] } object = Object(object) - return arrayFilter(nativeGetSymbols(object), symbol => propertyIsEnumerable.call(object, symbol)) + return arrayFilter(nativeGetSymbols(object), (symbol) => propertyIsEnumerable.call(object, symbol)) } export default getSymbols diff --git a/.internal/setToPairs.js b/.internal/setToPairs.js index 3f2d1d9d7..1d8ed7de7 100644 --- a/.internal/setToPairs.js +++ b/.internal/setToPairs.js @@ -9,7 +9,7 @@ function setToPairs(set) { let index = -1 const result = Array(set.size) - set.forEach(value => + set.forEach((value) => result[++index] = [value, value] ) return result diff --git a/escape.js b/escape.js index 4a5445e94..e3fdc5e2e 100644 --- a/escape.js +++ b/escape.js @@ -43,7 +43,7 @@ const reHasUnescapedHtml = RegExp(reUnescapedHtml.source) function escape(string) { string = toString(string) return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, chr => htmlEscapes[chr]) + ? string.replace(reUnescapedHtml, (chr) => htmlEscapes[chr]) : string } diff --git a/forOwn.js b/forOwn.js index f38213ac5..a7d3f55e6 100644 --- a/forOwn.js +++ b/forOwn.js @@ -25,7 +25,7 @@ */ function forOwn(object, iteratee) { if (object != null) { - Object.keys(Object(object)).forEach(key => iteratee(object[key], key, object)) + Object.keys(Object(object)).forEach((key) => iteratee(object[key], key, object)) } } diff --git a/functions.js b/functions.js index 251c4181f..3242c835a 100644 --- a/functions.js +++ b/functions.js @@ -23,7 +23,7 @@ function functions(object) { if (object == null) { return [] } - return Object.keys(object).filter(key => typeof object[key] == 'function') + return Object.keys(object).filter((key) => typeof object[key] == 'function') } export default functions diff --git a/isArrayBuffer.js b/isArrayBuffer.js index 83f5c0786..ab50e52d1 100644 --- a/isArrayBuffer.js +++ b/isArrayBuffer.js @@ -21,7 +21,7 @@ const nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer * // => false */ const isArrayBuffer = nodeIsArrayBuffer - ? value => nodeIsArrayBuffer(value) - : value => isObjectLike(value) && baseGetTag(value) == '[object ArrayBuffer]' + ? (value) => nodeIsArrayBuffer(value) + : (value) => isObjectLike(value) && baseGetTag(value) == '[object ArrayBuffer]' export default isArrayBuffer diff --git a/isDate.js b/isDate.js index 2a202ba02..c1787c3e6 100644 --- a/isDate.js +++ b/isDate.js @@ -21,7 +21,7 @@ const nodeIsDate = nodeUtil && nodeUtil.isDate * // => false */ const isDate = nodeIsDate - ? value => nodeIsDate(value) - : value => isObjectLike(value) && baseGetTag(value) == '[object Date]' + ? (value) => nodeIsDate(value) + : (value) => isObjectLike(value) && baseGetTag(value) == '[object Date]' export default isDate diff --git a/isMap.js b/isMap.js index b1f9650e1..af7533d4a 100644 --- a/isMap.js +++ b/isMap.js @@ -21,7 +21,7 @@ const nodeIsMap = nodeUtil && nodeUtil.isMap * // => false */ const isMap = nodeIsMap - ? value => nodeIsMap(value) - : value => isObjectLike(value) && getTag(value) == '[object Map]' + ? (value) => nodeIsMap(value) + : (value) => isObjectLike(value) && getTag(value) == '[object Map]' export default isMap diff --git a/isRegExp.js b/isRegExp.js index c409582c2..54d100bf1 100644 --- a/isRegExp.js +++ b/isRegExp.js @@ -21,7 +21,7 @@ const nodeIsRegExp = nodeUtil && nodeUtil.isRegExp * // => false */ const isRegExp = nodeIsRegExp - ? value => nodeIsRegExp(value) - : value => isObjectLike(value) && baseGetTag(value) == '[object RegExp]' + ? (value) => nodeIsRegExp(value) + : (value) => isObjectLike(value) && baseGetTag(value) == '[object RegExp]' export default isRegExp diff --git a/isSet.js b/isSet.js index 6a3d21485..6b8606c62 100644 --- a/isSet.js +++ b/isSet.js @@ -20,7 +20,7 @@ const nodeIsSet = nodeUtil && nodeUtil.isSet * // => false */ const isSet = nodeIsSet - ? value => nodeIsSet(value) - : value => typeof value == 'object' && value != null && getTag(value) == '[object Set]' + ? (value) => nodeIsSet(value) + : (value) => typeof value == 'object' && value != null && getTag(value) == '[object Set]' export default isSet diff --git a/isTypedArray.js b/isTypedArray.js index 89259a189..d39ccfcce 100644 --- a/isTypedArray.js +++ b/isTypedArray.js @@ -23,7 +23,7 @@ const nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray * // => false */ const isTypedArray = nodeIsTypedArray - ? value => nodeIsTypedArray(value) - : value => typeof value == 'object' && value != null && reTypedTag.test(getTag(value)) + ? (value) => nodeIsTypedArray(value) + : (value) => typeof value == 'object' && value != null && reTypedTag.test(getTag(value)) export default isTypedArray diff --git a/mean.js b/mean.js index 214ac18bd..8f6d317f7 100644 --- a/mean.js +++ b/mean.js @@ -13,7 +13,7 @@ import baseMean from './meanBy.js' * // => 5 */ function mean(array) { - return baseMean(array, value => value) + return baseMean(array, (value) => value) } export default mean diff --git a/method.js b/method.js index 74f1e36a1..650f1dee5 100644 --- a/method.js +++ b/method.js @@ -23,7 +23,7 @@ import invoke from './invoke.js' * // => [2, 1] */ function method(path, args) { - return object => invoke(object, path, args) + return (object) => invoke(object, path, args) } export default method diff --git a/methodOf.js b/methodOf.js index cc66a6196..dbf51cf3d 100644 --- a/methodOf.js +++ b/methodOf.js @@ -22,7 +22,7 @@ import invoke from './invoke.js' * // => [2, 0] */ function methodOf(object, args) { - return path => invoke(object, path, args) + return (path) => invoke(object, path, args) } export default methodOf diff --git a/over.js b/over.js index df3684e62..644692d90 100644 --- a/over.js +++ b/over.js @@ -18,7 +18,7 @@ import arrayMap from './.internal/arrayMap.js' */ function over(iteratees) { return function(...args) { - return arrayMap(iteratees, iteratee => iteratee.apply(this, args)) + return arrayMap(iteratees, (iteratee) => iteratee.apply(this, args)) } } diff --git a/overEvery.js b/overEvery.js index 1b8a20ad4..28e81d00c 100644 --- a/overEvery.js +++ b/overEvery.js @@ -24,7 +24,7 @@ import arrayEvery from './.internal/arrayEvery.js' */ function overEvery(iteratees) { return function(...args) { - return arrayEvery(iteratees, iteratee => iteratee.apply(this, args)) + return arrayEvery(iteratees, (iteratee) => iteratee.apply(this, args)) } } diff --git a/overSome.js b/overSome.js index bf36b7754..d07e9a052 100644 --- a/overSome.js +++ b/overSome.js @@ -24,7 +24,7 @@ import arraySome from './.internal/arraySome.js' */ function overSome(iteratees) { return function(...args) { - return arraySome(iteratees, iteratee => iteratee.apply(this, args)) + return arraySome(iteratees, (iteratee) => iteratee.apply(this, args)) } } diff --git a/pickBy.js b/pickBy.js index b3f807cc6..c6d4409bb 100644 --- a/pickBy.js +++ b/pickBy.js @@ -22,7 +22,7 @@ function pickBy(object, predicate) { if (object == null) { return {} } - const props = arrayMap(getAllKeysIn(object), prop => [prop]) + const props = arrayMap(getAllKeysIn(object), (prop) => [prop]) return basePickBy(object, props, (value, path) => predicate(value, path[0])) } diff --git a/propertyOf.js b/propertyOf.js index fd8d9b8ea..ed6daac0b 100644 --- a/propertyOf.js +++ b/propertyOf.js @@ -20,7 +20,7 @@ import baseGet from './.internal/baseGet.js' * // => [2, 0] */ function propertyOf(object) { - return path => object == null ? undefined : baseGet(object, path) + return (path) => object == null ? undefined : baseGet(object, path) } export default propertyOf diff --git a/pullAt.js b/pullAt.js index 0d25dcb32..4900c5292 100644 --- a/pullAt.js +++ b/pullAt.js @@ -31,7 +31,7 @@ function pullAt(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)) + basePullAt(array, arrayMap(indexes, (index) => isIndex(index, length) ? +index : index).sort(compareAscending)) return result } diff --git a/sum.js b/sum.js index d28629776..c9c0c277c 100644 --- a/sum.js +++ b/sum.js @@ -14,7 +14,7 @@ import baseSum from './.internal/baseSum.js' */ function sum(array) { return (array != null && array.length) - ? baseSum(array, value => value) + ? baseSum(array, (value) => value) : 0 } diff --git a/template.js b/template.js index 39e4c9a98..7ce21a245 100644 --- a/template.js +++ b/template.js @@ -182,7 +182,7 @@ function template(string, options) { // Escape characters that can't be included in string literals. source += string .slice(index, offset) - .replace(reUnescapedString, chr => `\\${ stringEscapes[chr] }`) + .replace(reUnescapedString, (chr) => `\\${ stringEscapes[chr] }`) // Replace delimiters with snippets. if (escapeValue) { diff --git a/toString.js b/toString.js index dea8183a3..307e8da48 100644 --- a/toString.js +++ b/toString.js @@ -37,7 +37,7 @@ function toString(value) { } if (Array.isArray(value)) { // Recursively convert values (susceptible to call stack limits). - return `${ arrayMap(value, other => other == null ? other : toString(other)) }` + return `${ arrayMap(value, (other) => other == null ? other : toString(other)) }` } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : '' diff --git a/unescape.js b/unescape.js index e10d3cdc2..cb3c09ece 100644 --- a/unescape.js +++ b/unescape.js @@ -34,7 +34,7 @@ const reHasEscapedHtml = RegExp(reEscapedHtml.source) function unescape(string) { string = toString(string) return (string && reHasEscapedHtml.test(string)) - ? string.replace(reEscapedHtml, entity => htmlUnescapes[entity]) + ? string.replace(reEscapedHtml, (entity) => htmlUnescapes[entity]) : string } diff --git a/unzip.js b/unzip.js index 5dc5e385d..a5223e809 100644 --- a/unzip.js +++ b/unzip.js @@ -36,7 +36,7 @@ function unzip(array) { return true } }) - return baseTimes(length, index => arrayMap(array, baseProperty(index))) + return baseTimes(length, (index) => arrayMap(array, baseProperty(index))) } export default unzip diff --git a/unzipWith.js b/unzipWith.js index b6586523f..36137aa89 100644 --- a/unzipWith.js +++ b/unzipWith.js @@ -25,7 +25,7 @@ function unzipWith(array, iteratee) { return [] } const result = unzip(array) - return arrayMap(result, group => iteratee.apply(undefined, group)) + return arrayMap(result, (group) => iteratee.apply(undefined, group)) } export default unzipWith