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.
- package/esm2020/lib/core/utils/utils.mjs +9 -2
- package/fesm2015/monkey-front-core.mjs +8 -1
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +8 -1
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/utils/utils.d.ts +1 -0
- package/monkey-front-core-0.0.291.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.289.tgz +0 -0
|
@@ -193,7 +193,7 @@ class MonkeyEcxUtils {
|
|
|
193
193
|
return dvCalc === dgv;
|
|
194
194
|
}
|
|
195
195
|
static isValidUrl(txt) {
|
|
196
|
-
const regex =
|
|
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_;
|