| 38 | * @publicApi |
| 39 | */ |
| 40 | export class HttpUrlEncodingCodec implements HttpParameterCodec { |
| 41 | /** |
| 42 | * Encodes a key name for a URL parameter or query-string. |
| 43 | * @param key The key name. |
| 44 | * @returns The encoded key name. |
| 45 | */ |
| 46 | encodeKey(key: string): string { |
| 47 | return standardEncoding(key); |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Encodes the value of a URL parameter or query-string. |
| 52 | * @param value The value. |
| 53 | * @returns The encoded value. |
| 54 | */ |
| 55 | encodeValue(value: string): string { |
| 56 | return standardEncoding(value); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Decodes an encoded URL parameter or query-string key. |
| 61 | * @param key The encoded key name. |
| 62 | * @returns The decoded key name. |
| 63 | */ |
| 64 | decodeKey(key: string): string { |
| 65 | return decodeURIComponent(key); |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Decodes an encoded URL parameter or query-string value. |
| 70 | * @param value The encoded value. |
| 71 | * @returns The decoded value. |
| 72 | */ |
| 73 | decodeValue(value: string) { |
| 74 | return decodeURIComponent(value); |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | function paramParser(rawParams: string, codec: HttpParameterCodec): Map<string, string[]> { |
| 79 | const map = new Map<string, string[]>(); |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…