mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Adjust styling of array checks in head, uniq, uniqBy and uniqWith to other methods.
This commit is contained in:
4
head.js
4
head.js
@@ -16,7 +16,9 @@
|
||||
* // => undefined
|
||||
*/
|
||||
function head(array) {
|
||||
return (array != null && array.length) ? array[0] : undefined
|
||||
return (array != null && array.length)
|
||||
? array[0]
|
||||
: undefined
|
||||
}
|
||||
|
||||
export default head
|
||||
|
||||
4
uniq.js
4
uniq.js
@@ -18,7 +18,9 @@ import baseUniq from './.internal/baseUniq.js'
|
||||
* // => [2, 1]
|
||||
*/
|
||||
function uniq(array) {
|
||||
return (array != null && array.length) ? baseUniq(array) : []
|
||||
return (array != null && array.length)
|
||||
? baseUniq(array)
|
||||
: []
|
||||
}
|
||||
|
||||
export default uniq
|
||||
|
||||
@@ -19,7 +19,9 @@ import baseUniq from './.internal/baseUniq.js'
|
||||
* // => [2.1, 1.2]
|
||||
*/
|
||||
function uniqBy(array, iteratee) {
|
||||
return (array != null && array.length) ? baseUniq(array, iteratee) : []
|
||||
return (array != null && array.length)
|
||||
? baseUniq(array, iteratee)
|
||||
: []
|
||||
}
|
||||
|
||||
export default uniqBy
|
||||
|
||||
@@ -21,7 +21,9 @@ import baseUniq from './.internal/baseUniq.js'
|
||||
*/
|
||||
function uniqWith(array, comparator) {
|
||||
comparator = typeof comparator == 'function' ? comparator : undefined
|
||||
return (array != null && array.length) ? baseUniq(array, undefined, comparator) : []
|
||||
return (array != null && array.length)
|
||||
? baseUniq(array, undefined, comparator)
|
||||
: []
|
||||
}
|
||||
|
||||
export default uniqWith
|
||||
|
||||
Reference in New Issue
Block a user