You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(router): use getRouteParamKeys for consistent parameter ordering
This refactor introduces a new getRouteParamKeys utility function that ensures route parameters are always accessed in the correct order based on their position in the route pattern.
Previously, Object.keys() was used to iterate over route parameters, which could lead to inconsistent ordering since JavaScript object key order is not guaranteed for numeric string keys.
Changes:
- Add getRouteParamKeys utility that sorts parameters by their position
- Replace Object.keys(groups) with getRouteParamKeys(groups) in:
- server-utils.ts (normalizeDynamicRouteParams, interpolateDynamicPath, filterInternalQuery)
- base-server.ts (normalizeCdnUrl parameter extraction)
- Update omit() utility to accept readonly arrays for better type safety
- Add comprehensive tests for getRouteParamKeys
This ensures deterministic behavior when processing route parameters, which is critical for proper URL interpolation and parameter extraction.
0 commit comments