@dnax/core 0.1.21 → 0.2.1
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 +4 -8
- package/package.json +1 -1
package/lib/schema.ts
CHANGED
|
@@ -82,15 +82,11 @@ function buildSchema(col: Collection) {
|
|
|
82
82
|
|
|
83
83
|
if (f?.type == "geojson") {
|
|
84
84
|
propertySchema[f.name] = v.object({
|
|
85
|
-
type: v
|
|
86
|
-
.string()
|
|
87
|
-
.valid(["Point", "LineString", "Polygon", "MultiPoint"]),
|
|
85
|
+
type: v.string().valid("Point", "LineString", "Polygon", "MultiPoint"),
|
|
88
86
|
coordinats: v.array().items(v.number()),
|
|
89
87
|
});
|
|
90
88
|
}
|
|
91
89
|
|
|
92
|
-
|
|
93
|
-
|
|
94
90
|
if (f?.type == "password") {
|
|
95
91
|
propertySchema[f.name] = v.string();
|
|
96
92
|
}
|
|
@@ -126,9 +122,9 @@ function buildSchema(col: Collection) {
|
|
|
126
122
|
propertySchema[f.name] = propertySchema[f.name].optional();
|
|
127
123
|
}
|
|
128
124
|
|
|
129
|
-
if(f?.required){
|
|
130
|
-
if(!f?.type?.match(/(random)/))
|
|
131
|
-
|
|
125
|
+
if (f?.required) {
|
|
126
|
+
if (!f?.type?.match(/(random)/))
|
|
127
|
+
propertySchema[f.name] = propertySchema[f.name].required();
|
|
132
128
|
}
|
|
133
129
|
}
|
|
134
130
|
});
|