Package Exports
- is-typeof-error
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-typeof-error) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
is-typeof-error

Check that given value is any type of error and instanceof Error
Install
npm i is-typeof-error --save
npm test
Usage
For more use-cases see the tests
var isError = require('is-typeof-error')
var KindError = require('kind-error')
var PluginError = require('plugin-error')
var CustomClass = function () {}
CustomClass.prototype.foo = function () {}
isError(new TypeError('test')) //=> true
isError(new SyntaxError('test')) //=> true
isError(new SyntaxError('test')) //=> true
isError(new PluginError('test', 'msg')) //=> true
isError(new CustomClass('test')) //=> false
isError(new Object({a: 'b'})) //=> false
isError(new RegExp('test')) //=> false
isError(Object.create({a: 'b'})) //=> false
isError(/regex/) //=> false
isError({a: 'b'}) //=> false
Related
- is-kindof: Check type of given javascript value. Support promises, generators, streams, and native types. Thin wrapper around
kind-of
module. - is-missing: Check that given
name
oruser/repo
exists in npm registry or in github as user repository. - kind-error: Correct inheriting from
Error
. Supports constructing from an object of properties - focused on assertion. - kind-of-extra: Extends
kind-of
type check utility with support for promises, generators, streams and errors. Likekindof(Promise.resolve(1)) === 'promise'
and etc. - kind-of-types: List of all javascript types. Used and useful for checking, validation, sanitizing and testing. Like isStream, isPromise, isWeakset and etc.
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.