@cloudcare/browser-core 1.0.21 → 1.0.22

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.
@@ -740,11 +740,13 @@ function UUID(placeholder) {
740
740
 
741
741
 
742
742
  function replaceNumberCharByPath(path) {
743
+ var pathGroup = '';
744
+
743
745
  if (path) {
744
- return path.replace(/\/([^\/]*)\d([^\/]*)/g, '/?').replace(/\/$/g, '');
745
- } else {
746
- return '';
746
+ pathGroup = path.replace(/\/([^\/]*)\d([^\/]*)/g, '/?').replace(/\/$/g, '');
747
747
  }
748
+
749
+ return pathGroup || '/';
748
750
  }
749
751
 
750
752
  var getQueryParam = function getQueryParam(url, param) {
@@ -542,11 +542,13 @@ export function UUID(placeholder) {
542
542
  } // 替换url包含数字的路由
543
543
 
544
544
  export function replaceNumberCharByPath(path) {
545
+ var pathGroup = '';
546
+
545
547
  if (path) {
546
- return path.replace(/\/([^\/]*)\d([^\/]*)/g, '/?').replace(/\/$/g, '');
547
- } else {
548
- return '';
548
+ pathGroup = path.replace(/\/([^\/]*)\d([^\/]*)/g, '/?').replace(/\/$/g, '');
549
549
  }
550
+
551
+ return pathGroup || '/';
550
552
  }
551
553
  export var getQueryParam = function getQueryParam(url, param) {
552
554
  param = param.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcare/browser-core",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "main": "cjs/index.js",
5
5
  "module": "esm/index.js",
6
6
  "scripts": {
@@ -20,5 +20,5 @@
20
20
  "author": "dataflux",
21
21
  "license": "MIT",
22
22
  "description": "DataFlux RUM Web 端数据指标监控",
23
- "gitHead": "845c60151f20414b3da61bc79fbb1624b78f811b"
23
+ "gitHead": "f7cff55590afd33ee0ae181024f262a2fc7b4942"
24
24
  }
@@ -535,11 +535,12 @@ export function UUID(placeholder) {
535
535
 
536
536
  // 替换url包含数字的路由
537
537
  export function replaceNumberCharByPath(path) {
538
+ var pathGroup = ''
538
539
  if (path) {
539
- return path.replace(/\/([^\/]*)\d([^\/]*)/g, '/?').replace(/\/$/g, '')
540
- } else {
541
- return ''
540
+ pathGroup = path.replace(/\/([^\/]*)\d([^\/]*)/g, '/?').replace(/\/$/g, '')
542
541
  }
542
+ return pathGroup || '/'
543
+
543
544
  }
544
545
  export var getQueryParam = function (url, param) {
545
546
  param = param.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]')