UNPKG
fully-optional
Version:
latest (1.2.0)
1.2.0
1.1.5
1.1.4
1.1.3
1.1.1
1.1.0
1.0.0
0.0.5
0.0.4
0.0.3
<div align="center">
github.com/YuriiOstapchuk/fully-optional
YuriiOstapchuk/fully-optional
fully-optional
/
src
/
curryLast.ts
5 lines
(3 loc)
•
171 B
text/typescript
View Raw
1
2
3
4
5
const
curryLast
= (
fn
: (...args:
any
[]) =>
any
,
args
:
any
[]
) => args.
length
===
1
?
(
data
:
any
) =>
fn
(data, ...args.
slice
(-
1
)) :
fn
(...args);
export
default
curryLast;