@ctrl/golang-template
Version:
Basic golang template parsing in js
13 lines (12 loc) • 763 B
TypeScript
export declare function reReplace(str: string, variables: Record<string, any>): string;
export declare function joinReplace(str: string, variables: Record<string, any>): string;
export declare function ifElseReplace(str: string, variables: Record<string, any>): string;
export declare function rangeReplace(str: string, variables: Record<string, any>): string;
export declare function variableReplace(str: string, variables: Record<string, any>): string;
export declare function indexReplace(str: string, variables: Record<string, any>): string;
/**
* Parse template and insert variables
* @param str golang style template
* @param variables object of variables to insert
*/
export declare function parse(str: string, variables: Record<string, any>): string;