Skip to content

Xotic750/is-error-x

Repository files navigation

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

is-error-x

Detect whether a value is an error.

module.exports(value)boolean

Determine whether or not a given value is an Error type.

Kind: Exported function
Returns: boolean - Returns true if value is an Error type, else false.

Param Type Description
value * The object to be tested.

Example

import isError from 'is-error-x';

console.log(isError()); // false
console.log(isError(Number.MIN_VALUE)); // false
console.log(isError('abc')); // false
console.log(isError(new Error())); //true