tablinum 0.6.3 → 0.6.4

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/dist/index.js CHANGED
@@ -401,7 +401,8 @@ function fieldDefToSchema(fd) {
401
401
  case "object": {
402
402
  const nested = {};
403
403
  for (const [k, v] of Object.entries(fd.fields)) {
404
- nested[k] = fieldDefToSchema(v);
404
+ const fieldSchema = fieldDefToSchema(v);
405
+ nested[k] = v.isOptional ? Schema3.optionalKey(fieldSchema) : fieldSchema;
405
406
  }
406
407
  base = Schema3.Struct(nested);
407
408
  break;
@@ -438,7 +438,8 @@ function fieldDefToSchema(fd) {
438
438
  case "object": {
439
439
  const nested = {};
440
440
  for (const [k, v] of Object.entries(fd.fields)) {
441
- nested[k] = fieldDefToSchema(v);
441
+ const fieldSchema = fieldDefToSchema(v);
442
+ nested[k] = v.isOptional ? Schema4.optionalKey(fieldSchema) : fieldSchema;
442
443
  }
443
444
  base = Schema4.Struct(nested);
444
445
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tablinum",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/kevmodrome/tablinum.git",