Files
SnowLuma/.pnpm-store/v11/files/e6/b721161822fee153c4f44d4a1c0dc01ea04335b89220d2fc1ca237afd32348c2380d0d3877e52c38ebaed2a6b90f7552fb29daf56d5998d82824d9a11336e9
TanTan 2a69b23b47
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

20 lines
594 B
Plaintext

import "../../router.js";
//#region src/router/reg-exp-router/matcher.ts
const emptyParam = [];
function match(method, path) {
const matchers = this.buildAllMatchers();
const match = ((method, path) => {
const matcher = matchers[method] || matchers["ALL"];
const staticMatch = matcher[2][path];
if (staticMatch) return staticMatch;
const match = path.match(matcher[0]);
if (!match) return [[], emptyParam];
const index = match.indexOf("", 1);
return [matcher[1][index], match];
});
this.match = match;
return match(method, path);
}
//#endregion
export { emptyParam, match };