c-e
Making custom error classes
Install
npm i c-e
Usage
const ce = ; const CustomError = ;const NestedError = ; CustomErrorname === 'CustomError'; // trueNestedErrorname === 'NestedError'; // truename === 'CustomError'; // truename === 'NestedError'; // true'test'message === 'test'; // true instanceof Error; // true instanceof CustomError; // true instanceof NestedError; // true const MyError = ;1 2message === '3'; // true1 2a === 1; // true1 2b === 2; // true
License
MIT