From ba0be8cd858125f1ace81274c65d5d5f1ae48d07 Mon Sep 17 00:00:00 2001 From: Sachin Raja Date: Wed, 16 Aug 2023 09:16:22 -0700 Subject: [PATCH] fix lint --- src/index.ts | 7 ++++--- test/example.ts | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index e11f8cc..6aa2885 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 | 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 } diff --git a/test/example.ts b/test/example.ts index 05bc90a..2b80422 100644 --- a/test/example.ts +++ b/test/example.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ import { z } from 'zod' import { printNode, withGetType, zodToTs } from '../src'