Installations
npm install callback-chain-resolver
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
16.3.0
NPM Version
7.20.3
Score
71.2
Supply Chain
85
Quality
79.7
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
IAmAnubhavSaini
Download Statistics
Total Downloads
3,153
Last Day
1
Last Week
9
Last Month
47
Last Year
231
GitHub Statistics
1 Stars
20 Commits
2 Forks
1 Watching
2 Branches
2 Contributors
Bundle Size
371.00 B
Minified
230.00 B
Minified + Gzipped
Package Meta Information
Latest Version
16.0.0
Package Id
callback-chain-resolver@16.0.0
Unpacked Size
22.96 kB
Size
6.66 kB
File Count
23
NPM Version
7.20.3
Node Version
16.3.0
Total Downloads
Cumulative downloads
Total Downloads
3,153
Last day
0%
1
Compared to previous day
Last week
-47.1%
9
Compared to previous week
Last month
261.5%
47
Compared to previous month
Last year
-38.6%
231
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
3
callback-chain-resolver
Version 16 introduces series
and parallel
functions and removes earlier functions.
Helps you generate values out of functions in series or in parallel.
Installation
npm i callback-chain-resolver
Usage example
1 2import {series, parallel} from 'callback-chain-resolver' 3 4const incrementBy1 = (x) => x + 1; 5const decrementBy1 = (x) => x - 1; 6const double = x => 2 * x 7const square = x => x * x 8const cube = x => x * square(x) 9 10series(1, [incrementBy1, incrementBy1, incrementBy1]) // === 4 11series(1, [incrementBy1, incrementBy1, incrementBy1, double, square]) // === 64 12series(1, [incrementBy1, incrementBy1, incrementBy1, cube]) // === 64 13series(1, [decrementBy1, decrementBy1, decrementBy1]) // === -2 14series(1, [incrementBy1, decrementBy1]) // === 1 15series(1, [incrementBy1, cube, decrementBy1]) // === 7 16series(1, [decrementBy1, incrementBy1]) // === 1 17 18parallel(1, [incrementBy1, incrementBy1, incrementBy1]) // === [2, 2, 2] 19parallel(1, [incrementBy1, incrementBy1, incrementBy1, double, square]) // [2, 2, 2, 2, 1] 20
Check test cases for more examples.
typed
Throws compile time error if you pass mixed output type functions.
For example when you add toString
to the typedResolver test cases.
1TS2345: Argument of type '(((x: number) => number) | ((x: number) => string))[]' is not assignable to parameter of type 'FnT<number>[]'. 2 Type '((x: number) => number) | ((x: number) => string)' is not assignable to type 'FnT<number>'. 3 Type '(x: number) => string' is not assignable to type 'FnT<number>'. 4 Type 'string' is not assignable to type 'number'
Use any
in <any>
while invoking mixed functions.
License
MIT © 2016 - 2021
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
1 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/17 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 4 are checked with a SAST tool
Score
2.5
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More