@hyperjump/json-schema
Advanced tools
Comparing version 1.7.3 to 1.8.0
@@ -66,2 +66,3 @@ import type { Browser, Document } from "@hyperjump/browser"; | ||
export const loadDialect: (dialectId: string, dialect: { [vocabularyId: string]: boolean }, allowUnknownKeywords?: boolean) => void; | ||
export const unloadDialect: (dialectId: string) => void; | ||
export const hasDialect: (dialectId: string) => boolean; | ||
@@ -68,0 +69,0 @@ |
export { compile, interpret, BASIC, DETAILED, VERBOSE } from "./core.js"; | ||
export { getKeyword, getKeywordByName, addKeyword, defineVocabulary, getKeywordName, getKeywordId, loadDialect, hasDialect } from "./keywords.js"; | ||
export { | ||
addKeyword, getKeyword, getKeywordByName, getKeywordName, getKeywordId, | ||
defineVocabulary, | ||
loadDialect, unloadDialect, hasDialect | ||
} from "./keywords.js"; | ||
export { getSchema, toSchema, canonicalUri, buildSchemaDocument } from "./schema.js"; | ||
export { default as Validation } from "./keywords/validation.js"; |
@@ -84,1 +84,6 @@ import { toAbsoluteUri } from "./common.js"; | ||
}; | ||
export const unloadDialect = (dialectId) => { | ||
delete _allowUnknownKeywords[dialectId]; | ||
delete _dialects[dialectId]; | ||
}; |
@@ -6,3 +6,3 @@ import contentTypeParser from "content-type"; | ||
import { resolveIri, toAbsoluteIri, normalizeIri } from "@hyperjump/uri"; | ||
import { getKeywordName, loadDialect } from "./keywords.js"; | ||
import { getKeywordName, loadDialect, unloadDialect } from "./keywords.js"; | ||
import { uriFragment, jsonStringify, jsonTypeOf, toRelativeIri } from "./common.js"; | ||
@@ -56,3 +56,5 @@ | ||
export const unregisterSchema = (uri) => { | ||
delete schemaRegistry[toAbsoluteIri(uri)]; | ||
const normalizedUri = toAbsoluteIri(uri); | ||
unloadDialect(normalizedUri); | ||
delete schemaRegistry[normalizedUri]; | ||
}; | ||
@@ -59,0 +61,0 @@ |
{ | ||
"name": "@hyperjump/json-schema", | ||
"version": "1.7.3", | ||
"version": "1.8.0", | ||
"description": "A JSON Schema validator with support for custom keywords, vocabularies, and dialects", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -569,2 +569,6 @@ # Hyperjump - JSON Schema | ||
Schema rather than creating a dialect of an existing version of JSON Schema. | ||
* **unloadDialect**: (dialectId: string) => void | ||
Remove a dialect. You shouldn't need to use this function. It's called for | ||
you when you call `unregisterSchema`. | ||
* **Validation**: Keyword | ||
@@ -571,0 +575,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
330511
8834
800