aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/jobs.ts
blob: 1cc6e6912b3668e02d9495329e7e8076506ae0d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
}