@cloudcare/rum-uniapp 2.1.14 → 2.1.16

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.
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.buildEnv = void 0;
7
7
  var buildEnv = {
8
- sdkVersion: '2.1.14',
8
+ sdkVersion: '2.1.16',
9
9
  sdkName: 'df_uniapp_rum_sdk'
10
10
  };
11
11
  exports.buildEnv = buildEnv;
@@ -61,27 +61,23 @@ function proxyXhr(userConfiguration) {
61
61
  dataflux_xhr.startTime = (0, _utils.now)();
62
62
  var originalSuccess = arguments[0].success;
63
63
 
64
- if (typeof originalSuccess === 'function') {
65
- arguments[0].success = function () {
66
- reportXhr(arguments[0]);
64
+ arguments[0].success = function () {
65
+ reportXhr(arguments[0]);
67
66
 
68
- if (originalSuccess) {
69
- originalSuccess.apply(_this, arguments);
70
- }
71
- };
72
- }
67
+ if (typeof originalSuccess === 'function') {
68
+ originalSuccess.apply(_this, arguments);
69
+ }
70
+ };
73
71
 
74
72
  var originalFail = arguments[0].fail;
75
73
 
76
- if (typeof originalFail === 'function') {
77
- arguments[0].fail = function () {
78
- reportXhr(arguments[0]);
74
+ arguments[0].fail = function () {
75
+ reportXhr(arguments[0]);
79
76
 
80
- if (originalFail) {
81
- originalFail.apply(_this, arguments);
82
- }
83
- };
84
- }
77
+ if (typeof originalFail === 'function') {
78
+ originalFail.apply(_this, arguments);
79
+ }
80
+ };
85
81
 
86
82
  var hasBeenReported = false;
87
83
 
@@ -107,7 +103,7 @@ function proxyXhr(userConfiguration) {
107
103
  var result = originalXhrRequest.call(this, dataflux_xhr.option); // 判断结果是否为promise
108
104
 
109
105
  var isPromise = function isPromise(obj) {
110
- return !!obj && (_typeof(obj) === "object" || typeof obj === "function") && typeof obj.then === "function";
106
+ return !!obj && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
111
107
  };
112
108
 
113
109
  if (isPromise(result) && userConfiguration.isVue2) {
@@ -73,7 +73,7 @@ function rewritePage(configuration, lifeCycle, Vue) {
73
73
  }
74
74
 
75
75
  function newView(lifeCycle, route, startTime) {
76
- if (typeof startTime === 'undefined') {
76
+ if (typeof startTime === 'undefined' || Number(startTime) === 0) {
77
77
  startTime = (0, _utils.now)();
78
78
  }
79
79
 
@@ -1,4 +1,4 @@
1
1
  export var buildEnv = {
2
- sdkVersion: '2.1.14',
2
+ sdkVersion: '2.1.16',
3
3
  sdkName: 'df_uniapp_rum_sdk'
4
4
  };
@@ -46,27 +46,23 @@ function proxyXhr(userConfiguration) {
46
46
  dataflux_xhr.startTime = now();
47
47
  var originalSuccess = arguments[0].success;
48
48
 
49
- if (typeof originalSuccess === 'function') {
50
- arguments[0].success = function () {
51
- reportXhr(arguments[0]);
49
+ arguments[0].success = function () {
50
+ reportXhr(arguments[0]);
52
51
 
53
- if (originalSuccess) {
54
- originalSuccess.apply(_this, arguments);
55
- }
56
- };
57
- }
52
+ if (typeof originalSuccess === 'function') {
53
+ originalSuccess.apply(_this, arguments);
54
+ }
55
+ };
58
56
 
59
57
  var originalFail = arguments[0].fail;
60
58
 
61
- if (typeof originalFail === 'function') {
62
- arguments[0].fail = function () {
63
- reportXhr(arguments[0]);
59
+ arguments[0].fail = function () {
60
+ reportXhr(arguments[0]);
64
61
 
65
- if (originalFail) {
66
- originalFail.apply(_this, arguments);
67
- }
68
- };
69
- }
62
+ if (typeof originalFail === 'function') {
63
+ originalFail.apply(_this, arguments);
64
+ }
65
+ };
70
66
 
71
67
  var hasBeenReported = false;
72
68
 
@@ -92,7 +88,7 @@ function proxyXhr(userConfiguration) {
92
88
  var result = originalXhrRequest.call(this, dataflux_xhr.option); // 判断结果是否为promise
93
89
 
94
90
  var isPromise = function isPromise(obj) {
95
- return !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function";
91
+ return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
96
92
  };
97
93
 
98
94
  if (isPromise(result) && userConfiguration.isVue2) {
@@ -61,7 +61,7 @@ export function rewritePage(configuration, lifeCycle, Vue) {
61
61
  }
62
62
 
63
63
  function newView(lifeCycle, route, startTime) {
64
- if (typeof startTime === 'undefined') {
64
+ if (typeof startTime === 'undefined' || Number(startTime) === 0) {
65
65
  startTime = now();
66
66
  }
67
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcare/rum-uniapp",
3
- "version": "2.1.14",
3
+ "version": "2.1.16",
4
4
  "main": "cjs/index.js",
5
5
  "module": "esm/index.js",
6
6
  "miniprogram": "cjs",