UNPKG

@js-thing/http-status-codes

Version:

Contains properly documented HTTP status code enums, reason phrases and helpers as defined in RFC

12 lines 450 B
import { HttpStatusCodes } from '../HttpStatusCodes'; import { HttpReasonPhrases } from '../HttpReasonPhrases'; /** * Get the reason phrase for a given status code * * @param statusCode - e.g. 200 * @returns - The corresponding reason phrase as `string` for the given input `undefined` otherwise */ export default (function (statusCode) { return HttpReasonPhrases[HttpStatusCodes[statusCode]]; }); //# sourceMappingURL=getReasonPhrase.js.map