Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TS inconsistency (parse method never returns undefined). #215

Closed
wants to merge 1 commit into from
Closed

Fix TS inconsistency (parse method never returns undefined). #215

wants to merge 1 commit into from

Conversation

davidesigner
Copy link

In this PR: #179, undefined was added to the type definition and code, then the code was refactored but the type definition was not updated. See the review here: #179 (comment) to understand the history.

@blakeembrey
Copy link
Member

Thanks for the PR, but it's correct that decode can return undefined and trying to remove it now would be a breaking change. What you are referring to is the default behavior, which I left designed to mimic 0.x, but the type definition does allow an application to specifically set the decode behavior I wrote in the PR initially in case they wanted to discard values they don't understand.

This is much more relevant when people might want to replace decoding with e.g. base64url.

@blakeembrey blakeembrey closed this Dec 6, 2024
@davidesigner davidesigner deleted the patch-1 branch December 6, 2024 22:40
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