Skip to content

Commit 0b006f9

Browse files
committed
refactor: use Array#toSorted()
1 parent b3be166 commit 0b006f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const onArray = (fn) => (x) => (Array.isArray(x) ? fn(x) : x)
1313
const onStringArray = (fn) => (x) =>
1414
Array.isArray(x) && x.every((item) => typeof item === 'string') ? fn(x) : x
1515
const uniq = onStringArray((xs) => [...new Set(xs)])
16-
const sortArray = onStringArray((array) => [...array].sort())
16+
const sortArray = onStringArray((array) => array.toSorted())
1717
const uniqAndSortArray = pipe([uniq, sortArray])
1818
const onObject =
1919
(fn) =>

0 commit comments

Comments
 (0)