MCPcopy
hub / github.com/markdoc/markdoc / getAstValues

Function getAstValues

src/ast/base.ts:21–31  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

19}
20
21export function* getAstValues(value: any): Generator<AstType, void, unknown> {
22 if (value == null || typeof value !== 'object') return;
23
24 if (Array.isArray(value)) for (const v of value) yield* getAstValues(v);
25
26 if (isAst(value)) yield value;
27
28 if (Object.getPrototypeOf(value) !== Object.prototype) return;
29
30 for (const v of Object.values(value)) yield* getAstValues(v);
31}
32
33export function resolve(value: any, config: Config = {}): any {
34 if (value == null || typeof value !== 'object') return value;

Callers

nothing calls this directly

Calls 1

isAstFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…