Add Tags plugin
This commit is contained in:
parent
54b79ca51f
commit
4a1a14be59
6 changed files with 158 additions and 5 deletions
|
@ -74,8 +74,8 @@ export function stripObjectToScalars(obj, includedNested: string[] = []) {
|
|||
|
||||
const stringFormatRegex = /{([^{}]+?)}/g;
|
||||
export function formatTemplateString(str: string, values) {
|
||||
return str.replace(stringFormatRegex, (match, val) => {
|
||||
const value = at(values, val)[0];
|
||||
return str.replace(stringFormatRegex, (match, prop) => {
|
||||
const value = at(values, prop)[0];
|
||||
return typeof value === "string" || typeof value === "number" ? String(value) : "";
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue