is-typeof-error
Check that given value is any type of error and instanceof Error.
Install
npm i is-typeof-error --save
Usage
For more use-cases see the tests
const isTypeofError =
isTypeofError
Check that
val
is error.
Params
val
{Error}returns
{Boolean}
Example
const isTypeofError = const PluginError = const KindError = const CustomClass = {}CustomClassprototype {} // => true // => true // => true // => true // => false // => false // => false // => false // => false // => false
Related
- error-base: Create custom Error classes. | homepage
- is-kindof: Check type of given javascript value. Support promises, generators, streams, and native types… more | homepage
- kind-error: Base class for easily creating meaningful and quiet by default Error classes with sane… more | homepage
- kind-of: Get the native type of a value. | homepage
- kind-of-extra: Additional functionality to
kind-of
type check utility, support promises, generators… more | homepage - kind-of-types: List of all javascript types. Used and useful for checking, validation, sanitizing and… more | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.