UNPKG
@skazka/aws
Version:
latest (0.1.4)
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.4
0.0.3
0.0.2
0.0.1
Skazka AWS
skazkajs.org
skazkajs/skazka
@skazka/aws
/
handler
/
factory.js
8 lines
(5 loc)
•
211 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
const factory = (body) => (handler = null, options = {}) => { const
method
=
(func) => async (...args) => body(func, options, args);
return
handler ?
method
(
handler
)
: method
; }; module.exports = factory;