botbook/node_modules/json-schema-library/dist/module/lib/utils/__.js
Rodrigo Rodriguez 6ae15fe3e5 Updated.
2024-09-04 13:13:15 -03:00

14 lines
466 B
JavaScript

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, data, fallback = keyword) {
var _a;
const template = (_a = strings[keyword]) !== null && _a !== void 0 ? _a : fallback;
return render(template, data);
}