-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Stop ignoring errors from ajv * Fix spec arrays that should be strings * Fix group array that should be a string * Fix malformed `compute_from` * Fix unencoded URIs * Revert "Fix unencoded URIs" This reverts commit ce7c06f. * Remove `uri` fromat annotation from spec URLs' JSON Schema
- Loading branch information
Showing
11 changed files
with
39 additions
and
65 deletions.
There are no files selected for viewing
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,6 @@ | ||
name: Error cause | ||
description: The `cause` property of errors records the specific original cause of the error, particularly for errors that have been re-thrown. | ||
spec: | ||
- https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-installerrorcause | ||
spec: https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-installerrorcause | ||
compat_features: | ||
- javascript.builtins.Error.Error.options_cause_parameter | ||
- javascript.builtins.Error.cause |
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
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
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
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
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
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
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
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,21 +1,17 @@ | ||
import Ajv from "ajv"; | ||
import addFormats from "ajv-formats"; | ||
import assert from "node:assert/strict"; | ||
|
||
import * as schema from "../schemas/data.schema.json" with { type: "json" }; | ||
|
||
export function validate(data: any) { | ||
const ajv = new Ajv({ allErrors: true, allowUnionTypes: true }); | ||
addFormats(ajv); | ||
// TODO: turn on strictNullChecks, fix all the errors, and replace this with: | ||
// const validator = ajv.compile<WebFeaturesData>(schema); | ||
const validator = ajv.compile(schema); | ||
const ajv = new Ajv({ allErrors: true, allowUnionTypes: true }); | ||
// TODO: turn on strictNullChecks, fix all the errors, and replace this with: | ||
// const validator = ajv.compile<WebFeaturesData>(schema); | ||
const validator = ajv.compile(schema); | ||
|
||
assert.equal( | ||
validator({}), | ||
false, | ||
"Failed confidence check: schema validates empty object", | ||
); | ||
assert.equal( | ||
validator({}), | ||
false, | ||
"Failed confidence check: schema validates empty object", | ||
); | ||
|
||
return validator; | ||
} | ||
export { validator as validate }; |
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