]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/helpers/custom-validators/misc.ts
8d215a416bc899c6cbf122b7fad5f603f2dbc512
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / misc.ts
1 import 'express-validator'
2
3 function exists (value: any) {
4 return value !== undefined && value !== null
5 }
6
7 function isArray (value: any) {
8 return Array.isArray(value)
9 }
10
11 // ---------------------------------------------------------------------------
12
13 export {
14 exists,
15 isArray
16 }
17
18 declare module 'express-validator' {
19 export interface Validator {
20 exists,
21 isArray
22 }
23 }