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

24 lines
384 B
TypeScript
Raw Normal View History

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