express-allow-methods
Version:
Express middleware for sending HTTP 405 Method Not Allowed response
18 lines • 601 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const methods_1 = __importDefault(require("./methods"));
/** @internal */
function hint(method) {
let hint = "";
if_wrong_case: {
const uppercase = method.toUpperCase();
if (methods_1.default.has(uppercase))
hint = `Did you mean "${uppercase}"?`;
}
return hint && (" " + hint);
}
exports.default = hint;
//# sourceMappingURL=hint.impl.js.map