* Percent-encodes a query parameter name or value per AWS SigV4 canonical rules * (every byte except the unreserved set `A-Za-z0-9-_.~` is encoded). * `encodeURIComponent` leaves `!'()*` unencoded, so those are encoded here.
(value: string)
| 324 | * `encodeURIComponent` leaves `!'()*` unencoded, so those are encoded here. |
| 325 | */ |
| 326 | function encodeQueryValue(value: string): string { |
| 327 | return encodeURIComponent(value).replace( |
| 328 | /[!'()*]/g, |
| 329 | (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}` |
| 330 | ) |
| 331 | } |
| 332 | |
| 333 | /** |
| 334 | * Builds the canonical (sorted, percent-encoded) query string for a |
no test coverage detected