router.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. var __defProp = Object.defineProperty;
  2. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  3. var __getOwnPropNames = Object.getOwnPropertyNames;
  4. var __hasOwnProp = Object.prototype.hasOwnProperty;
  5. var __export = (target, all) => {
  6. for (var name in all)
  7. __defProp(target, name, { get: all[name], enumerable: true });
  8. };
  9. var __copyProps = (to, from, except, desc) => {
  10. if (from && typeof from === "object" || typeof from === "function") {
  11. for (let key of __getOwnPropNames(from))
  12. if (!__hasOwnProp.call(to, key) && key !== except)
  13. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  14. }
  15. return to;
  16. };
  17. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  18. var router_exports = {};
  19. __export(router_exports, {
  20. MESSAGE_MATCHER_IS_ALREADY_BUILT: () => MESSAGE_MATCHER_IS_ALREADY_BUILT,
  21. METHODS: () => METHODS,
  22. METHOD_NAME_ALL: () => METHOD_NAME_ALL,
  23. METHOD_NAME_ALL_LOWERCASE: () => METHOD_NAME_ALL_LOWERCASE,
  24. UnsupportedPathError: () => UnsupportedPathError
  25. });
  26. module.exports = __toCommonJS(router_exports);
  27. const METHOD_NAME_ALL = "ALL";
  28. const METHOD_NAME_ALL_LOWERCASE = "all";
  29. const METHODS = ["get", "post", "put", "delete", "options", "patch"];
  30. const MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built.";
  31. class UnsupportedPathError extends Error {
  32. }
  33. // Annotate the CommonJS export names for ESM import in node:
  34. 0 && (module.exports = {
  35. MESSAGE_MATCHER_IS_ALREADY_BUILT,
  36. METHODS,
  37. METHOD_NAME_ALL,
  38. METHOD_NAME_ALL_LOWERCASE,
  39. UnsupportedPathError
  40. });