2018-01-25 08:05:18 -06:00
|
|
|
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' ]
|
2018-01-25 08:05:18 -06:00
|
|
|
|
|
|
|
function isValidJobState (value: JobState) {
|
|
|
|
return exists(value) && jobStates.indexOf(value) !== -1
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
export {
|
|
|
|
isValidJobState
|
|
|
|
}
|