From 56db49cf396d2c3398f966b8a5adaee4f22c0be9 Mon Sep 17 00:00:00 2001 From: haloivanid Date: Thu, 10 Aug 2023 22:36:46 +0700 Subject: [PATCH] refactor(main): change validator execution to more readable --- src/main.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 09de7f1..c2e2100 100644 --- a/src/main.ts +++ b/src/main.ts @@ -419,6 +419,10 @@ class Validator { this.errors.push('Invalid time format'); } } + + static check(input: Record): void { + new this(input); + } } type IngressStatPoint = string | number; @@ -458,7 +462,7 @@ export class IngressStat extends AllTimeStats { } } - new Validator(this); + Validator.check(this); return this; }