1
0
Fork 0
peertube/server/helpers/custom-validators/misc.ts

24 lines
379 B
TypeScript
Raw Normal View History

2017-06-10 16:15:25 -04:00
function exists (value: any) {
2016-07-31 14:58:43 -04:00
return value !== undefined && value !== null
}
2017-06-10 16:15:25 -04:00
function isArray (value: any) {
2016-07-31 14:58:43 -04:00
return Array.isArray(value)
}
// ---------------------------------------------------------------------------
2017-05-15 16:22:03 -04:00
export {
exists,
isArray
}
2017-06-10 16:15:25 -04:00
declare global {
namespace ExpressValidator {
export interface Validator {
exists,
isArray
}
}
}