MCPcopy
hub / github.com/markdoc/markdoc / formatVariable

Function formatVariable

src/formatter.ts:105–115  ·  view source on GitHub ↗
(v: Variable)

Source from the content-addressed store, hash-verified

103}
104
105function* formatVariable(v: Variable) {
106 yield '$';
107 yield v.path
108 .map((p, i) => {
109 if (i === 0) return p;
110 if (isIdentifier(p)) return '.' + p;
111 if (typeof p === 'number') return `[${p}]`;
112 return `["${p}"]`;
113 })
114 .join('');
115}
116
117function* formatFunction(f: Function) {
118 yield f.name;

Callers 1

formatValueFunction · 0.85

Calls 1

isIdentifierFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…