UNPKG

@govtechsg/open-attestation

Version:
12 lines (11 loc) 474 B
import strictCompiledSchema from "../__generated__/compiled_schema_strict.js"; import nonStrictCompiledSchema from "../__generated__/compiled_schema_non_strict.js"; export var getSchema = function (key, mode) { if (mode === void 0) { mode = "strict"; } var schema = mode === "strict" ? strictCompiledSchema[key] : nonStrictCompiledSchema[key]; if (!schema) throw new Error("Could not find ".concat(key, " schema")); return schema; };