@ohbug/browser 2.2.0 → 2.3.0
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/dist/index.d.ts +7 -3
- package/dist/index.js +25 -16
- package/dist/index.mjs +19 -16
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -8,9 +8,9 @@ declare const BrowserClient: OhbugBrowserClient;
|
|
|
8
8
|
|
|
9
9
|
interface UncaughtErrorDetail extends OhbugBaseDetail {
|
|
10
10
|
name: string;
|
|
11
|
-
filename
|
|
12
|
-
lineno
|
|
13
|
-
colno
|
|
11
|
+
filename?: string;
|
|
12
|
+
lineno?: number;
|
|
13
|
+
colno?: number;
|
|
14
14
|
stack: string;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -25,6 +25,10 @@ interface ResourceErrorDetail extends OhbugBaseDetail {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
interface UnhandledrejectionErrorDetail extends OhbugBaseDetail {
|
|
28
|
+
name: string;
|
|
29
|
+
filename?: string;
|
|
30
|
+
lineno?: number;
|
|
31
|
+
colno?: number;
|
|
28
32
|
stack: string;
|
|
29
33
|
}
|
|
30
34
|
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __defProps = Object.defineProperties;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
10
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
11
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
12
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -32,6 +34,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
32
34
|
}
|
|
33
35
|
return to;
|
|
34
36
|
};
|
|
37
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
38
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
39
|
+
mod
|
|
40
|
+
));
|
|
35
41
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
42
|
|
|
37
43
|
// src/index.ts
|
|
@@ -77,7 +83,7 @@ var device = () => {
|
|
|
77
83
|
};
|
|
78
84
|
|
|
79
85
|
// src/version.ts
|
|
80
|
-
var version = "2.
|
|
86
|
+
var version = "2.3.0";
|
|
81
87
|
|
|
82
88
|
// src/extension.ts
|
|
83
89
|
var import_core12 = require("@ohbug/core");
|
|
@@ -250,21 +256,17 @@ var import_core9 = require("@ohbug/core");
|
|
|
250
256
|
// src/handle/uncaughtErrorHandler.ts
|
|
251
257
|
var import_utils4 = require("@ohbug/utils");
|
|
252
258
|
var import_core = require("@ohbug/core");
|
|
259
|
+
var import_error_stack_parser = __toESM(require("error-stack-parser"));
|
|
253
260
|
function uncaughtErrorHandler(error) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
filename,
|
|
257
|
-
lineno,
|
|
258
|
-
colno,
|
|
259
|
-
error: { stack, name }
|
|
260
|
-
} = error;
|
|
261
|
+
var _a2, _b2, _c;
|
|
262
|
+
const [stackFrame] = import_error_stack_parser.default.parse(error.error);
|
|
261
263
|
const detail = {
|
|
262
|
-
name,
|
|
263
|
-
message,
|
|
264
|
-
filename,
|
|
265
|
-
lineno,
|
|
266
|
-
colno,
|
|
267
|
-
stack
|
|
264
|
+
name: (_a2 = error == null ? void 0 : error.error) == null ? void 0 : _a2.name,
|
|
265
|
+
message: (error == null ? void 0 : error.message) || ((_b2 = error == null ? void 0 : error.error) == null ? void 0 : _b2.message),
|
|
266
|
+
filename: (error == null ? void 0 : error.filename) || (stackFrame == null ? void 0 : stackFrame.fileName),
|
|
267
|
+
lineno: (error == null ? void 0 : error.lineno) || (stackFrame == null ? void 0 : stackFrame.lineNumber),
|
|
268
|
+
colno: (error == null ? void 0 : error.colno) || (stackFrame == null ? void 0 : stackFrame.columnNumber),
|
|
269
|
+
stack: (_c = error == null ? void 0 : error.error) == null ? void 0 : _c.stack
|
|
268
270
|
};
|
|
269
271
|
const { client } = (0, import_utils4.getOhbugObject)();
|
|
270
272
|
const event = client.createEvent({
|
|
@@ -302,10 +304,17 @@ function resourceErrorHandler(error) {
|
|
|
302
304
|
// src/handle/unhandledrejectionErrorHandler.ts
|
|
303
305
|
var import_utils6 = require("@ohbug/utils");
|
|
304
306
|
var import_core3 = require("@ohbug/core");
|
|
307
|
+
var import_error_stack_parser2 = __toESM(require("error-stack-parser"));
|
|
305
308
|
function unhandledrejectionErrorHandler(error) {
|
|
309
|
+
var _a2, _b2, _c;
|
|
310
|
+
const [stackFrame] = import_error_stack_parser2.default.parse(error.reason);
|
|
306
311
|
const detail = {
|
|
307
|
-
|
|
308
|
-
|
|
312
|
+
name: (_a2 = error == null ? void 0 : error.reason) == null ? void 0 : _a2.name,
|
|
313
|
+
message: ((_b2 = error == null ? void 0 : error.reason) == null ? void 0 : _b2.message) || (error == null ? void 0 : error.reason),
|
|
314
|
+
filename: stackFrame == null ? void 0 : stackFrame.fileName,
|
|
315
|
+
lineno: stackFrame == null ? void 0 : stackFrame.lineNumber,
|
|
316
|
+
colno: stackFrame == null ? void 0 : stackFrame.columnNumber,
|
|
317
|
+
stack: (_c = error == null ? void 0 : error.reason) == null ? void 0 : _c.stack
|
|
309
318
|
};
|
|
310
319
|
const { client } = (0, import_utils6.getOhbugObject)();
|
|
311
320
|
const event = client.createEvent({
|
package/dist/index.mjs
CHANGED
|
@@ -54,7 +54,7 @@ var device = () => {
|
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
// src/version.ts
|
|
57
|
-
var version = "2.
|
|
57
|
+
var version = "2.3.0";
|
|
58
58
|
|
|
59
59
|
// src/extension.ts
|
|
60
60
|
import { defineExtension } from "@ohbug/core";
|
|
@@ -227,21 +227,17 @@ import { EventTypes as EventTypes9 } from "@ohbug/core";
|
|
|
227
227
|
// src/handle/uncaughtErrorHandler.ts
|
|
228
228
|
import { getOhbugObject as getOhbugObject4 } from "@ohbug/utils";
|
|
229
229
|
import { EventTypes } from "@ohbug/core";
|
|
230
|
+
import ErrorStackParser from "error-stack-parser";
|
|
230
231
|
function uncaughtErrorHandler(error) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
filename,
|
|
234
|
-
lineno,
|
|
235
|
-
colno,
|
|
236
|
-
error: { stack, name }
|
|
237
|
-
} = error;
|
|
232
|
+
var _a2, _b2, _c;
|
|
233
|
+
const [stackFrame] = ErrorStackParser.parse(error.error);
|
|
238
234
|
const detail = {
|
|
239
|
-
name,
|
|
240
|
-
message,
|
|
241
|
-
filename,
|
|
242
|
-
lineno,
|
|
243
|
-
colno,
|
|
244
|
-
stack
|
|
235
|
+
name: (_a2 = error == null ? void 0 : error.error) == null ? void 0 : _a2.name,
|
|
236
|
+
message: (error == null ? void 0 : error.message) || ((_b2 = error == null ? void 0 : error.error) == null ? void 0 : _b2.message),
|
|
237
|
+
filename: (error == null ? void 0 : error.filename) || (stackFrame == null ? void 0 : stackFrame.fileName),
|
|
238
|
+
lineno: (error == null ? void 0 : error.lineno) || (stackFrame == null ? void 0 : stackFrame.lineNumber),
|
|
239
|
+
colno: (error == null ? void 0 : error.colno) || (stackFrame == null ? void 0 : stackFrame.columnNumber),
|
|
240
|
+
stack: (_c = error == null ? void 0 : error.error) == null ? void 0 : _c.stack
|
|
245
241
|
};
|
|
246
242
|
const { client } = getOhbugObject4();
|
|
247
243
|
const event = client.createEvent({
|
|
@@ -279,10 +275,17 @@ function resourceErrorHandler(error) {
|
|
|
279
275
|
// src/handle/unhandledrejectionErrorHandler.ts
|
|
280
276
|
import { getOhbugObject as getOhbugObject6 } from "@ohbug/utils";
|
|
281
277
|
import { EventTypes as EventTypes3 } from "@ohbug/core";
|
|
278
|
+
import ErrorStackParser2 from "error-stack-parser";
|
|
282
279
|
function unhandledrejectionErrorHandler(error) {
|
|
280
|
+
var _a2, _b2, _c;
|
|
281
|
+
const [stackFrame] = ErrorStackParser2.parse(error.reason);
|
|
283
282
|
const detail = {
|
|
284
|
-
|
|
285
|
-
|
|
283
|
+
name: (_a2 = error == null ? void 0 : error.reason) == null ? void 0 : _a2.name,
|
|
284
|
+
message: ((_b2 = error == null ? void 0 : error.reason) == null ? void 0 : _b2.message) || (error == null ? void 0 : error.reason),
|
|
285
|
+
filename: stackFrame == null ? void 0 : stackFrame.fileName,
|
|
286
|
+
lineno: stackFrame == null ? void 0 : stackFrame.lineNumber,
|
|
287
|
+
colno: stackFrame == null ? void 0 : stackFrame.columnNumber,
|
|
288
|
+
stack: (_c = error == null ? void 0 : error.reason) == null ? void 0 : _c.stack
|
|
286
289
|
};
|
|
287
290
|
const { client } = getOhbugObject6();
|
|
288
291
|
const event = client.createEvent({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ohbug/browser",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Ohbug SDK for browsers",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "chenyueban <jasonchan0527@gmail.com>",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@ohbug/core": "2.1.1",
|
|
34
34
|
"@ohbug/types": "2.1.1",
|
|
35
|
-
"@ohbug/utils": "2.0.6"
|
|
35
|
+
"@ohbug/utils": "2.0.6",
|
|
36
|
+
"error-stack-parser": "^2.1.4"
|
|
36
37
|
},
|
|
37
38
|
"scripts": {
|
|
38
39
|
"build": "tsup",
|