MCPcopy
hub / github.com/markdoc/markdoc / resolve

Function resolve

src/ast/base.ts:33–46  ·  view source on GitHub ↗
(value: any, config: Config = {})

Source from the content-addressed store, hash-verified

31}
32
33export function resolve(value: any, config: Config = {}): any {
34 if (value == null || typeof value !== 'object') return value;
35
36 if (Array.isArray(value)) return value.map((item) => resolve(item, config));
37
38 if (isAst(value) && value?.resolve instanceof Function)
39 return value.resolve(config);
40
41 if (Object.getPrototypeOf(value) !== Object.prototype) return value;
42
43 const output: Record<string, Scalar> = {};
44 for (const [k, v] of Object.entries(value)) output[k] = resolve(v, config);
45 return output;
46}

Callers 3

resolveMethod · 0.90
resolveMethod · 0.90
index.tsFile · 0.50

Calls 2

isAstFunction · 0.85
resolveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…