writeable: (
...a: [
type: | $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>
| ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>,
],
) => string
Type declaration
- (
...a: [
type: | $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>
| ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>,
],
): string Parameters
- ...a: [
type: | $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>
| ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>,
]
Returns string
zx.deepReadonly.writeableConvenience function that composes
zx.deepReadonlyandzx.toString.This option is useful when you have particularly large schemas, and are starting to feel the TS compiler drag. With
deepReadonly.writeable, you can pay that price one by writing the new schema to disc.Keep in mind that the most expensive part of the transformation is at the type-level; writing to disc solves that problem, but introduces a syncing problem, so if you don't "own" the schema, make sure you've at least thought about what you'll do when the schema inevitably changes.