cogsbox-shape 0.5.98 → 0.5.99
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/schema.js +2 -2
- package/package.json +1 -1
package/dist/schema.js
CHANGED
|
@@ -497,11 +497,11 @@ export function createSchema(schema, relations) {
|
|
|
497
497
|
const childSchemaResult = createSchema(relatedSchemaFactory());
|
|
498
498
|
let baseClientSchema;
|
|
499
499
|
if (sqlConfig.type === "hasMany" || sqlConfig.type === "manyToMany") {
|
|
500
|
-
baseClientSchema = z.array(childSchemaResult.clientSchema);
|
|
500
|
+
baseClientSchema = z.array(childSchemaResult.clientSchema).optional();
|
|
501
501
|
defaultValues[key] = Array.from({ length: sqlConfig.defaultCount || 0 }, () => childSchemaResult.defaultValues);
|
|
502
502
|
}
|
|
503
503
|
else {
|
|
504
|
-
baseClientSchema = childSchemaResult.clientSchema;
|
|
504
|
+
baseClientSchema = childSchemaResult.clientSchema.optional();
|
|
505
505
|
defaultValues[key] = childSchemaResult.defaultValues;
|
|
506
506
|
}
|
|
507
507
|
clientFields[key] = config.clientTransform
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cogsbox-shape",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.99",
|
|
4
4
|
"description": "A TypeScript library for creating type-safe database schemas with Zod validation, SQL type definitions, and automatic client/server transformations. Unifies client, server, and database types through a single schema definition, with built-in support for relationships and serialization.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|