Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor(types): update types to be more concise #314

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

Merged
jankapunkt merged 2 commits into node-oauth:master from dhensby:pulls/typings
Jul 31, 2024

Conversation

@dhensby
Copy link
Contributor

@dhensby dhensby commented Jul 25, 2024

  1. Don't use | undefined for props that are already declared optional (undefined is an implied value)
  2. prefer using the Record built-in type over object maps

Copy link
Member

@jorenvandeweyer jorenvandeweyer left a comment

Choose a reason for hiding this comment

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

FYI: optional is not the same as undefined, by removing this, passing an undefined value is not allowed anymore.

Copy link
Contributor Author

dhensby commented Jul 30, 2024

FYI: optional is not the same as undefined, by removing this, passing an undefined value is not allowed anymore.

I'm almost certain that's not right: https://www.typescriptlang.org/play/?#code/JYOwLgpgTgZghgYwgAgCoQM5mQbwFDKHIAOUA9sdGAJ4D8AXMllKAOYDceAvnngmSCzJIWRuiEBeXCXKUoNRgFcQAEwgxQEFci6cgA

This doesn't give a syntax error

Copy link
Member

Just a question related to #309 - shouldn't scope for the authenticate handler now being

scope?: string | string[]

as the auth handler now supports both? Neither see this here, nor in the current master after merging #309. I hope I don't cause confusion with this question now 🙈

Copy link
Contributor Author

dhensby commented Jul 31, 2024

It was off the back of this comment that I made the type just string[].

Basically the types reflect the ideal typings and not an enumeration of every single type that could be accepted. By limiting the type this way, we also make the upgrade path for those following the types easier if/when we remove the string support. It's also not a breaking change as it's the current typing, so we aren't introducing any new issues by leaving the typing like this.

jankapunkt reacted with thumbs up emoji

Copy link
Member

From my end it's ok but I'm only using a few of them for my IDE intellisense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jankapunkt jankapunkt jankapunkt approved these changes

@jorenvandeweyer jorenvandeweyer jorenvandeweyer approved these changes

@Uzlopak Uzlopak Awaiting requested review from Uzlopak

@HappyZombies HappyZombies Awaiting requested review from HappyZombies

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /