@travetto/schema 2.1.4 → 2.1.5

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@travetto/schema",
3
3
  "displayName": "Schema",
4
- "version": "2.1.4",
4
+ "version": "2.1.5",
5
5
  "description": "Data type registry for runtime validation, reflection and binding. ",
6
6
  "keywords": [
7
7
  "schema",
@@ -29,8 +29,8 @@
29
29
  "directory": "module/schema"
30
30
  },
31
31
  "dependencies": {
32
- "@travetto/registry": "^2.1.4",
33
- "@travetto/transformer": "^2.1.3"
32
+ "@travetto/registry": "^2.1.5",
33
+ "@travetto/transformer": "^2.1.4"
34
34
  },
35
35
  "optionalPeerDependencies": {
36
36
  "@types/faker": "^5.5.9",
package/src/bind-util.ts CHANGED
@@ -273,7 +273,7 @@ export class BindUtil {
273
273
  * @param params
274
274
  * @returns
275
275
  */
276
- static coereceFields(fields: FieldConfig[], params: unknown[], applyDefaults = false): unknown[] {
276
+ static coerceFields(fields: FieldConfig[], params: unknown[], applyDefaults = false): unknown[] {
277
277
  params = [...params];
278
278
  // Coerce types
279
279
  for (const el of fields) {
@@ -196,8 +196,8 @@ class $SchemaRegistry extends MetadataRegistry<ClassConfig, FieldConfig> {
196
196
  * @param params
197
197
  * @returns
198
198
  */
199
- coereceMethodParams<T>(cls: Class<T>, method: string, params: unknown[], applyDefaults = false): unknown[] {
200
- return BindUtil.coereceFields(this.getMethodSchema(cls, method), params, applyDefaults);
199
+ coerceMethodParams<T>(cls: Class<T>, method: string, params: unknown[], applyDefaults = false): unknown[] {
200
+ return BindUtil.coerceFields(this.getMethodSchema(cls, method), params, applyDefaults);
201
201
  }
202
202
 
203
203
  /**
@@ -58,6 +58,10 @@ export class SchemaTransformUtil {
58
58
  return this.toConcreteType(state, type.commonType, node, root);
59
59
  }
60
60
  }
61
+ case 'unknown':
62
+ default: {
63
+ // Object
64
+ }
61
65
  }
62
66
  return state.createIdentifier('Object');
63
67
  }