From f66de3f0607cea2af0f4564a0fdf50e9d0d866e6 Mon Sep 17 00:00:00 2001 From: Anna Bocharova Date: Sat, 4 May 2024 13:42:03 +0200 Subject: [PATCH] Removing the deprecated withMeta() (#1726) Due to #1719 --- CHANGELOG.md | 2 ++ src/index.ts | 1 - src/metadata.ts | 6 ------ tests/unit/__snapshots__/index.spec.ts.snap | 3 --- tests/unit/metadata.spec.ts | 11 ----------- 5 files changed, 2 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb24c3b66..cf26497a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ - Minimum supported versions: - Node: 18.18.0 or 20.9.0, - `zod`: 3.23.0. +- The deprecated ~~`withMeta()`~~ is removed: + - See the changes to [v18.5.0](#v1850) on details. ## Version 18 diff --git a/src/index.ts b/src/index.ts index c8a143655..950a1b923 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,7 +28,6 @@ export { InputValidationError, MissingPeerError, } from "./errors"; -export { withMeta } from "./metadata"; export { testEndpoint } from "./testing"; export { Integration } from "./integration"; diff --git a/src/metadata.ts b/src/metadata.ts index f3a08f4f5..e83000022 100644 --- a/src/metadata.ts +++ b/src/metadata.ts @@ -115,9 +115,3 @@ export const proprietary = ( export const isProprietary = (schema: z.ZodTypeAny, kind: ProprietaryKind) => getMeta(schema, "kind") === kind; - -/** - * @deprecated no longer required - * @todo remove in v19 - * */ -export const withMeta = (schema: T) => schema; diff --git a/tests/unit/__snapshots__/index.spec.ts.snap b/tests/unit/__snapshots__/index.spec.ts.snap index fac2b0574..fed50bd21 100644 --- a/tests/unit/__snapshots__/index.spec.ts.snap +++ b/tests/unit/__snapshots__/index.spec.ts.snap @@ -115,7 +115,6 @@ exports[`Index Entrypoint > exports > should have certain entities exposed 1`] = "OutputValidationError", "InputValidationError", "MissingPeerError", - "withMeta", "testEndpoint", "Integration", "ez", @@ -123,5 +122,3 @@ exports[`Index Entrypoint > exports > should have certain entities exposed 1`] = `; exports[`Index Entrypoint > exports > testEndpoint should have certain value 1`] = `[Function]`; - -exports[`Index Entrypoint > exports > withMeta should have certain value 1`] = `[Function]`; diff --git a/tests/unit/metadata.spec.ts b/tests/unit/metadata.spec.ts index 33a6cc824..8d372bcfd 100644 --- a/tests/unit/metadata.spec.ts +++ b/tests/unit/metadata.spec.ts @@ -1,19 +1,8 @@ -import { expectType } from "tsd"; import { z } from "zod"; -import { withMeta } from "../../src"; import { copyMeta, getMeta, hasMeta, metaSymbol } from "../../src/metadata"; import { describe, expect, test } from "vitest"; describe("Metadata", () => { - describe("withMeta()", () => { - test("should be present for backward compatibility", () => { - const schema = z.string(); - const schemaWithMeta = withMeta(schema); - expect(schemaWithMeta).toEqual(schema); - expectType(schemaWithMeta); - }); - }); - describe(".example()", () => { test("should be present", () => { const schema = z.string();