Skip to content

Make stringEnum assume strictest type - #16

Merged
lazamar merged 1 commit into
mainfrom
stringEnum
Nov 26, 2025
Merged

Make stringEnum assume strictest type#16
lazamar merged 1 commit into
mainfrom
stringEnum

Conversation

@lazamar

@lazamar lazamar commented Nov 26, 2025

Copy link
Copy Markdown
Contributor

Allows us to drop the as const on every stringEnum call.

const d : Decoder<"a" | "b"> = stringEnum(["a", "b"] as const);

to

const d : Decoder<"a" | "b"> = stringEnum(["a", "b"]);

@EthanRBrown EthanRBrown left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome! Approved with vigor

@lazamar
lazamar merged commit 93be7c2 into main Nov 26, 2025
1 check passed
@ctuncay
ctuncay deleted the stringEnum branch January 29, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants