MCPcopy
hub / github.com/markdoc/markdoc / Function

Class Function

src/ast/function.ts:4–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import type { Config, AstType } from '../types';
3
4export default class Function implements AstType {
5 readonly $$mdtype = 'Function';
6
7 name;
8 parameters;
9
10 constructor(name: string, parameters: Record<string, any>) {
11 this.name = name;
12 this.parameters = parameters;
13 }
14
15 resolve(config: Config = {}) {
16 const fn = config?.functions?.[this.name];
17 if (!fn) return null;
18
19 const parameters = resolve(this.parameters, config);
20 return fn.transform?.(parameters, config);
21 }
22}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…