]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/helpers/custom-validators/search.ts
Add videos list filters
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / search.ts
CommitLineData
d525fc39
C
1import * as validator from 'validator'
2import 'express-validator'
3
4import { isArray } from './misc'
5
6function isNumberArray (value: any) {
7 return isArray(value) && value.every(v => validator.isInt('' + v))
8}
9
10function isStringArray (value: any) {
11 return isArray(value) && value.every(v => typeof v === 'string')
12}
13
14// ---------------------------------------------------------------------------
15
16export {
17 isNumberArray,
18 isStringArray
19}