-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: include Ajv via npm dependency
import via esm.sh was not compatible with locking and had occasional checksum failures
- Loading branch information
1 parent
0bc866c
commit 605574f
Showing
2 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
|
@@ -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); | ||
} | ||
|