A small module to prevent re-writing the same error handling code again and again.
foo((err) => {
if (err)
throw new Error(err);
// ...
});
import throwIf from 'throw-if';
foo((err) => {
throwIf(err);
// ...
});
npm install --save throw-if
- 0.0.1 - Initial commit