@js-thing/http-status-codes
Version:
Contains properly documented HTTP status code enums, reason phrases and helpers as defined in RFC
11 lines (10 loc) • 430 B
TypeScript
declare const _default: (reasonPhrase: string, ignoreCase?: boolean) => number | undefined;
/**
* Get the status code for a given reason phrase.
* Optionally pass a second parameter to ignore case.
*
* @param reasonPhrase - e.g. OK
* @param ignoreCase - ignore case while comparing, default: false
* @returns - The corresponding status code as `number` for the given input `undefined` otherwise
*/
export default _default;