@bedrockio/model 0.1.10 → 0.1.11

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.
@@ -256,6 +256,9 @@ function getSchemaForTypedef(typedef, options = {}) {
256
256
  if (isRequired(typedef, options)) {
257
257
  schema = schema.required();
258
258
  }
259
+ if (typedef.default) {
260
+ schema = schema.default(typedef.default);
261
+ }
259
262
  if (typedef.validate?.schema) {
260
263
  schema = schema.append(typedef.validate.schema);
261
264
  } else if (typeof typedef.validate === 'function') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrockio/model",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Bedrock utilities for model creation.",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/validation.js CHANGED
@@ -268,6 +268,9 @@ function getSchemaForTypedef(typedef, options = {}) {
268
268
  if (isRequired(typedef, options)) {
269
269
  schema = schema.required();
270
270
  }
271
+ if (typedef.default) {
272
+ schema = schema.default(typedef.default);
273
+ }
271
274
  if (typedef.validate?.schema) {
272
275
  schema = schema.append(typedef.validate.schema);
273
276
  } else if (typeof typedef.validate === 'function') {
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.js"],"names":[],"mappings":"AAyEA,kDAEC;AAED,oEA8EC;AAsBD,wEAkBC;AA0QD;;;EAEC;AAED;;;EAOC;AAtcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIG"}
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.js"],"names":[],"mappings":"AAyEA,kDAEC;AAED,oEA8EC;AAsBD,wEAkBC;AA6QD;;;EAEC;AAED;;;EAOC;AAzcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIG"}