File tree 1 file changed +2
-3
lines changed
packages/nuqs/src/adapters/next
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,6 @@ export function useNuqsNextPagesRouterAdapter(): AdapterInterface {
67
67
query : {
68
68
// Note: we put search params first so that one that conflicts
69
69
// with dynamic params will be overwritten.
70
- // todo: Test this in practice.
71
70
...Object . fromEntries ( search . entries ( ) ) ,
72
71
...urlParams
73
72
}
@@ -76,7 +75,7 @@ export function useNuqsNextPagesRouterAdapter(): AdapterInterface {
76
75
} ,
77
76
// This is what makes the URL pretty (resolved dynamic segments
78
77
// and nuqs-formatted search params).
79
- asPath , // todo: Test formatting
78
+ asPath ,
80
79
// And these are the options that are passed to the router.
81
80
{
82
81
scroll : options . scroll ,
@@ -127,11 +126,11 @@ export function extractDynamicUrlParams(
127
126
Object . entries ( values ) . filter ( ( [ key ] ) => paramNames . has ( key ) )
128
127
)
129
128
const matchCatchAll = catchAllRegex . exec ( pathname )
130
- const matchOptionalCatchAll = optionalCatchAllRegex . exec ( pathname )
131
129
if ( matchCatchAll && matchCatchAll [ 1 ] ) {
132
130
const key = matchCatchAll [ 1 ]
133
131
dynamicValues [ key ] = values [ key ] ?? [ ]
134
132
}
133
+ const matchOptionalCatchAll = optionalCatchAllRegex . exec ( pathname )
135
134
if ( matchOptionalCatchAll && matchOptionalCatchAll [ 1 ] ) {
136
135
const key = matchOptionalCatchAll [ 1 ]
137
136
// Note: while Next.js returns undefined if there are no values for the
You can’t perform that action at this time.
0 commit comments