ryde/source/logic/helpers/string.ts

30 lines
364 B
TypeScript
Raw Normal View History

2026-03-06 08:37:53 +01:00
namespace lib_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;
}
}