import type { IRouterResult, IRouter } from '@iopa/types' import { Node } from './node' export class TrieRouter implements IRouter { public node: Node public constructor() { this.node = new Node() } public add(method: string, path: string, handler: T): void { this.node.insert(method, path, handler) } public match(method: string, path: string): IRouterResult | null { return this.node.search(method, path) } }