MCPcopy Create free account
hub / github.com/denoland/std / parseParameters

Function parseParameters

http/unstable_structured_fields.ts:1113–1133  ·  view source on GitHub ↗
(state: ParserState)

Source from the content-addressed store, hash-verified

1111}
1112
1113function parseParameters(state: ParserState): Parameters {
1114 const parameters: Map<string, BareItem> = new Map();
1115
1116 while (peek(state) === ";") {
1117 consume(state); // consume ';'
1118 skipSP(state);
1119 const key = parseKey(state);
1120
1121 let value: BareItem;
1122 if (peek(state) === "=") {
1123 consume(state); // consume '='
1124 value = parseBareItem(state);
1125 } else {
1126 value = { type: "boolean", value: true };
1127 }
1128
1129 parameters.set(key, value);
1130 }
1131
1132 return parameters;
1133}
1134
1135// =============================================================================
1136// Serialization (RFC 9651 Section 4.1)

Callers 3

parseDictionaryInternalFunction · 0.85
parseInnerListFunction · 0.85
parseItemInternalFunction · 0.85

Calls 6

peekFunction · 0.85
consumeFunction · 0.85
skipSPFunction · 0.85
parseKeyFunction · 0.85
parseBareItemFunction · 0.85
setMethod · 0.65

Tested by

no test coverage detected