aboutsummaryrefslogtreecommitdiff
path: root/src/canary
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth@simponic.xyz>2024-08-01 09:15:33 -0700
committerElizabeth Hunt <elizabeth@simponic.xyz>2024-08-01 09:15:33 -0700
commit5dbd16878546886cae5b56b67de6185bfbae0d07 (patch)
tree8dd29c83d8f56b254d964ec040be9bcea0bc108b /src/canary
parentad74ff999589e0df2b60ba6e94362ed5215af312 (diff)
downloadmon.hatecomputers.club-5dbd16878546886cae5b56b67de6185bfbae0d07.tar.gz
mon.hatecomputers.club-5dbd16878546886cae5b56b67de6185bfbae0d07.zip
add arg parser
Diffstat (limited to 'src/canary')
-rw-r--r--src/canary/index.ts3
-rw-r--r--src/canary/test.ts (renamed from src/canary/testable.ts)10
2 files changed, 10 insertions, 3 deletions
diff --git a/src/canary/index.ts b/src/canary/index.ts
index 1d42dec..055a256 100644
--- a/src/canary/index.ts
+++ b/src/canary/index.ts
@@ -1,2 +1,3 @@
export * from "./job";
-export * from "./testable";
+export * from "./test";
+export * from "./email";
diff --git a/src/canary/testable.ts b/src/canary/test.ts
index d79aa99..c03fb30 100644
--- a/src/canary/testable.ts
+++ b/src/canary/test.ts
@@ -1,4 +1,5 @@
-import type { TaskEither } from "fp-ts/lib/TaskEither";
+import * as TE from "fp-ts/lib/TaskEither";
+import * as O from "fp-ts/lib/Option";
import type { Job } from "./job";
import type { D } from "../util";
@@ -21,4 +22,9 @@ export interface Test {
schedule: Schedule;
}
-export type Testable<T extends Job> = (job: T) => TaskEither<Error, boolean>;
+export type Testable<T extends Job> = (job: T) => TE.TaskEither<Error, boolean>;
+
+export const parseTestType = (testType: string): O.Option<TestType> =>
+ Object.values(TestType).includes(testType as TestType)
+ ? O.some(testType as TestType)
+ : O.none;