File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ export class ApplicationError extends Error {
2+ code : string ;
3+ stack : string ;
4+ message : object ;
5+ constructor ( message : object , code ?: string ) ;
6+ }
Original file line number Diff line number Diff line change 1717*/
1818
1919let originalError = Error ;
20- class ApplicationError extends Error {
20+ class ApplicationErrorExtension extends Error {
2121 constructor ( message , rawCode , ...args ) {
2222 const code = rawCode || typeof message === 'string' && message || typeof message === 'object' && message . code || null ;
2323
@@ -51,12 +51,12 @@ class ApplicationError extends Error {
5151 }
5252}
5353
54- const originalApplicationErrorClass = ApplicationError ;
55- const ApplicationErrorWrapper = function ( ...args ) { return new originalApplicationErrorClass ( ...args ) ; } ;
54+ const originalApplicationErrorClass = ApplicationErrorExtension ;
55+ const ApplicationError = function ( ...args ) { return new originalApplicationErrorClass ( ...args ) ; } ;
5656if ( typeof global !== 'undefined' ) {
57- global . ApplicationError = ApplicationErrorWrapper ;
57+ global . ApplicationError = ApplicationError ;
5858}
59- module . exports = ApplicationErrorWrapper ;
59+ module . exports = ApplicationError ;
6060
6161/* eslint-disable no-extend-native */
6262Error . create = function ( errorObject , code ) {
Original file line number Diff line number Diff line change 33 "version" : " 0.0.0" ,
44 "description" : " Replace your lame string errors with object versions." ,
55 "main" : " index.js" ,
6+ "types" : " index.d.ts" ,
67 "files" : [
7- " index.js"
8+ " index.js" ,
9+ " index.d.ts"
810 ],
911 "scripts" : {
1012 "lint" : " eslint --ext .js tests index.js" ,
You can’t perform that action at this time.
0 commit comments