monkey-front-core 0.0.289 → 0.0.291

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -193,7 +193,7 @@ class MonkeyEcxUtils {
193
193
  return dvCalc === dgv;
194
194
  }
195
195
  static isValidUrl(txt) {
196
- const regex = new RegExp(/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)+[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,10}(:[0-9]{1,5})?(\/.*)?$/gm);
196
+ const regex = /(https?:\/\/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9])(:?\d*)\/?([a-z_\\/0-9\-#.]*)\??([a-z_\\/0-9\-#=&]*)/g;
197
197
  return regex.test(txt);
198
198
  }
199
199
  static isValidZipCode(zipCode, country) {
@@ -289,6 +289,13 @@ class MonkeyEcxUtils {
289
289
  const initialPath = window.location.origin;
290
290
  return (initialPath || '') === frontend;
291
291
  }
292
+ static replaceVariables(data, obj) {
293
+ let handled = data;
294
+ Object.entries(obj).forEach(([key, value]) => {
295
+ handled = handled.replace(new RegExp(`{${key}}`, 'g'), `${value}`);
296
+ });
297
+ return handled;
298
+ }
292
299
  }
293
300
 
294
301
  const moment$5 = moment_;