@sinclair/typebox 0.24.29 → 0.24.30

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/package.json +1 -1
  2. package/value/create.js +8 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sinclair/typebox",
3
- "version": "0.24.29",
3
+ "version": "0.24.30",
4
4
  "description": "JSONSchema Type Builder with Static Type Resolution for TypeScript",
5
5
  "keywords": [
6
6
  "typescript",
package/value/create.js CHANGED
@@ -213,6 +213,14 @@ var ValueCreate;
213
213
  return schema.default;
214
214
  }
215
215
  }
216
+ else if (schema.format !== undefined) {
217
+ if (schema.default === undefined) {
218
+ throw new Error('ValueCreate.String: String types with formats must specify a default value');
219
+ }
220
+ else {
221
+ return schema.default;
222
+ }
223
+ }
216
224
  else {
217
225
  if (schema.default !== undefined) {
218
226
  return schema.default;