Skip to content

Commit

Permalink
add helper function.
Browse files Browse the repository at this point in the history
  • Loading branch information
wildone committed Jan 29, 2024
1 parent edcda03 commit c09b8da
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit c09b8da

Please sign in to comment.