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

Make ReasonPhrases compatible with codes as keys. #96

Open
james-pre opened this issue Apr 16, 2023 · 1 comment
Open

Make ReasonPhrases compatible with codes as keys. #96

james-pre opened this issue Apr 16, 2023 · 1 comment

Comments

@james-pre
Copy link

Currently, we can use StatusCodes similar to a typescript enum like so:

console.log(StatusCodes.GONE); //411
console.log(StatusCodes[411]); //"Gone"

but this does not work with ReasonPhrases:

console.log(ReasonPhrases.GONE); //"Gone"
console.log(ReasonPhrases[411]); //undefined

We should be able to use ReasonPhrases[code]

@james-pre
Copy link
Author

@prettymuchbryce Any updates on this?

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

No branches or pull requests

2 participants