Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions express-zod-api/src/mapping-helpers.ts

This file was deleted.

5 changes: 3 additions & 2 deletions express-zod-api/src/zod-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import * as R from "ramda";
import { z } from "zod/v4";
import { getExamples, metaSymbol } from "./metadata";
import { Intact, Remap } from "./mapping-helpers";
import type {
$ZodType,
$ZodShape,
Expand Down Expand Up @@ -39,6 +38,8 @@ declare module "zod/v4/core" {
}
}

export type Intact<T, U> = { [K in Exclude<keyof T, keyof U>]: T[K] };

declare module "zod/v4" {
interface ZodType<
out Output = unknown,
Expand Down Expand Up @@ -68,7 +69,7 @@ declare module "zod/v4" {
mapping: U,
): z.ZodPipe<
z.ZodPipe<this, z.ZodTransform>, // internal type simplified
z.ZodObject<Remap<Shape, U, V> & Intact<Shape, U>, Config>
z.ZodObject<R.Remap<Shape, U> & Intact<Shape, U>, Config>
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if it's actually exposed/resolved into the build

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not. but there is an option in tsup: dts.resolve, however, it's not documented how exactly it works (it does not)

>;
remap<U extends $ZodShape>(
mapper: (subject: Shape) => U,
Expand Down