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

Function inlineTable

toml/_parser.ts:750–765  ·  view source on GitHub ↗
(
  scanner: Scanner,
)

Source from the content-addressed store, hash-verified

748}
749
750export function inlineTable(
751 scanner: Scanner,
752): ParseResult<Record<string, unknown>> {
753 scanner.nextUntilChar();
754 if (scanner.char(1) === "}") {
755 scanner.next(2);
756 return success({ __proto__: null });
757 }
758 const pairs = surround("{", join(pair, ","), "}")(scanner);
759 if (!pairs.ok) return failure();
760 let table = { __proto__: null } as Record<string, unknown>;
761 for (const pair of pairs.body) {
762 table = deepMerge(table, pair);
763 }
764 return success(table);
765}
766
767export const value = or([
768 multilineBasicString,

Callers

nothing calls this directly

Calls 8

successFunction · 0.85
surroundFunction · 0.85
failureFunction · 0.85
deepMergeFunction · 0.85
nextUntilCharMethod · 0.80
charMethod · 0.80
joinFunction · 0.70
nextMethod · 0.45

Tested by

no test coverage detected