Skip to content

Commit

Permalink
refactor(main): change validator execution to more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
haloivanid committed Aug 10, 2023
1 parent 2ce59bd commit 56db49c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,10 @@ class Validator {
this.errors.push('Invalid time format');
}
}

static check(input: Record<keyof AllTimeStats, IngressStatPoint>): void {
new this(input);
}
}

type IngressStatPoint = string | number;
Expand Down Expand Up @@ -458,7 +462,7 @@ export class IngressStat extends AllTimeStats {
}
}

new Validator(this);
Validator.check(this);

return this;
}
Expand Down

0 comments on commit 56db49c

Please sign in to comment.