@hyperjump/json-schema 1.10.1 → 1.11.0

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.
package/README.md CHANGED
@@ -201,6 +201,9 @@ Schema, such as `@hyperjump/json-schema/draft-2020-12`.
201
201
  * **unregisterSchema**: (uri: string) => void
202
202
 
203
203
  Remove a schema from the local schema registry.
204
+ * **getAllRegisteredSchemaUris**: () => string[]
205
+
206
+ This function returns the URIs of all registered schemas
204
207
  * **hasSchema**: (uri: string) => boolean
205
208
 
206
209
  Check if a schema with the given URI is already registered.
package/lib/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export type SchemaObject = { // eslint-disable-line @typescript-eslint/consisten
9
9
  export const registerSchema: (schema: SchemaObject | boolean, retrievalUri?: string, contextDialectId?: string) => void;
10
10
  export const unregisterSchema: (retrievalUri: string) => void;
11
11
  export const hasSchema: (uri: string) => boolean;
12
+ export const getAllRegisteredSchemaUris: () => string[];
12
13
 
13
14
  /**
14
15
  * @deprecated since 1.7.0. Use registerSchema instead.
package/lib/index.js CHANGED
@@ -130,7 +130,7 @@ addKeyword(vocabulary);
130
130
  addKeyword(writeOnly);
131
131
 
132
132
  export { addSchema, unregisterSchema, validate, FLAG } from "./core.js";
133
- export { registerSchema, hasSchema } from "./schema.js";
133
+ export { registerSchema, hasSchema, getAllRegisteredSchemaUris } from "./schema.js";
134
134
  export {
135
135
  getMetaSchemaOutputFormat,
136
136
  setMetaSchemaOutputFormat,
package/lib/schema.js CHANGED
@@ -59,6 +59,8 @@ export const unregisterSchema = (uri) => {
59
59
  delete schemaRegistry[normalizedUri];
60
60
  };
61
61
 
62
+ export const getAllRegisteredSchemaUris = () => Object.keys(schemaRegistry);
63
+
62
64
  export const hasSchema = (uri) => uri in schemaRegistry;
63
65
 
64
66
  export const buildSchemaDocument = (schema, id, dialectId, embedded = {}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperjump/json-schema",
3
- "version": "1.10.1",
3
+ "version": "1.11.0",
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",