( path: string, params: Record<string, string | undefined>, )
| 40 | ) => (gravityApiKey ? text.split(gravityApiKey).join('[redacted]') : text) |
| 41 | |
| 42 | const withQuery = ( |
| 43 | path: string, |
| 44 | params: Record<string, string | undefined>, |
| 45 | ) => { |
| 46 | const qs = new URLSearchParams() |
| 47 | for (const [key, value] of Object.entries(params)) { |
| 48 | if (value) qs.set(key, value) |
| 49 | } |
| 50 | const query = qs.toString() |
| 51 | return query ? `${path}?${query}` : path |
| 52 | } |
| 53 | |
| 54 | const requireGravityApiKey = (gravityApiKey: string | undefined) => { |
| 55 | if (!gravityApiKey) { |
no test coverage detected