update
This commit is contained in:
@@ -4,9 +4,7 @@ export type JSONValue =
|
||||
| number
|
||||
| boolean
|
||||
| JSONObject
|
||||
| JSONArray;
|
||||
|
||||
export type JSONArray = Array<JSONValue>;
|
||||
| Array<JSONValue>;
|
||||
|
||||
export interface JSONObject {
|
||||
[x: string]: JSONValue;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
const INSERTION_STR = "$err";
|
||||
export class StoccaTreError {
|
||||
message: string;
|
||||
statusCode: number = 500;
|
||||
@@ -8,10 +9,10 @@ export class StoccaTreError {
|
||||
}
|
||||
|
||||
qualified(qualification: string): this {
|
||||
const insertionPoint = qualification.indexOf("$err");
|
||||
const insertionPoint = qualification.indexOf(INSERTION_STR);
|
||||
this.message = insertionPoint !== -1
|
||||
? `${qualification.slice(0, insertionPoint)}${this.message}${qualification.slice(insertionPoint + 4)}`
|
||||
: `${qualification}${this.message}`;
|
||||
? `${ qualification.slice(0, insertionPoint) }${ this.message }${ qualification.slice(insertionPoint + INSERTION_STR.length) }`
|
||||
: `${ qualification }${ this.message }`;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user