summary refs log tree commit diff
path: root/src/util/instanceOf.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-03-08 18:40:37 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-03-08 18:40:37 +0100
commit6a1e0594dc55e35c0846370ff6bc7a8bd55947de (patch)
treec91af4f69633a091b604a7ebd2b26a82a007fba5 /src/util/instanceOf.ts
parent:sparkles: Schema (diff)
downloadserver-6a1e0594dc55e35c0846370ff6bc7a8bd55947de.tar.xz
rename req.userid -> req.user_id
Diffstat (limited to 'src/util/instanceOf.ts')
-rw-r--r--src/util/instanceOf.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/instanceOf.ts b/src/util/instanceOf.ts

index bbb30c12..4f30bd46 100644 --- a/src/util/instanceOf.ts +++ b/src/util/instanceOf.ts
@@ -51,7 +51,7 @@ export class Length { constructor(public type: any, public min: number, public max: number) {} check(value: string) { - if (typeof value === "string") return value.length >= this.min && value.length <= this.max; + if (typeof value === "string" || Array.isArray(value)) return value.length >= this.min && value.length <= this.max; if (typeof value === "number" || typeof value === "bigint") return value >= this.min && value <= this.max; return false; }