mirror of
https://github.com/morluto/rea.git
synced 2026-11-09 00:07:18 +00:00
fix(contracts): align CLI omission and native capability coverage
This commit is contained in:
1 parent
4a8205456c
commit
2b84efe0da
8 files changed
+162
-95
No files matched your search
@@ -40,9 +40,10 @@ const withOmittableDefaults = (schema: z.ZodObject): z.ZodObject => {
|
||||
);
|
||||
};
|
||||
|
||||
/** Zod accepts an omitted value (`optin`) but always produces one (`optout`). */
|
||||
/** Let the object parser decide omission; Incur advertises required outputs. */
|
||||
const fillsOmission = (field: z.ZodType): boolean =>
|
||||
field._zod.optin === "optional" && field._zod.optout === undefined;
|
||||
field._zod.optout === undefined &&
|
||||
z.object({ value: field }).safeParse({}).success;
|
||||
|
||||
const optionalWithMetadata = (field: z.ZodType): z.ZodType => {
|
||||
const metadata = field.meta();
|
||||
|
||||
Reference in new issue
Block a user