(segment: string)
| 292 | * decode first to avoid encoding twice. |
| 293 | */ |
| 294 | export const encodePathSegment = (segment: string): string => { |
| 295 | try { |
| 296 | return encodeURIComponent(decodeURIComponent(segment)); |
| 297 | } catch { |
| 298 | return encodeURIComponent(segment); |
| 299 | } |
| 300 | }; |
| 301 | |
| 302 | /** |
| 303 | * Percent-encode a `owner/repo`-style repository name one path segment at a |
nothing calls this directly
no outgoing calls
no test coverage detected