Skip to content

Commit fb145e3

Browse files
committed
feat: allow paramas to have optional schema
1 parent 18aca9b commit fb145e3

File tree

1 file changed

+9
-3
lines changed
  • packages/better-fetch/src/create-fetch

1 file changed

+9
-3
lines changed

packages/better-fetch/src/create-fetch/schema.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ export type FetchSchema = {
55
input?: ZodSchema;
66
output?: ZodSchema;
77
query?: ZodSchema;
8-
params?: z.ZodObject<{
9-
[key: string]: ZodSchema;
10-
}>;
8+
params?:
9+
| z.ZodObject<{
10+
[key: string]: ZodSchema;
11+
}>
12+
| z.ZodOptional<
13+
z.ZodObject<{
14+
[key: string]: ZodSchema;
15+
}>
16+
>;
1117
method?: Methods;
1218
};
1319

0 commit comments

Comments
 (0)