ts-to-zod icon indicating copy to clipboard operation
ts-to-zod copied to clipboard

The presence of standard built-in types (e.g. HTMLImageElement) causes the entire interface export to be empty

Open hlg-facai opened this issue 10 months ago • 1 comments

Bug description

The presence of HTMLImageElement causes the entire interface export to be empty

Input

export interface GoodsAssemblyImage {
    img?: HTMLImageElement;
}

Expected output

// Generated by ts-to-zod
import { z } from 'zod';

export const goodsAssemblyImageSchema = z.object({
    image: z.any(),
});

Actual output

// Generated by ts-to-zod
import { z } from 'zod';

Versions

  • Typescript: v5.2.22
  • Zod: v3.8.3

hlg-facai avatar Apr 15 '24 07:04 hlg-facai

There is a tentative implementation on #122

tvillaren avatar Apr 15 '24 12:04 tvillaren