@squiz/json-schema-library
Version:
Customizable and hackable json-validator and json-schema utilities for traversal, data generation and validation
16 lines (13 loc) • 448 B
text/typescript
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);
}