| 2 | import type { Config, AstType } from '../types'; |
| 3 | |
| 4 | export 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…