mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Consistent use (always) of parentheses in arrow functions.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 }
|
||||
})
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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, '')
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user