Skip to content

Replace "any" types with "object" in errors and add types to OAuthError #3

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

Open
wants to merge 3 commits into
base: v5.0-dev
Choose a base branch
from

Conversation

GasimGasimzada
Copy link

@GasimGasimzada GasimGasimzada commented Sep 11, 2019

Typescript "any" type allows anything (it can also be a string or a function etc). However, "object" type must be enforced on the properties argument because object destructuring is used to merge user sent properties with its internal properties.

Typescript has "object" type (https://www.typescriptlang.org/docs/handbook/basic-types.html#object); so, we can enforce using objects.

Additionally, I added types to OAuthError. All error classes inherited from OAuthError has name and code in properties. So, I added these types to OAuthError properties with excess property checking to allow additional attributes.

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