interference
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -13,5 +13,11 @@ interface Options { | ||
constructor({ message, type, details, statusCode }: Options); | ||
toJSON(): { | ||
type: string; | ||
message: string; | ||
details: any; | ||
statusCode: number | undefined; | ||
}; | ||
} | ||
export declare function isInterference(value: any): value is Interference; | ||
export default function InterferenceFactory({ message, type, details, statusCode, }: Options): Interference; | ||
export default function InterferenceFactory(options: Options): Interference; | ||
export {}; |
@@ -36,2 +36,10 @@ "use strict"; | ||
} | ||
toJSON() { | ||
return { | ||
type: this.type, | ||
message: this.message, | ||
details: this.details, | ||
statusCode: this.statusCode, | ||
}; | ||
} | ||
} | ||
@@ -43,6 +51,6 @@ exports.Interference = Interference; | ||
exports.isInterference = isInterference; | ||
function InterferenceFactory({ message, type, details, statusCode, }) { | ||
return new Interference({ message, type, details, statusCode }); | ||
function InterferenceFactory(options) { | ||
return new Interference(options); | ||
} | ||
exports.default = InterferenceFactory; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "interference", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Custom error factory for microservices with http code and \"internal\" code props", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is not supported yet
7994
75