Skip to content

Commit 4f2398e

Browse files
authored
rm braces from findNestedSchema (#2970)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - Refactor - Simplified internal logic for deep validation checks, reducing verbosity while preserving existing behavior, error handling, and override logic. This improves readability and maintainability without changing outcomes or performance characteristics. - No User-Facing Changes - No impact on APIs, configuration, or outputs. No migration required. - Tests - Existing behavior remains consistent; no test changes required. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent ed19146 commit 4f2398e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

express-zod-api/src/deep-checks.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,14 @@ export const findNestedSchema = (
2121
{ io, condition }: NestedSchemaLookupProps,
2222
) =>
2323
R.tryCatch(
24-
() => {
25-
z.toJSONSchema(subject, {
24+
() =>
25+
void z.toJSONSchema(subject, {
2626
io,
2727
unrepresentable: "any",
2828
override: ({ zodSchema }) => {
2929
if (condition(zodSchema)) throw new DeepCheckError(zodSchema); // exits early
3030
},
31-
});
32-
return undefined;
33-
},
31+
}),
3432
(err: DeepCheckError) => err.cause,
3533
)();
3634

0 commit comments

Comments
 (0)