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",
"version": "1.0.9",
"version": "1.0.11",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@pushrocks/smartstatus",
"version": "1.0.9",
"version": "1.0.11",
"license": "MIT",
"devDependencies": {
"@gitzone/tsbuild": "^2.1.25",

View File

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

View File

@ -6,7 +6,13 @@ export class HttpStatus {
HttpStatus.statusMap[statusStringArg] = statusArg;
}
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;
}
public code: number;