$ npm install is-error
Detect whether a value is an error
var isError = require("is-error");
console.log(isError(new Error('hi'))) // true
console.log(isError({ message: 'hi' })) // false
var bool = isError(maybeErr)
is-error := (maybeErr: Any) => Boolean
isError
returns a boolean. it will detect whether the argument
is an error or not.
npm install is-error
npm test
© 2010 - cnpmjs.org x YWFE | Home | YWFE