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: accommodate for optional properties in index signature #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

olistic
Copy link

@olistic olistic commented Jun 26, 2023

Description

This is an alternative to #86, which fixes the index signatures not supporting optional (undefined) values.

#86 modifies the Json type adding undefined to it, which may be considered not technically correct. This PR proposes an alternative way that doesn't touch the Json type.

Type of Change

  • Bug fix

Does this introduce a breaking change?

No.

Are documentation updates required?

No.

Testing information

Build the project and verify the TS compiler doesn't show errors in decode.d.ts for optional properties. Example:

Property 'alg' of type 'string | undefined' is not assignable to 'string' index type 'Json'.

Checklist

  • Code is commented where needed
  • Unit test coverage for new or modified code paths
  • npm run test passes
  • Changelog is updated
  • Tag 1 of @person1 or @Person2

@CLAassistant
Copy link

CLAassistant commented Jun 26, 2023

CLA assistant check
All committers have signed the CLA.

@olistic
Copy link
Author

olistic commented Aug 12, 2024

@janniks anything else I can do to help landing this?

@janniks
Copy link
Collaborator

janniks commented Aug 13, 2024

I think it looks good 👍🏻 Thanks for the ping. I'll add a second reviewer as well.

Copy link
Collaborator

@janniks janniks left a comment

Choose a reason for hiding this comment

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

I don't see why this should be a problem. @zone117x any thoughts?

@olistic
Copy link
Author

olistic commented Oct 6, 2024

@janniks @zone117x can this be merged (and ideally released)? :)

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.

4 participants