From c09b8dac731a4afdaabe9e707d9c6c8a93557731 Mon Sep 17 00:00:00 2001 From: wildone Date: Tue, 30 Jan 2024 02:47:48 +1100 Subject: [PATCH] add helper function. --- .../components/clientlibs/clientlibs-header/components.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js index f5b91f052..380808985 100644 --- a/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js +++ b/application/backend/src/main/resources/apps/typerefinery/components/clientlibs/clientlibs-header/components.js @@ -13,6 +13,9 @@ window.Typerefinery.VueData = Typerefinery.VueData || {}; ns.getComponentConfig = ($component) => { return $($component).data('model') || {}; }; + ns.hasRegex = (str) => { + return str.match(/{{(\w+)}}/gm); + }; ns.replaceRegex = (str, obj) => { return str.replace(/{{(\w+)}}/gm, function(match, key) { if (!obj.hasOwnProperty(key)) {