@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.
- package/package.json +1 -1
- package/value/create.js +8 -0
package/package.json
CHANGED
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;
|