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

Function parseUrlencoded

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

Source from the content-addressed store, hash-verified

4644 return char.codePointAt(0);
4645 }
4646 function parseUrlencoded(input) {
4647 const sequences = strictlySplitByteSequence(input, p4("&"));
4648 const output = [];
4649 for (const bytes of sequences) {
4650 if (bytes.length === 0) {
4651 continue;
4652 }
4653 let name, value;
4654 const indexOfEqual = bytes.indexOf(p4("="));
4655 if (indexOfEqual >= 0) {
4656 name = bytes.slice(0, indexOfEqual);
4657 value = bytes.slice(indexOfEqual + 1);
4658 } else {
4659 name = bytes;
4660 value = new Uint8Array(0);
4661 }
4662 name = replaceByteInByteSequence(name, 43, 32);
4663 value = replaceByteInByteSequence(value, 43, 32);
4664 const nameString = utf8DecodeWithoutBOM(percentDecodeBytes(name));
4665 const valueString = utf8DecodeWithoutBOM(percentDecodeBytes(value));
4666 output.push([nameString, valueString]);
4667 }
4668 return output;
4669 }
4670 function parseUrlencodedString(input) {
4671 return parseUrlencoded(utf8Encode(input));
4672 }

Callers 1

parseUrlencodedStringFunction · 0.85

Calls 7

p4Function · 0.85
utf8DecodeWithoutBOMFunction · 0.85
percentDecodeBytesFunction · 0.85
sliceMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…