wiki-js-cli/source/helpers/string.ts

21 lines
350 B
TypeScript
Raw Normal View History

2024-09-30 09:11:50 +02:00
namespace _wiki_js_cli.helpers.string
{
/**
*/
export function coin(
template : string,
arguments_ : Record<string, string>
) : string
{
let result : string = template;
Object.entries(arguments_).forEach(
([key, value]) => {
result = result.replace(new RegExp("{{" + key + "}}", "g"), value);
}
);
return result;
}
}