legal-markdown-js
Version:
Node.js implementation of LegalMarkdown for processing legal documents with markdown and YAML - Complete feature parity with Ruby version
11 lines • 585 B
TypeScript
/**
* Replace `{{ variable.path }}` placeholders in a template string with values
* from a metadata object.
*
* Only simple variable paths (identifiers, dot-notation, bracket notation with
* integer or quoted string indices) are resolved. Any expression that does not
* pass the allowlist regex is left as-is, so template syntax never executes
* arbitrary code. Missing or null values are also left as-is.
*/
export declare function replaceTemplateVariables(template: string, metadata?: Record<string, unknown>): string;
//# sourceMappingURL=template-variable-replacer.d.ts.map