UNPKG

736 BJavaScriptView Raw
1/**
2 * react-router v8.4.0
3 *
4 * Copyright (c) Remix Software Inc.
5 *
6 * This source code is licensed under the MIT license found in the
7 * LICENSE.md file in the root directory of this source tree.
8 *
9 * @license MIT
10 */
11import { flattenAndRankRoutes, matchRoutesImpl } from "./utils.js";
12//#region lib/router/matcher.ts
13var V6RegExMatcher = class {
14 #routes = [];
15 #branches = [];
16 #basename;
17 constructor(basename) {
18 this.#basename = basename;
19 }
20 update(routes) {
21 this.#routes = routes;
22 this.#branches = flattenAndRankRoutes(routes);
23 }
24 match(locationArg, allowPartial = false) {
25 return matchRoutesImpl(this.#routes, locationArg, this.#basename, allowPartial, this.#branches);
26 }
27};
28//#endregion
29export { V6RegExMatcher };