19 lines
438 B
TypeScript
19 lines
438 B
TypeScript
import * as IO from "fp-ts/IO";
|
|
import type { Publisher } from "./publisher";
|
|
import { readFileSync } from "fs";
|
|
import type { Test } from "./canary";
|
|
|
|
export interface Config {
|
|
result_publishers: Publisher[];
|
|
dns: string[];
|
|
http_timeout: string;
|
|
tests: Test[];
|
|
}
|
|
|
|
export const readConfig =
|
|
(filePath: string): IO.IO<Config> =>
|
|
() => {
|
|
const confStr = readFileSync(filePath, "utf-8");
|
|
return JSON.parse(confStr);
|
|
};
|