(remote: string, token: string)
| 304 | * secret needs encoding, so encode just that. |
| 305 | */ |
| 306 | export function credentialURL(remote: string, token: string): string { |
| 307 | const secret = encodeURIComponent(token.split("?expires=", 1)[0]); |
| 308 | const sep = remote.indexOf("://"); |
| 309 | if (sep === -1) return remote; |
| 310 | const scheme = remote.slice(0, sep + 3); |
| 311 | return `${scheme}x:${secret}@${remote.slice(sep + 3)}`; |
| 312 | } |
| 313 | |
| 314 | // --------------------------------------------------------------- |
| 315 | // repo group |
no outgoing calls
no test coverage detected