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

Redundant code #1

Open
ArthurZC23 opened this issue May 29, 2019 · 1 comment
Open

Redundant code #1

ArthurZC23 opened this issue May 29, 2019 · 1 comment

Comments

@ArthurZC23
Copy link

When throwing an error in the getJwks method because the status code isn't right, we have the following argument for the JwksError: res.body && (res.body.message || res.body) || res.statusMessage || Http Error ${res.statusCode}``.

By set logic res.body && (res.body.message || res.body) will always be res.body. Therefore, either (res.body.message || res.body) is not necessary or we should change one of the logic operators.

@afhole
Copy link

afhole commented Aug 13, 2019

I don't believe this is redundant, e.g.:

res = { body: {} }
res.body && (res.body.message || res.body)
//{}
res = { body: { message: 'hello' } }
res.body && (res.body.message || res.body)
//"hello"

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

No branches or pull requests

2 participants