( basePath: string, options?: object, )
| 210 | } |
| 211 | |
| 212 | export const getURLWithSearchParams = ( |
| 213 | basePath: string, |
| 214 | options?: object, |
| 215 | ): string => { |
| 216 | if (!options) { |
| 217 | return basePath; |
| 218 | } |
| 219 | |
| 220 | const searchParams = new URLSearchParams(); |
| 221 | for (const [key, value] of Object.entries(options)) { |
| 222 | if (value !== undefined && value !== "") { |
| 223 | searchParams.append(key, value.toString()); |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | const searchString = searchParams.toString(); |
| 228 | return searchString ? `${basePath}?${searchString}` : basePath; |
| 229 | }; |
| 230 | |
| 231 | // withDefaultFeatures sets all unspecified features to not_entitled and |
| 232 | // disabled. |
no outgoing calls
no test coverage detected