Skip to content

Commit

Permalink
fix!: use default passed to generate (#215)
Browse files Browse the repository at this point in the history
* fix: use default passed to generate

* lint

* update text expectation
  • Loading branch information
deckchairlabs authored and tvillaren committed Nov 25, 2024
1 parent 7db07d5 commit 09d6ebf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1305,11 +1305,11 @@ describe("generate", () => {
"// Generated by ts-to-zod
import { z } from "zod";
import { heroSchema } from "${output}";
import { zHero } from "${output}";
export const zPerson = z.object({
id: z.number(),
hero: heroSchema
hero: zHero
});
"
`);
Expand Down
3 changes: 1 addition & 2 deletions src/core/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ export function generate({
);

if (eligibleMapping) {
const schemaMethod =
eligibleMapping.getSchemaName || DEFAULT_GET_SCHEMA;
const schemaMethod = eligibleMapping.getSchemaName || getSchemaName;

identifiers.forEach(({ name }) =>
importedZodNamesAvailable.set(name, schemaMethod(name))
Expand Down

0 comments on commit 09d6ebf

Please sign in to comment.