time-to-botec/js/node_modules/@stdlib/assert/is-error
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
docs feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

isError

Test if a value is an Error object.

Usage

var isError = require( '@stdlib/assert/is-error' );

isError( value )

Tests if a value is an Error object.

var bool = isError( new Error( 'beep' ) );
// returns true

Examples

var isError = require( '@stdlib/assert/is-error' );

var bool = isError( new Error( 'error' ) );
// returns true

bool = isError( new EvalError( 'eval error' ) );
// returns true

bool = isError( new RangeError( 'range error' ) );
// returns true

bool = isError( new ReferenceError( 'reference error' ) );
// returns true

bool = isError( new SyntaxError( 'syntax error' ) );
// returns true

bool = isError( new TypeError( 'type error' ) );
// returns true

bool = isError( new URIError( 'URI error' ) );
// returns true

bool = isError( {} );
// returns false

bool = isError( null );
// returns false