diff options
Diffstat (limited to 'server/helpers/custom-validators/jobs.ts')
-rw-r--r-- | server/helpers/custom-validators/jobs.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/jobs.ts b/server/helpers/custom-validators/jobs.ts new file mode 100644 index 000000000..9700fbd12 --- /dev/null +++ b/server/helpers/custom-validators/jobs.ts | |||
@@ -0,0 +1,14 @@ | |||
1 | import { JobState } from '../../../shared/models' | ||
2 | import { exists } from './misc' | ||
3 | |||
4 | const jobStates: JobState[] = [ 'active', 'complete', 'failed', 'inactive', 'delayed' ] | ||
5 | |||
6 | function isValidJobState (value: JobState) { | ||
7 | return exists(value) && jobStates.indexOf(value) !== -1 | ||
8 | } | ||
9 | |||
10 | // --------------------------------------------------------------------------- | ||
11 | |||
12 | export { | ||
13 | isValidJobState | ||
14 | } | ||