Currently router.location.query.get(name?: string) return is defined as Record<string, string> | string.
But this can get confusing, since if passed a string we should receive a string, and only if no name is passed we should return the entire object as Record<string, string>
And if the property hasn't been set, we should also show that the return value could be undefined
So this updated type definition should help with that.
Currently
router.location.query.get(name?: string)
return is defined asRecord<string, string> | string
.But this can get confusing, since if passed a
string
we should receive astring
, and only if no name is passed we should return the entire object asRecord<string, string>
And if the property hasn't been set, we should also show that the return value could be
undefined
So this updated type definition should help with that.