MCPcopy Create free account
hub / github.com/Tatamo/atcoder-cli / validateTemplateJSON

Function validateTemplateJSON

src/template.ts:73–79  ·  view source on GitHub ↗
(data: RawTemplate)

Source from the content-addressed store, hash-verified

71 * @param data
72 */
73export async function validateTemplateJSON(data: RawTemplate): Promise<[true, null] | [false, string]> {
74 const ajv = new ((await import("ajv")).default)();
75 const validate = ajv.compile(await import("../schema/acc-template-schema.json"));
76 const valid = validate(data);
77 if (!valid) return [false, ajv.errorsText(validate.errors)];
78 return [true, null];
79}
80
81/**
82 * コンテストテンプレートを展開する

Callers 1

getTemplateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected