Consistent use (always) of parentheses in arrow functions.

This commit is contained in:
Michał Lipiński
2017-03-07 21:57:21 +01:00
parent 7ffe700d66
commit 41a8d2272e
40 changed files with 47 additions and 49 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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))

View File

@@ -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

View File

@@ -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 }
})

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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, '')
)
}

View File

@@ -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

View File

@@ -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

View File

@@ -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