UNPKG
nctx
Version:
latest (2.3.1)
2.3.1
2.2.0
2.1.1
2.1.0
2.0.1
2.0.0
1.7.1
1.7.0
1.6.2
1.6.1
1.6.0
1.5.0
1.4.1
1.4.0
1.3.0
1.2.0
1.1.0
1.0.1
1.0.0
NodeJS Contextual Dependency Injection using native async_hooks - IoC
codeberg.org/devthefuture/nctx
nctx
/
src
/
utils.js
14 lines
(11 loc)
•
244 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const
isObjectKey
= (
key
) => {
return
typeof
key ===
"string"
||
typeof
key ===
"number"
; };
const
composeReducer
= (
...fns
) =>
(
x
) =>
fns.
reduceRight
(
(
res, fn
) =>
fn
(res), x);
module
.
exports
= { isObjectKey, composeReducer, };