mirror of
https://github.com/dadosfera/maestro.git
synced 2026-12-03 17:20:05 +00:00
oauth almost complete
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
export const mustache = (string: string, data: Record<string, any> = {}) => {
|
||||
return Object.entries(data).reduce((res, [key, value]) => {
|
||||
const mainRe = new RegExp(`(?<!\\\\){{\\s*${key}\\s*}}`, 'g');
|
||||
const escapeRe = new RegExp(`\\\\({{\\s*${key}\\s*}})`, 'g');
|
||||
return res.replace(mainRe, value.toString()).replace(escapeRe, '$1');
|
||||
}, string);
|
||||
};
|
||||
Reference in New Issue
Block a user