botbook/node_modules/json-schema-library/lib/utils/__.ts

15 lines
447 B
TypeScript
Raw Normal View History

2024-09-04 13:13:15 -03:00
import strings from "../config/strings";
import render from "./render";
/**
* Renders the given string as defined in __@see config/strings.js__
* @param keyword
* @param data - template data
* @param fallback - fallback template
* @return resulting string
*/
export default function __(keyword: string, data: any, fallback: string = keyword): string {
const template = strings[keyword] ?? fallback;
return render(template, data);
}