* 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)
| 511 | * have to be encoded per https://url.spec.whatwg.org. |
| 512 | */ |
| 513 | function encodeUriString(s: string): string { |
| 514 | return encodeURIComponent(s) |
| 515 | .replace(/%40/g, '@') |
| 516 | .replace(/%3A/gi, ':') |
| 517 | .replace(/%24/g, '$') |
| 518 | .replace(/%2C/gi, ','); |
| 519 | } |
| 520 | |
| 521 | /** |
| 522 | * This function should be used to encode both keys and values in a query string key/value. In |
no test coverage detected
searching dependent graphs…