UNPKG
@prelude/array
Version:
latest (3.0.0)
3.0.0
2.3.1
2.3.0
2.2.0
2.1.0
2.0.0
1.0.0
0.3.2
0.3.1
0.3.0
0.2.0
0.1.2
0.1.1
0.1.0
0.0.1
Array module.
@prelude/array
/
src
/
sorted.ts
10 lines
(7 loc)
•
211 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
import
type
*
as
Cmp
from
'@prelude/cmp'
import
clone
from
'./clone.js'
import
sort
from
'./sort.js'
const
sorted = <T>(
values
: T[],
cmp
:
Cmp
.
t
<T>): T[] =>
sort
(
clone
(values), cmp)
export
default
sorted