For type safety we should avoid union of types e.g. accepts an empty string or optional. We should not put things like an empty string into the database
|
.or(z.literal('')) |
|
.optional(), |
We should add default values to our forms to avoid having errors like:

We should avoid doing just z.string() as that will accept an empty string. Currently we can add a network without a name

Note: These would apply across the codebase but just one example
For type safety we should avoid union of types e.g. accepts an empty string or optional. We should not put things like an empty string into the database
samui-wallet/packages/db/src/network/network-schema.ts
Lines 10 to 11 in a3a5deb
We should add default values to our forms to avoid having errors like:

We should avoid doing just

z.string()as that will accept an empty string. Currently we can add a network without a nameNote: These would apply across the codebase but just one example