import { OptionalIR, SchemaIR } from "../../types.js"; import { FastGen, SlowGen } from "../context.js"; //#region src/core/codegen/schemas/optional.d.ts /** * Zod's `.optional()` short-circuits `undefined → undefined`, EXCEPT when its * inner chain applies a default to undefined: `z.string().default("d").optional()` * yields "d", not undefined (the default fires THROUGH the optional, and through * any nullable/optional wrappers between them — `default().nullish()`, * `default().optional().nullable()`, ...). Only `default` consumes undefined into * a value; `catch`, object-field defaults, and plain types do not, so the optional * legitimately short-circuits there. Peel optional/nullable wrappers to decide. */ declare function innerAppliesDefaultOnUndefined(ir: SchemaIR): boolean; declare function slowOptional(ir: SchemaIR & { type: "optional"; }, g: SlowGen): string; declare function fastOptional(ir: OptionalIR, g: FastGen): string | null; //#endregion export { fastOptional, innerAppliesDefaultOnUndefined, slowOptional }; //# sourceMappingURL=optional.d.ts.map