@dnax/core 0.1.17 → 0.1.18

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/lib/schema.ts CHANGED
@@ -124,7 +124,9 @@ function buildSchema(col: Collection) {
124
124
  if (!f?.validate?.schema) {
125
125
  if (f?.nullable) {
126
126
  propertySchema[f.name] = propertySchema[f.name].optional();
127
- } else {
127
+ }
128
+
129
+ if(f?.required){
128
130
  if(!f?.type?.match(/(random)/))
129
131
  propertySchema[f.name] = propertySchema[f.name].required();
130
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "devDependencies": {
package/types/index.ts CHANGED
@@ -96,6 +96,7 @@ export type Field = {
96
96
  multiple?: boolean;
97
97
  items: Array<any>;
98
98
  };
99
+ required?: boolean;
99
100
  nullable?: boolean;
100
101
  defaultValue?: any;
101
102
  unique?: boolean;