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 typescript types for fetcher #231

Merged
merged 3 commits into from
Mar 12, 2021
Merged

Conversation

itajaja
Copy link
Contributor

@itajaja itajaja commented Mar 12, 2021

fetcher shouldn't really return a SigningKey, becuase that's a complex instance with methods. there might be a better signature than any but I think this is good enough considering the scope of this (ie we don't want to define all possible fields of a jwk)

reopened from #230

@itajaja itajaja requested a review from a team as a code owner March 12, 2021 19:29
@meeq
Copy link

meeq commented Mar 12, 2021

Consider using the unknown type instead:

unknown is the type-safe counterpart of any. Anything is assignable to unknown, but unknown isn’t assignable to anything but itself and any without a type assertion or a control flow based narrowing. Likewise, no operations are permitted on an unknown without first asserting or narrowing to a more specific type.

@itajaja
Copy link
Contributor Author

itajaja commented Mar 15, 2021

@meeq you are totally right, unknown would have been the right type. since fetcher is a function that as a client you are not suppose to use, but just to set, the "damage" of having it as any is somewhat reduced, because you are not supposed to call the fetcher method in the first place

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

Successfully merging this pull request may close these issues.

None yet

3 participants