X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fmisc.ts;h=b1291ba7a5b38a8f91a9e5a6f1d14c068d1731ee;hb=1840c2f7c91f5f89602a3683d85b0a9df1454855;hp=83f50a7fef69e92325d07d5c6fb0e8a29ccaa50f;hpb=65fcc3119c334b75dd13bcfdebf186afdc580a8f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/misc.ts b/server/helpers/custom-validators/misc.ts index 83f50a7fe..b1291ba7a 100644 --- a/server/helpers/custom-validators/misc.ts +++ b/server/helpers/custom-validators/misc.ts @@ -1,8 +1,8 @@ -function exists (value) { +function exists (value: any) { return value !== undefined && value !== null } -function isArray (value) { +function isArray (value: any) { return Array.isArray(value) } @@ -12,3 +12,12 @@ export { exists, isArray } + +declare global { + namespace ExpressValidator { + export interface Validator { + exists, + isArray + } + } +}