Adjust styling of array checks in head, uniq, uniqBy and uniqWith to other methods.

This commit is contained in:
Michał Lipiński
2017-03-16 22:48:46 +01:00
parent 929a996987
commit 76ab9cd539
4 changed files with 12 additions and 4 deletions

View File

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

View File

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

View File

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

View File

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