// Parses the app's configuration; throws on anything it can't read.
export interface Config {
name: string;
retries: number;
}
export function parseConfig(input: string): Config {
const parsed = JSON.parse(input);
if (typeof parsed.retries !== "number") {
throw new Error("retries must be a number");
}
return { name: String(parsed.name), retries: parsed.retries };
}
neiam
/vigil
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
386 B · text
History
1619312