astro-loader-pocketbase 2.2.0-next.2 → 2.2.0
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/README.md +1 -1
- package/package.json +1 -1
- package/src/utils/parse-schema.ts +0 -2
package/README.md
CHANGED
|
@@ -110,7 +110,7 @@ It's recommended to use e.g. the title of the entry to be easily searchable and
|
|
|
110
110
|
|
|
111
111
|
### Improved types
|
|
112
112
|
|
|
113
|
-
By default PocketBase reports `number` and `boolean` fields as not required, even though the API will always return
|
|
113
|
+
By default PocketBase reports `number` and `boolean` fields as not required, even though the API will always return `0` and `false` respectively if no value is set.
|
|
114
114
|
This means that the loader will add `undefined` to the type of these fields.
|
|
115
115
|
If you want to enforce that these fields are always present, you can set the `improveTypes` option to `true`.
|
|
116
116
|
|
package/package.json
CHANGED
|
@@ -25,11 +25,9 @@ export function parseSchema(
|
|
|
25
25
|
// Determine the field type and create the corresponding Zod type
|
|
26
26
|
switch (field.type) {
|
|
27
27
|
case "number":
|
|
28
|
-
// Coerce the value to a number
|
|
29
28
|
fieldType = z.number();
|
|
30
29
|
break;
|
|
31
30
|
case "bool":
|
|
32
|
-
// Coerce the value to a boolean
|
|
33
31
|
fieldType = z.boolean();
|
|
34
32
|
break;
|
|
35
33
|
case "date":
|