aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/misc.ts
blob: b1291ba7a5b38a8f91a9e5a6f1d14c068d1731ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function exists (value: any) {
  return value !== undefined && value !== null
}

function isArray (value: any) {
  return Array.isArray(value)
}

// ---------------------------------------------------------------------------

export {
  exists,
  isArray
}

declare global {
  namespace ExpressValidator {
    export interface Validator {
      exists,
      isArray
    }
  }
}