zod icon indicating copy to clipboard operation
zod copied to clipboard

fails to parse "Proxy" object

Open 7flash opened this issue 3 years ago • 1 comments

const WalletProvider = z.object({
    request: z.function(),
    on: z.function(),
});

Following object expected to parse accordingly to schema above..

image

But fails with unexpected error..

image

7flash avatar Aug 01 '22 09:08 7flash

It works:

z.any().parse(p);

But it throws with error as above:

WalletProvider.parse(p);

7flash avatar Aug 01 '22 09:08 7flash