UNPKG

@govtechsg/open-attestation

Version:
19 lines (18 loc) 828 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSchema = void 0; var compiled_schema_strict_js_1 = __importDefault(require("../__generated__/compiled_schema_strict.js")); var compiled_schema_non_strict_js_1 = __importDefault(require("../__generated__/compiled_schema_non_strict.js")); var getSchema = function (key, mode) { if (mode === void 0) { mode = "strict"; } var schema = mode === "strict" ? compiled_schema_strict_js_1.default[key] : compiled_schema_non_strict_js_1.default[key]; if (!schema) throw new Error("Could not find ".concat(key, " schema")); return schema; }; exports.getSchema = getSchema;