Files
memecoin-botV2/.pnpm-store/v10/files/a5/d8a53bde77a83f15b8bdcea1455be66f8d3f50bcc0b78785496299da63521b76b5a327a9555f290c0a5ef8eaa71c186da50a07780603997ca3c4a41e5ebe84

44 lines
867 B
Plaintext

import { expect, test } from "vitest";
import * as z from "zod/mini";
declare module "zod/v4/core" {
interface $ZodType {
/** @deprecated */
_core(): string;
}
}
test("prototype extension", () => {
z.core.$ZodType.prototype._core = function () {
return "_core";
};
// should pass
const result = z.string()._core();
expect(result).toBe("_core");
// expectTypeOf<typeof result>().toEqualTypeOf<string>();
// clean up
z.ZodMiniType.prototype._core = undefined;
});
declare module "zod/v4/mini" {
interface ZodMiniType {
/** @deprecated */
_mini(): string;
}
}
test("prototype extension", () => {
z.ZodMiniType.prototype._mini = function () {
return "_mini";
};
// should pass
const result = z.string()._mini();
expect(result).toBe("_mini");
// clean up
z.ZodMiniType.prototype._mini = undefined;
});