Skip to content

Commit

Permalink
3.23.5
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhacks committed Apr 29, 2024
1 parent c1910bd commit 541a862
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions deno/lib/__tests__/enum.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,8 @@ test("error map in extract/exclude", () => {
);
}
});

test("readonly in ZodEnumDef", () => {
let _t!: z.ZodEnumDef<readonly ["a", "b"]>;
_t;
});
2 changes: 1 addition & 1 deletion deno/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4139,7 +4139,7 @@ export class ZodLiteral<T> extends ZodType<T, ZodLiteralDef<T>, T> {
export type ArrayKeys = keyof any[];
export type Indices<T> = Exclude<keyof T, ArrayKeys>;

export type EnumValues<T extends string = string> = [T, ...T[]];
export type EnumValues<T extends string = string> = readonly [T, ...T[]];

export type Values<T extends EnumValues> = {
[k in T[number]]: k;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zod",
"version": "3.23.4",
"version": "3.23.5",
"author": "Colin McDonnell <colin@colinhacks.com>",
"repository": {
"type": "git",
Expand Down
5 changes: 5 additions & 0 deletions src/__tests__/enum.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,8 @@ test("error map in extract/exclude", () => {
);
}
});

test("readonly in ZodEnumDef", () => {
let _t!: z.ZodEnumDef<readonly ["a", "b"]>;
_t;
});

0 comments on commit 541a862

Please sign in to comment.