1
0
Fork 0
peertube/server/helpers/custom-validators/jobs.ts
2018-07-11 14:00:17 +02:00

14 lines
387 B
TypeScript

import { JobState } from '../../../shared/models'
import { exists } from './misc'
const jobStates: JobState[] = [ 'active', 'completed', 'failed', 'waiting', 'delayed' ]
function isValidJobState (value: JobState) {
return exists(value) && jobStates.indexOf(value) !== -1
}
// ---------------------------------------------------------------------------
export {
isValidJobState
}