UNPKG

readable-http-codes

Version:

0 dependency readable HTTP code enums, cleaning up your codebase!

7 lines (6 loc) 298 B
import { statusTextMap, statusTextMapWithPrefix } from '../constants'; export var getStatusText = function (statusCode, hasPrefix) { if (hasPrefix === void 0) { hasPrefix = false; } var statusText = hasPrefix ? statusTextMapWithPrefix : statusTextMap; return statusText[statusCode]; };