Files
SnowLuma/.pnpm-store/v11/files/36/5fcf73f3f3d9ebca81aee91e90c5b3ae7e7f1c6e46fb52c5c9cffb9dac8245e5256ac54d7f690069ad1e6a5a48e92d490908b3ff838acd9b094b617eb8ab05
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

16 lines
453 B
Plaintext

import { checkOptionalParameter } from "../../utils/url.js";
import { Node } from "./node.js";
//#region src/router/trie-router/router.ts
var TrieRouter = class {
name = "TrieRouter";
#node = new Node();
add(method, path, handler) {
for (const result of checkOptionalParameter(path) || [path]) this.#node.insert(method, result, handler);
}
match(method, path) {
return this.#node.search(method, path);
}
};
//#endregion
export { TrieRouter };