Skip to content

Commit 8df6df7

Browse files
committedApr 25, 2024
fix(zod): missing zod prefix
1 parent 77e1961 commit 8df6df7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎packages/zod/src/index.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ const generateZodValidationSchemaDefinition = (
161161
const separator = schema.allOf
162162
? 'allOf'
163163
: schema.oneOf
164-
? 'oneOf'
165-
: 'anyOf';
164+
? 'oneOf'
165+
: 'anyOf';
166166

167167
const schemas = (schema.allOf ?? schema.oneOf ?? schema.anyOf) as (
168168
| SchemaObject
@@ -374,7 +374,9 @@ ${Object.entries(args)
374374

375375
consts += input.consts.join('\n');
376376

377-
const zod = input.functions.map(parseProperty).join('');
377+
const value = input.functions.map(parseProperty).join('');
378+
379+
const zod = `${value.startsWith('.') ? 'zod' : ''}${value}`;
378380

379381
return { zod, consts };
380382
};

0 commit comments

Comments
 (0)
Please sign in to comment.