@cjser/is-error-constructor
v3.0.0-cjser.2
Published
Check if a value is an error constructor
Maintainers
Readme
is-error-constructor
Check if a value is an error constructor
Install
$ npm install is-error-constructorUsage
import isErrorConstructor from 'is-error-constructor';
isErrorConstructor(Error);
//=> true
isErrorConstructor(RangeError);
//=> true
function FakeError() {}
isErrorConstructor(FakeError);
//=> false
class UnicornError extends Error {}
isErrorConstructor(UnicornError);
//=> trueRelated
- is - Type check values
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/is-error-constructor
