http-status-codes icon indicating copy to clipboard operation
http-status-codes copied to clipboard

Make ReasonPhrases compatible with codes as keys.

Open james-pre opened this issue 1 year ago • 1 comments

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 avatar Apr 16 '23 19:04 james-pre

@prettymuchbryce Any updates on this?

james-pre avatar May 04 '24 15:05 james-pre