MCPcopy
hub / github.com/di-sukharev/opencommit / percentDecodeBytes

Function percentDecodeBytes

out/cli.cjs:3493–3509  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

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);

Callers 2

percentDecodeStringFunction · 0.85
parseUrlencodedFunction · 0.85

Calls 2

isASCIIHexFunction · 0.85
sliceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…