@hyperjump/json-schema 1.7.1 → 1.7.2

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 +3 -5
  2. package/package.json +1 -1
package/lib/schema.js CHANGED
@@ -14,20 +14,18 @@ export const schemaPlugin = {
14
14
 
15
15
  return buildSchemaDocument(await response.json(), response.url, contextDialectId);
16
16
  },
17
- fileMatcher: (path) => path.endsWith(".schema.json")
17
+ fileMatcher: (path) => /(\.|\/)schema\.json$/.test(path)
18
18
  };
19
19
 
20
20
  const schemaRegistry = {};
21
21
 
22
22
  export const getSchema = async (uri, browser = undefined) => {
23
23
  if (!browser) {
24
- const cache = {};
24
+ browser = { _cache: {} };
25
25
 
26
26
  for (const uri in schemaRegistry) {
27
- cache[uri] = schemaRegistry[uri];
27
+ browser._cache[uri] = schemaRegistry[uri];
28
28
  }
29
-
30
- browser = { _cache: cache };
31
29
  }
32
30
 
33
31
  const schema = await browserGet(uri, browser);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperjump/json-schema",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
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",