diff --git a/README.md b/README.md index 375d9db..e7a3bbe 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ import { CustomError } from 'ts-custom-error' class HttpError extends CustomError { public constructor( public code: number, - message: string = HttpError.messages[code], + message?: string, ) { super(message) } @@ -30,3 +30,14 @@ import { factory } from 'ts-custom-error' const MyError = factory('MyError', { message: 'foo', code: 42 }) ``` + +## Similar packages +- [![custom-error](https://badge.fury.io/js/custom-error.svg)](https://www.npmjs.com/package/custom-error) [custom-error](https://github.com/andrezsanchez/custom-error) +- [![custom-errors](https://badge.fury.io/js/custom-errors.svg)](https://www.npmjs.com/package/custom-errors) [custom-errors](https://github.com/techjacker/custom-errors) +- [![custom-error-generator](https://badge.fury.io/js/custom-error-generator.svg)](https://www.npmjs.com/package/custom-error-generator) [custom-error-generator](https://github.com/jproulx/node-custom-error) +- [![custom-error-instance](https://badge.fury.io/js/custom-error-instance.svg)](https://www.npmjs.com/package/custom-error-instance) [custom-error-instance](https://github.com/Gi60s/custom-error-instance) +- [![node-custom-errors](https://badge.fury.io/js/node-custom-errors.svg)](https://www.npmjs.com/package/node-custom-errors) [node-custom-errors](https://github.com/axyjs/node-custom-errors) +- [![extendable-error](https://badge.fury.io/js/extendable-error.svg)](https://www.npmjs.com/package/extendable-error) [extendable-error](https://github.com/vilic/extendable-error) +- [![extendable-error-class](https://badge.fury.io/js/extendable-error-class.svg)](https://www.npmjs.com/package/extendable-error-class) [extendable-error-class](https://github.com/brillout/extendable-error-class) +- [![extend-error](https://badge.fury.io/js/extend-error.svg)](https://www.npmjs.com/package/extend-error) [extend-error](https://github.com/jayyvis/extend-error) +- [![error-extend](https://badge.fury.io/js/eerror-extend.svg)](https://www.npmjs.com/package/error-extend) [error-extend](https://github.com/tilap/error-extend) diff --git a/package.json b/package.json index 62f20c2..9d3ac62 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "test": "jest --notify", "coverage": "jest --coverage", "pretty": "prettier --use-tabs --no-semi --single-quote --trailing-comma all --write src/* src/*/*", - "precommit": "lint-staged && npm test", + "precommit": "lint-staged && npm test -- --onlyChanged", "prepublishOnly": "npm test && npm run bundle" }, "lint-staged": {