Create types for model enums
[oweals/peertube.git] / server / helpers / custom-validators / misc.ts
1 function exists (value: any) {
2   return value !== undefined && value !== null
3 }
4
5 function isArray (value: any) {
6   return Array.isArray(value)
7 }
8
9 // ---------------------------------------------------------------------------
10
11 export {
12   exists,
13   isArray
14 }
15
16 declare global {
17   namespace ExpressValidator {
18     export interface Validator {
19       exists,
20       isArray
21     }
22   }
23 }