@haluo/util 1.0.23 → 1.0.24

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.
@@ -9,12 +9,6 @@ var xhr_1 = __importDefault(require("./lib/xhr"));
9
9
  var tracker_1 = __importDefault(require("./utils/tracker"));
10
10
  exports.Tracker = tracker_1.default;
11
11
  // import timing from './lib/timing'
12
- jsError_1.injectJsError({
13
- version: 'wap'
14
- });
15
- xhr_1.default({
16
- version: 'wap'
17
- });
18
12
  function setup(data) {
19
13
  jsError_1.injectJsError(data);
20
14
  xhr_1.default(data);
@@ -31,6 +31,8 @@ function injectXHR(data) {
31
31
  var handler = function (type) { return function (event) {
32
32
  if (_this.logData.url.indexOf('app/collect/original/info/report/v2') > -1)
33
33
  return;
34
+ if (type !== 'error')
35
+ return;
34
36
  var duration = Date.now() - startTime_1;
35
37
  var status = _this.status;
36
38
  var statusText = _this.statusText;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haluo/util",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "main": "./dist/index.js",
5
5
  "author": "<wanghui@jddmoto.com>",
6
6
  "description": "哈罗摩托工具库",
@@ -3,12 +3,6 @@ import injectXhrError from './lib/xhr'
3
3
  import Tracker from './utils/tracker'
4
4
 
5
5
  // import timing from './lib/timing'
6
- injectJsError({
7
- version: 'wap'
8
- })
9
- injectXhrError({
10
- version: 'wap'
11
- })
12
6
  export default function setup(data:any) {
13
7
  injectJsError(data)
14
8
  injectXhrError(data)
@@ -13,6 +13,7 @@ export default function injectXHR(data:any={}){
13
13
  const startTime = Date.now()
14
14
  const handler = (type:string) => (event:any) => {
15
15
  if(this.logData.url.indexOf('app/collect/original/info/report/v2') > -1 ) return
16
+ if(type !== 'error') return
16
17
  let duration = Date.now() - startTime
17
18
  let status = this.status
18
19
  let statusText = this.statusText