@dnax/core 0.1.0 → 0.1.2

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/lib/schema.ts +3 -6
  2. package/package.json +1 -1
package/lib/schema.ts CHANGED
@@ -46,11 +46,11 @@ function buildSchema(col: Collection) {
46
46
  }
47
47
 
48
48
  if (f?.type == "relationship" && f.relationType == "ref-to-one") {
49
- propertySchema[f.name] = v.string();
49
+ propertySchema[f.name] = v.string().optional();
50
50
  }
51
51
 
52
52
  if (f?.type == "relationship" && f.relationType == "ref-to-many") {
53
- propertySchema[f.name] = v.array();
53
+ propertySchema[f.name] = v.array().optional();
54
54
  }
55
55
 
56
56
  if (f?.type?.match(/(date)/)) {
@@ -121,10 +121,7 @@ function buildSchema(col: Collection) {
121
121
 
122
122
  if (!f?.validate?.schema) {
123
123
  if (f?.nullable) {
124
- propertySchema[f.name] = propertySchema[f.name]?.allow([
125
- null,
126
- undefined,
127
- ]);
124
+ propertySchema[f.name] = propertySchema[f.name];
128
125
  } else {
129
126
  propertySchema[f.name] = propertySchema[f.name].required();
130
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "devDependencies": {