@hyperjump/json-schema 1.4.2 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/schema.js +4 -0
  2. package/package.json +1 -1
package/lib/schema.js CHANGED
@@ -77,6 +77,10 @@ const processSchema = (subject, id, dialectId, pointer, anchors, dynamicAnchors)
77
77
  if (jsonTypeOf(subject, "object")) {
78
78
  // Embedded Schema
79
79
  const embeddedDialectId = typeof subject.$schema === "string" ? toAbsoluteIri(subject.$schema) : dialectId;
80
+ if (!hasDialect(embeddedDialectId)) {
81
+ throw Error(`Encountered unknown dialect '${embeddedDialectId}'`);
82
+ }
83
+
80
84
  const idToken = getKeywordName(embeddedDialectId, "https://json-schema.org/keyword/id");
81
85
  if (typeof subject[idToken] === "string") {
82
86
  subject[idToken] = resolveUri(subject[idToken], id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperjump/json-schema",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "A JSON Schema validator with support for custom keywords, vocabularies, and dialects",
5
5
  "type": "module",
6
6
  "main": "./stable/index.js",