File tree 1 file changed +1
-9
lines changed 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -40,14 +40,6 @@ module.exports = (config = {}) => {
40
40
41
41
const routers = { }
42
42
43
- /**
44
- * Pre-create frozen empty objects for better performance and safety.
45
- * Use Object.create(null) for prototype pollution protection.
46
- * Frozen objects prevent accidental mutation that could cause cross-request state pollution.
47
- * These are reused across requests when no query params or route params are present.
48
- */
49
- const EMPTY_PARAMS = Object . freeze ( Object . create ( null ) )
50
-
51
43
/**
52
44
* Initialize LRU cache for route matching results with optimized settings.
53
45
* Cache keys are method+path combinations to speed up repeated lookups.
@@ -161,7 +153,7 @@ module.exports = (config = {}) => {
161
153
// Optimized parameter assignment with minimal overhead
162
154
if ( ! req . params ) {
163
155
// Use pre-created empty object or provided params directly
164
- req . params = params || EMPTY_PARAMS
156
+ req . params = params || Object . create ( null )
165
157
} else if ( params ) {
166
158
// Manual property copying - optimized for small objects
167
159
// Pre-compute keys and length to avoid repeated calls
You can’t perform that action at this time.
0 commit comments