Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinraja committed Aug 16, 2023
1 parent 6fff0e8 commit ba0be8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ import {
const { factory: f, SyntaxKind } = ts

const callGetType = (
zod: ZodTypeAny & GetType,
zod: ZodTypeAny,
identifier: string,
options: ZodToTsOptions,
options: ResolvedZodToTsOptions,
) => {
let type: ReturnType<GetTypeFunction> | undefined

const getTypeSchema = zod as GetType
// this must be called before accessing 'type'
if (zod._def.getType) type = zod._def.getType(ts, identifier, options)
if (getTypeSchema._def.getType) type = getTypeSchema._def.getType(ts, identifier, options)
return type
}

Expand Down
1 change: 1 addition & 0 deletions test/example.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { z } from 'zod'
import { printNode, withGetType, zodToTs } from '../src'

Expand Down

0 comments on commit ba0be8c

Please sign in to comment.