chore: esModuleInterop: true api v2 tsconfig (#26752)
* chore: api v2 esModuleInterop * chore: api v2 esModuleInterop
This commit is contained in:
1 parent
d5c2212c41
commit
6840642cb7
90 files changed
+1439
-1531
No files matched your search
@@ -1,10 +1,9 @@
|
||||
import type { ValidatorConstraintInterface } from "class-validator";
|
||||
import { ValidatorConstraint } from "class-validator";
|
||||
import * as tzdata from "tzdata";
|
||||
|
||||
import tzdata from "tzdata";
|
||||
@ValidatorConstraint({ name: "timezoneValidator", async: false })
|
||||
export class TimeZoneValidator implements ValidatorConstraintInterface {
|
||||
validate(timeZone: string) {
|
||||
validate(timeZone: string): boolean {
|
||||
const timeZoneList = Object.keys(tzdata.zones);
|
||||
|
||||
if (timeZoneList.includes(timeZone)) return true;
|
||||
@@ -12,7 +11,7 @@ export class TimeZoneValidator implements ValidatorConstraintInterface {
|
||||
return false;
|
||||
}
|
||||
|
||||
defaultMessage() {
|
||||
defaultMessage(): string {
|
||||
return "Please include a valid time zone";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user