is-error-x
v2.1.2
Published
Detect whether a value is an error.
Downloads
3,037
Maintainers
Readme
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