3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-17 23:25:02 +00:00

Add Tags plugin

This commit is contained in:
Dragory 2018-08-05 01:32:59 +03:00
parent 6040d1acb8
commit 541e9fdea0
6 changed files with 158 additions and 5 deletions

View file

@ -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) : "";
});
}