From 21b170642e89bb8a96d812057230526a744b7e3c Mon Sep 17 00:00:00 2001 From: Isaac Way Date: Sun, 12 Mar 2023 17:09:34 -0500 Subject: [PATCH 1/2] Removes enum deprecation warning --- src/logging.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/logging.ts b/src/logging.ts index ee4a0ef..828fab7 100644 --- a/src/logging.ts +++ b/src/logging.ts @@ -19,16 +19,8 @@ export function duplicateTypeError() { ); } -export function printWarningsForSchema(type: RTFSupportedZodTypes) { - if ( - !shownWarnings.enum && - type._def.typeName === ZodFirstPartyTypeKind.ZodEnum - ) { - err( - "support for z.enum() is deprecated and will be removed in future versions. Prefer z.string() / z.number() etc for dropdowns, selects, and radio buttons. \nSee https://github.com/iway1/react-ts-form/blob/main/field-examples.md for examples" - ); - shownWarnings.enum = true; - } +export function printWarningsForSchema(_type: RTFSupportedZodTypes) { + // placeholder in case we need future schema warnings } export function printUseEnumWarning() { From 8f8516887f14044cfc78b1ad6d0d922c491f40c5 Mon Sep 17 00:00:00 2001 From: Isaac Way Date: Sun, 12 Mar 2023 17:10:25 -0500 Subject: [PATCH 2/2] remove improt --- src/logging.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/logging.ts b/src/logging.ts index 828fab7..51d8cfd 100644 --- a/src/logging.ts +++ b/src/logging.ts @@ -1,4 +1,3 @@ -import { ZodFirstPartyTypeKind } from "zod"; import { RTFSupportedZodTypes } from "./supportedZodTypes"; const shownWarnings = {