@travetto/schema 3.1.0 → 3.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/schema",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "description": "Data type registry for runtime validation, reflection and binding.",
5
5
  "keywords": [
6
6
  "schema",
@@ -27,10 +27,10 @@
27
27
  "directory": "module/schema"
28
28
  },
29
29
  "dependencies": {
30
- "@travetto/registry": "^3.1.0"
30
+ "@travetto/registry": "^3.1.1"
31
31
  },
32
32
  "peerDependencies": {
33
- "@travetto/transformer": "^3.1.0"
33
+ "@travetto/transformer": "^3.1.2"
34
34
  },
35
35
  "peerDependenciesMeta": {
36
36
  "@travetto/transformer": {
@@ -135,6 +135,14 @@ class $SchemaRegistry extends MetadataRegistry<ClassConfig, FieldConfig> {
135
135
  return cls;
136
136
  }
137
137
 
138
+ /**
139
+ * Return all subtypes by discriminator for a given class
140
+ * @param cls The base class to resolve from
141
+ */
142
+ getSubTypesForClass(cls: Class): Map<string, Class> | undefined {
143
+ return this.#subTypes.get(cls);
144
+ }
145
+
138
146
  /**
139
147
  * Register sub types for a class
140
148
  * @param cls The class to register against