Skip to content

Commit 6249b6c

Browse files
committed
ref: Rename output object
1 parent dcaa285 commit 6249b6c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/nuqs/src/useQueryStates.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ function parseMap<KeyMap extends UseQueryStatesKeysMap>(
275275
cachedQuery?: Record<string, string | null>,
276276
cachedState?: NullableValues<KeyMap>
277277
): NullableValues<KeyMap> {
278-
return Object.keys(keyMap).reduce((obj, stateKey) => {
278+
return Object.keys(keyMap).reduce((out, stateKey) => {
279279
const urlKey = urlKeys?.[stateKey] ?? stateKey
280280
const { parse } = keyMap[stateKey]!
281281
const queuedQuery = getQueuedValue(urlKey)
@@ -284,15 +284,15 @@ function parseMap<KeyMap extends UseQueryStatesKeysMap>(
284284
? (searchParams?.get(urlKey) ?? null)
285285
: queuedQuery
286286
if (cachedQuery && cachedState && cachedQuery[urlKey] === query) {
287-
obj[stateKey as keyof KeyMap] = cachedState[stateKey] ?? null
288-
return obj
287+
out[stateKey as keyof KeyMap] = cachedState[stateKey] ?? null
288+
return out
289289
}
290290
const value = query === null ? null : safeParse(parse, query, stateKey)
291-
obj[stateKey as keyof KeyMap] = value ?? null
291+
out[stateKey as keyof KeyMap] = value ?? null
292292
if (cachedQuery) {
293293
cachedQuery[urlKey] = query
294294
}
295-
return obj
295+
return out
296296
}, {} as NullableValues<KeyMap>)
297297
}
298298

0 commit comments

Comments
 (0)