Skip to content

Commit e57cff4

Browse files
committed
chore: Cleanup
1 parent 181b23a commit e57cff4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/nuqs/src/adapters/next/impl.pages.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ export function useNuqsNextPagesRouterAdapter(): AdapterInterface {
6767
query: {
6868
// Note: we put search params first so that one that conflicts
6969
// with dynamic params will be overwritten.
70-
// todo: Test this in practice.
7170
...Object.fromEntries(search.entries()),
7271
...urlParams
7372
}
@@ -76,7 +75,7 @@ export function useNuqsNextPagesRouterAdapter(): AdapterInterface {
7675
},
7776
// This is what makes the URL pretty (resolved dynamic segments
7877
// and nuqs-formatted search params).
79-
asPath, // todo: Test formatting
78+
asPath,
8079
// And these are the options that are passed to the router.
8180
{
8281
scroll: options.scroll,
@@ -127,11 +126,11 @@ export function extractDynamicUrlParams(
127126
Object.entries(values).filter(([key]) => paramNames.has(key))
128127
)
129128
const matchCatchAll = catchAllRegex.exec(pathname)
130-
const matchOptionalCatchAll = optionalCatchAllRegex.exec(pathname)
131129
if (matchCatchAll && matchCatchAll[1]) {
132130
const key = matchCatchAll[1]
133131
dynamicValues[key] = values[key] ?? []
134132
}
133+
const matchOptionalCatchAll = optionalCatchAllRegex.exec(pathname)
135134
if (matchOptionalCatchAll && matchOptionalCatchAll[1]) {
136135
const key = matchOptionalCatchAll[1]
137136
// Note: while Next.js returns undefined if there are no values for the

0 commit comments

Comments
 (0)