(input)
| 3491 | return `%${hex}`; |
| 3492 | } |
| 3493 | function percentDecodeBytes(input) { |
| 3494 | const output = new Uint8Array(input.byteLength); |
| 3495 | let outputIndex = 0; |
| 3496 | for (let i3 = 0; i3 < input.byteLength; ++i3) { |
| 3497 | const byte = input[i3]; |
| 3498 | if (byte !== 37) { |
| 3499 | output[outputIndex++] = byte; |
| 3500 | } else if (byte === 37 && (!isASCIIHex(input[i3 + 1]) || !isASCIIHex(input[i3 + 2]))) { |
| 3501 | output[outputIndex++] = byte; |
| 3502 | } else { |
| 3503 | const bytePoint = parseInt(String.fromCodePoint(input[i3 + 1], input[i3 + 2]), 16); |
| 3504 | output[outputIndex++] = bytePoint; |
| 3505 | i3 += 2; |
| 3506 | } |
| 3507 | } |
| 3508 | return output.slice(0, outputIndex); |
| 3509 | } |
| 3510 | function percentDecodeString(input) { |
| 3511 | const bytes = utf8Encode(input); |
| 3512 | return percentDecodeBytes(bytes); |
no test coverage detected
searching dependent graphs…