Skip to content

Commit

Permalink
chore: include Ajv via npm dependency
Browse files Browse the repository at this point in the history
import via esm.sh was not compatible with locking and had occasional
checksum failures
  • Loading branch information
JohannesRudolph committed Jul 3, 2023
1 parent 0bc866c commit 605574f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 5 deletions.
45 changes: 45 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions src/model/schemas/ModelValidator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import schema from "./schema.json" assert { type: "json" };

import Ajv, { ErrorObject } from "https://esm.sh/ajv@8.11.0";
import addFormats from "https://esm.sh/[email protected]";
import Ajv, { ErrorObject } from "npm:ajv@8.12.0";
import addFormats from "npm:[email protected]";
import {
FoundationConfig,
FoundationFrontmatter,
Expand All @@ -13,13 +13,14 @@ import { KitModule } from "../../kit/KitModule.ts";
import { ComplianceControl } from "../../compliance/ComplianceControl.ts";

export class ModelValidator {
private readonly ajv: Ajv;
private readonly ajv: Ajv.default;
constructor(private readonly logger: Logger) {
this.ajv = new Ajv({ allErrors: true });
// sorry about the .default stuff here, there's probably a better way to do this
this.ajv = new Ajv.default({ allErrors: true });

// something's wrong about the typings here
// deno-lint-ignore no-explicit-any
addFormats(this.ajv as any);
addFormats.default(this.ajv as any);

this.ajv.addSchema(schema);
}
Expand Down

0 comments on commit 605574f

Please sign in to comment.