summaryrefslogtreecommitdiff
path: root/model/job/index.ts
blob: 78f69d6dc90da8c5f1b36a0c59261a8f68aa17cf (plain)
1
2
3
4
5
6
7
8
9
10
11
import { isObject } from '@emprespresso/pengueno';

export type JobArgT = Record<string, string>;
export interface Job {
    readonly type: string;
    readonly arguments: JobArgT;
}
export const isJob = (j: unknown): j is Job =>
    !!(isObject(j) && 'arguments' in j && isObject(j.arguments) && 'type' in j && typeof j.type === 'string' && j);

export * from './jobs';