mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-17 10:26:39 +00:00
✨apply branding to org auth page
This commit is contained in:
17
src/lib/replacePlaceholder.ts
Normal file
17
src/lib/replacePlaceholder.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export function replacePlaceholder(
|
||||
stringWithPlaceholder: string,
|
||||
data: Record<string, string>
|
||||
) {
|
||||
let newString = stringWithPlaceholder;
|
||||
|
||||
const keys = Object.keys(data);
|
||||
|
||||
for (const key of keys) {
|
||||
newString = newString.replace(
|
||||
new RegExp(`{{${key}}}`, "gm"),
|
||||
data[key]
|
||||
);
|
||||
}
|
||||
|
||||
return newString;
|
||||
}
|
||||
Reference in New Issue
Block a user