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

Function parseKey

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

Source from the content-addressed store, hash-verified

1095}
1096
1097function parseKey(state: ParserState): string {
1098 if (!isKeyStart(peek(state))) {
1099 throw new SyntaxError(
1100 `Invalid structured field: invalid key start at position ${state.pos}`,
1101 );
1102 }
1103
1104 const startPos = state.pos;
1105 state.pos++; // Skip validated first char
1106 while (!isEof(state) && isKeyChar(peek(state))) {
1107 state.pos++;
1108 }
1109
1110 return state.input.slice(startPos, state.pos);
1111}
1112
1113function parseParameters(state: ParserState): Parameters {
1114 const parameters: Map<string, BareItem> = new Map();

Callers 2

parseDictionaryInternalFunction · 0.85
parseParametersFunction · 0.85

Calls 5

isKeyStartFunction · 0.85
peekFunction · 0.85
isEofFunction · 0.85
isKeyCharFunction · 0.85
sliceMethod · 0.45

Tested by

no test coverage detected