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

15 lines
387 B
TypeScript
Raw Normal View History

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