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 Nov 1, 2024
1 parent a7055f5 commit e8cc969
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 @@ -1177,11 +1177,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 @@ -141,8 +141,7 @@ export function generate({
);

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

const identifiers = getImportIdentifiers(node);
identifiers.forEach((i) =>
Expand Down

0 comments on commit e8cc969

Please sign in to comment.