Skip to content

Commit 819cd97

Browse files
authored
refactor: use Array#toSorted() (#352)
1 parent 6e739b2 commit 819cd97

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)