* Encodes a URI string with the default encoding. This function will only ever be called from * `encodeUriQuery` or `encodeUriSegment` as it's the base set of encodings to be used. We need * a custom encoding because encodeURIComponent is too aggressive and encodes stuff that doesn't * have to be
(s: string)
| 574 | * have to be encoded per https://url.spec.whatwg.org. |
| 575 | */ |
| 576 | function encodeUriString(s: string): string { |
| 577 | return encodeURIComponent(s) |
| 578 | .replace(/%40/g, '@') |
| 579 | .replace(/%3A/gi, ':') |
| 580 | .replace(/%24/g, '$') |
| 581 | .replace(/%2C/gi, ','); |
| 582 | } |
| 583 | |
| 584 | /** |
| 585 | * This function should be used to encode both keys and values in a query string key/value. In |
no test coverage detected