MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / percentDecode

Function percentDecode

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

Source from the content-addressed store, hash-verified

51524 }
51525 position.position = idx;
51526 return input.slice(start, position.position);
51527 }
51528 function stringPercentDecode(input) {
51529 const bytes = encoder.encode(input);
51530 return percentDecode(bytes);
51531 }
51532 function percentDecode(input) {
51533 const output = [];
51534 for (let i3 = 0; i3 < input.length; i3++) {
51535 const byte = input[i3];
51536 if (byte !== 37) {
51537 output.push(byte);
51538 } else if (byte === 37 && !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i3 + 1], input[i3 + 2]))) {
51539 output.push(37);
51540 } else {
51541 const nextTwoBytes = String.fromCharCode(input[i3 + 1], input[i3 + 2]);
51542 const bytePoint = Number.parseInt(nextTwoBytes, 16);
51543 output.push(bytePoint);
51544 i3 += 2;
51545 }

Callers 1

stringPercentDecodeFunction · 0.85

Calls 3

testMethod · 0.80
pushMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…