Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
rho-cc-node-style-callback
Advanced tools
Create rho-contracts for Node-style callbacks.
You must use the Body Labs fork of rho-contracts:
"dependencies": {
"rho-contracts": "git+https://github.com/bodylabs/rho-contracts.js.git#1.1.0"
}
Use this module to create contracts for a Node-style callbacks. The returned contracts
accept functions whose first argument satisfies some error contract, and the other
arguments are specified the same way as c.fun
.
In the Node-style callback convention, any non-null non-undefined value for the first argument indicates an error. When an error is indicated, the other arguments must not be present, else a contract error is raised.
As a special case, invoking a callback with no arguments will invoke
the wrapped function with one argument set to undefined
.
Calling withError
on the returned contract changes the type of
the error argument to the contract specified.
The main entry point of this module is withDefaultError
, which sets
the expected error contract, like this:
var c = require('rho-contracts');
var cc = {};
cc.callback = require('rho-cc-node-style-callback').withDefaultError(c.error)
cc.countCallback = cc.callback({ result: c.number })
npm install rho-contracts rho-cc-node-style-callback
Pull requests welcome!
If you are having issues, please let us know.
The project is licensed under the Mozilla Public License Version 2.0.
FAQs
Create rho-contracts for Node-style callbacks
The npm package rho-cc-node-style-callback receives a total of 4 weekly downloads. As such, rho-cc-node-style-callback popularity was classified as not popular.
We found that rho-cc-node-style-callback demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.