PeerTube/server/helpers/custom-validators/misc.ts

22 lines
356 B
TypeScript
Raw Normal View History

2017-06-10 23:15:25 +03:00
function exists (value: any) {
2016-07-31 21:58:43 +03:00
return value !== undefined && value !== null
}
2017-06-10 23:15:25 +03:00
function isArray (value: any) {
2016-07-31 21:58:43 +03:00
return Array.isArray(value)
}
// ---------------------------------------------------------------------------
2017-05-15 23:22:03 +03:00
export {
exists,
isArray
}
2017-06-10 23:15:25 +03:00
2017-08-25 19:36:49 +03:00
declare module 'express-validator' {
export interface Validator {
exists,
isArray
2017-06-10 23:15:25 +03:00
}
}