๐ The Event Lists specification
Name | Example |
---|---|
minimal | YAML / JSON |
import Ajv from "https://esm.sh/v114/[email protected]";
import addFormats from "https://esm.sh/[email protected]";
import { parse as yamlParse } from "https://deno.land/[email protected]/yaml/mod.ts";
import { schema } from "https://deno.land/x/[email protected]/mod.ts";
const ajv = new Ajv({ strict: false });
addFormats(ajv);
const validate = ajv.compile(schema);
const LIST_YAML_FILE = "./src/0.1/examples/minimal.yaml";
const list = yamlParse(await Deno.readTextFile(LIST_YAML_FILE));
if (!validate(list)) {
throw validate.errors;
}
console.log("Event List valid");
MIT