4 Commits

Author SHA1 Message Date
935ea4386c 1.0.11 2021-08-19 18:40:04 +02:00
df430fa033 fix(core): update 2021-08-19 18:40:04 +02:00
acbe290526 1.0.10 2021-08-16 16:31:05 +02:00
98f99bd18d fix(core): update 2021-08-16 16:31:04 +02:00
3 changed files with 11 additions and 5 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@pushrocks/smartstatus", "name": "@pushrocks/smartstatus",
"version": "1.0.9", "version": "1.0.11",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@pushrocks/smartstatus", "name": "@pushrocks/smartstatus",
"version": "1.0.9", "version": "1.0.11",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.25", "@gitzone/tsbuild": "^2.1.25",

View File

@ -1,13 +1,13 @@
{ {
"name": "@pushrocks/smartstatus", "name": "@pushrocks/smartstatus",
"version": "1.0.9", "version": "1.0.11",
"private": false, "private": false,
"description": "status information in TypeScript", "description": "status information in TypeScript",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/)",
"build": "tsbuild" "build": "tsbuild --web"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -6,7 +6,13 @@ export class HttpStatus {
HttpStatus.statusMap[statusStringArg] = statusArg; HttpStatus.statusMap[statusStringArg] = statusArg;
} }
public static getHttpStatusByString(codeStringArg: string): HttpStatus { public static getHttpStatusByString(codeStringArg: string): HttpStatus {
const statusInstance = new HttpStatus.statusMap[codeStringArg](); let statusInstance: HttpStatus;
try {
statusInstance = new HttpStatus.statusMap[codeStringArg]();
} catch {
console.log('unknown status')
return null;
}
return statusInstance; return statusInstance;
} }
public code: number; public code: number;