1+ import { EmptyObject } from "../_utils" ;
12import type { RouterContext , ParamsIndexMap } from "../types" ;
23import { splitPath } from "./_utils" ;
34
4- const NodeStaticMap = /* @__PURE__ */ ( ( ) => {
5- const C = function ( ) { } ;
6- C . prototype = Object . create ( null ) ;
7- return C ;
8- } ) ( ) as unknown as { new ( ) : Record < string , any > } ;
9-
10- const NodeMethodsMap = /* @__PURE__ */ ( ( ) => {
11- const C = function ( ) { } ;
12- C . prototype = Object . create ( null ) ;
13- return C ;
14- } ) ( ) as unknown as { new ( ) : Record < string , any > } ;
15-
165/**
176 * Add a route to the router context.
187 */
@@ -71,7 +60,7 @@ export function addRoute<T>(
7160 } else {
7261 const staticNode = { key : segment } ;
7362 if ( ! node . static ) {
74- node . static = new NodeStaticMap ( ) ;
63+ node . static = new EmptyObject ( ) ;
7564 }
7665 node . static ! [ segment ] = staticNode ;
7766 node = staticNode ;
@@ -81,7 +70,7 @@ export function addRoute<T>(
8170 // Assign index, params and data to the node
8271 const hasParams = paramsMap . length > 0 ;
8372 if ( ! node . methods ) {
84- node . methods = new NodeMethodsMap ( ) ;
73+ node . methods = new EmptyObject ( ) ;
8574 }
8675 if ( ! node . methods ! [ method ] ) {
8776 node . methods ! [ method ] = [ ] ;
0 commit comments