( path: string, prevQueryParams: QueryParams, newQueryParams: QueryParams, )
| 202 | }; |
| 203 | |
| 204 | export const getUpdatedUrl = ( |
| 205 | path: string, |
| 206 | prevQueryParams: QueryParams, |
| 207 | newQueryParams: QueryParams, |
| 208 | ) => { |
| 209 | const updatedQuery = { ...prevQueryParams, ...newQueryParams }; |
| 210 | const queryString = new URLSearchParams( |
| 211 | updatedQuery as Record<string, string>, |
| 212 | ).toString(); |
| 213 | return `${path}?${queryString}`; |
| 214 | }; |
| 215 | |
| 216 | export const searchParamsToObject = ( |
| 217 | searchParams: URLSearchParams, |
no outgoing calls
no test coverage detected