@cloudcare/browser-core 2.0.12 → 2.0.13

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.
@@ -76,7 +76,12 @@ function afterSend(observable, responsePromise, startContext) {
76
76
  context.error = response;
77
77
  } else if ('status' in response) {
78
78
  context.response = response;
79
- context.responseType = response.constructor === Response && response.type || ''; // issue The Response type getter can only be used on instances of Response
79
+
80
+ try {
81
+ context.responseType = response.constructor === Response && response.type || ''; // issue The Response type getter can only be used on instances of Response
82
+ } catch (err) {
83
+ context.responseType = '';
84
+ }
80
85
 
81
86
  context.status = response.status;
82
87
  context.isAborted = false;
package/cjs/dataMap.js CHANGED
@@ -159,7 +159,9 @@ var dataMap = {
159
159
  action_error_count: 'action.error.count',
160
160
  action_resource_count: 'action.resource.count',
161
161
  action_frustration_types: 'action.frustration.type',
162
- action_long_task_count: 'action.long_task.count'
162
+ action_long_task_count: 'action.long_task.count',
163
+ action_target: '_dd.action.target',
164
+ action_position: '_dd.action.position'
163
165
  }
164
166
  },
165
167
  browser_log: {
@@ -36,7 +36,7 @@ function escapeJsonValue(value) {
36
36
  }
37
37
 
38
38
  function escapeFieldValueStr(str) {
39
- return '"' + str.replace(/\\/g, '\\\\').replace(/[\\]*"/g, '"').replace(/"/g, '\\"') + '"';
39
+ return '"' + str.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"';
40
40
  }
41
41
 
42
42
  function escapeRowField(value) {
@@ -64,7 +64,12 @@ function afterSend(observable, responsePromise, startContext) {
64
64
  context.error = response;
65
65
  } else if ('status' in response) {
66
66
  context.response = response;
67
- context.responseType = response.constructor === Response && response.type || ''; // issue The Response type getter can only be used on instances of Response
67
+
68
+ try {
69
+ context.responseType = response.constructor === Response && response.type || ''; // issue The Response type getter can only be used on instances of Response
70
+ } catch (err) {
71
+ context.responseType = '';
72
+ }
68
73
 
69
74
  context.status = response.status;
70
75
  context.isAborted = false;
package/esm/dataMap.js CHANGED
@@ -149,7 +149,9 @@ export var dataMap = {
149
149
  action_error_count: 'action.error.count',
150
150
  action_resource_count: 'action.resource.count',
151
151
  action_frustration_types: 'action.frustration.type',
152
- action_long_task_count: 'action.long_task.count'
152
+ action_long_task_count: 'action.long_task.count',
153
+ action_target: '_dd.action.target',
154
+ action_position: '_dd.action.position'
153
155
  }
154
156
  },
155
157
  browser_log: {
@@ -20,7 +20,7 @@ export function escapeJsonValue(value) {
20
20
  }
21
21
  }
22
22
  export function escapeFieldValueStr(str) {
23
- return '"' + str.replace(/\\/g, '\\\\').replace(/[\\]*"/g, '"').replace(/"/g, '\\"') + '"';
23
+ return '"' + str.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"';
24
24
  }
25
25
  export function escapeRowField(value) {
26
26
  if (typeof value === 'object' && value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcare/browser-core",
3
- "version": "2.0.12",
3
+ "version": "2.0.13",
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": "98664a15be351def98c4e9b33c8366b1fb8aa652"
23
+ "gitHead": "770d3987076f77be6dee3ba6b2c11207ba593312"
24
24
  }
@@ -79,8 +79,13 @@ function afterSend(observable, responsePromise, startContext) {
79
79
  context.error = response
80
80
  } else if ('status' in response) {
81
81
  context.response = response
82
- context.responseType =
83
- (response.constructor === Response && response.type) || '' // issue The Response type getter can only be used on instances of Response
82
+ try {
83
+ context.responseType =
84
+ (response.constructor === Response && response.type) || '' // issue The Response type getter can only be used on instances of Response
85
+ } catch (err) {
86
+ context.responseType = ''
87
+ }
88
+
84
89
  context.status = response.status
85
90
  context.isAborted = false
86
91
  }
package/src/dataMap.js CHANGED
@@ -148,7 +148,9 @@ export var dataMap = {
148
148
  action_error_count: 'action.error.count',
149
149
  action_resource_count: 'action.resource.count',
150
150
  action_frustration_types: 'action.frustration.type',
151
- action_long_task_count: 'action.long_task.count'
151
+ action_long_task_count: 'action.long_task.count',
152
+ action_target: '_dd.action.target',
153
+ action_position: '_dd.action.position'
152
154
  }
153
155
  },
154
156
  browser_log: {
@@ -21,14 +21,7 @@ export function escapeJsonValue(value) {
21
21
  }
22
22
 
23
23
  export function escapeFieldValueStr(str) {
24
- return (
25
- '"' +
26
- str
27
- .replace(/\\/g, '\\\\')
28
- .replace(/[\\]*"/g, '"')
29
- .replace(/"/g, '\\"') +
30
- '"'
31
- )
24
+ return '"' + str.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"'
32
25
  }
33
26
  export function escapeRowField(value) {
34
27
  if (typeof value === 'object' && value) {