@posthog/core 1.0.2 → 1.2.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/error-tracking/chunk-ids.d.ts +5 -0
- package/dist/error-tracking/chunk-ids.d.ts.map +1 -0
- package/dist/error-tracking/chunk-ids.js +68 -0
- package/dist/error-tracking/chunk-ids.mjs +34 -0
- package/dist/error-tracking/coercers/dom-exception-coercer.d.ts +10 -0
- package/dist/error-tracking/coercers/dom-exception-coercer.d.ts.map +1 -0
- package/dist/error-tracking/coercers/dom-exception-coercer.js +65 -0
- package/dist/error-tracking/coercers/dom-exception-coercer.mjs +31 -0
- package/dist/error-tracking/coercers/error-coercer.d.ts +9 -0
- package/dist/error-tracking/coercers/error-coercer.d.ts.map +1 -0
- package/dist/error-tracking/coercers/error-coercer.js +61 -0
- package/dist/error-tracking/coercers/error-coercer.mjs +27 -0
- package/dist/error-tracking/coercers/error-event-coercer.d.ts +7 -0
- package/dist/error-tracking/coercers/error-event-coercer.d.ts.map +1 -0
- package/dist/error-tracking/coercers/error-event-coercer.js +52 -0
- package/dist/error-tracking/coercers/error-event-coercer.mjs +18 -0
- package/dist/error-tracking/coercers/event-coercer.d.ts +6 -0
- package/dist/error-tracking/coercers/event-coercer.d.ts.map +1 -0
- package/dist/error-tracking/coercers/event-coercer.js +51 -0
- package/dist/error-tracking/coercers/event-coercer.mjs +17 -0
- package/dist/error-tracking/coercers/index.d.ts +9 -0
- package/dist/error-tracking/coercers/index.d.ts.map +1 -0
- package/dist/error-tracking/coercers/index.js +123 -0
- package/dist/error-tracking/coercers/index.mjs +8 -0
- package/dist/error-tracking/coercers/object-coercer.d.ts +14 -0
- package/dist/error-tracking/coercers/object-coercer.d.ts.map +1 -0
- package/dist/error-tracking/coercers/object-coercer.js +85 -0
- package/dist/error-tracking/coercers/object-coercer.mjs +51 -0
- package/dist/error-tracking/coercers/primitive-coercer.d.ts +7 -0
- package/dist/error-tracking/coercers/primitive-coercer.d.ts.map +1 -0
- package/dist/error-tracking/coercers/primitive-coercer.js +49 -0
- package/dist/error-tracking/coercers/primitive-coercer.mjs +15 -0
- package/dist/error-tracking/coercers/promise-rejection-event.d.ts +7 -0
- package/dist/error-tracking/coercers/promise-rejection-event.d.ts.map +1 -0
- package/dist/error-tracking/coercers/promise-rejection-event.js +59 -0
- package/dist/error-tracking/coercers/promise-rejection-event.mjs +25 -0
- package/dist/error-tracking/coercers/string-coercer.d.ts +7 -0
- package/dist/error-tracking/coercers/string-coercer.d.ts.map +1 -0
- package/dist/error-tracking/coercers/string-coercer.js +63 -0
- package/dist/error-tracking/coercers/string-coercer.mjs +29 -0
- package/dist/error-tracking/coercers/utils.d.ts +8 -0
- package/dist/error-tracking/coercers/utils.d.ts.map +1 -0
- package/dist/error-tracking/coercers/utils.js +55 -0
- package/dist/error-tracking/coercers/utils.mjs +18 -0
- package/dist/error-tracking/error-properties-builder.d.ts +18 -0
- package/dist/error-tracking/error-properties-builder.d.ts.map +1 -0
- package/dist/error-tracking/error-properties-builder.js +152 -0
- package/dist/error-tracking/error-properties-builder.mjs +118 -0
- package/dist/error-tracking/index.d.ts +6 -0
- package/dist/error-tracking/index.d.ts.map +1 -0
- package/dist/error-tracking/index.js +87 -0
- package/dist/error-tracking/index.mjs +4 -0
- package/dist/error-tracking/parsers/base.d.ts +9 -0
- package/dist/error-tracking/parsers/base.d.ts.map +1 -0
- package/dist/error-tracking/parsers/base.js +71 -0
- package/dist/error-tracking/parsers/base.mjs +19 -0
- package/dist/error-tracking/parsers/chrome.d.ts +3 -0
- package/dist/error-tracking/parsers/chrome.d.ts.map +1 -0
- package/dist/error-tracking/parsers/chrome.js +61 -0
- package/dist/error-tracking/parsers/chrome.mjs +27 -0
- package/dist/error-tracking/parsers/gecko.d.ts +3 -0
- package/dist/error-tracking/parsers/gecko.d.ts.map +1 -0
- package/dist/error-tracking/parsers/gecko.js +58 -0
- package/dist/error-tracking/parsers/gecko.mjs +24 -0
- package/dist/error-tracking/parsers/index.d.ts +9 -0
- package/dist/error-tracking/parsers/index.d.ts.map +1 -0
- package/dist/error-tracking/parsers/index.js +99 -0
- package/dist/error-tracking/parsers/index.mjs +44 -0
- package/dist/error-tracking/parsers/node.d.ts +3 -0
- package/dist/error-tracking/parsers/node.d.ts.map +1 -0
- package/dist/error-tracking/parsers/node.js +99 -0
- package/dist/error-tracking/parsers/node.mjs +65 -0
- package/dist/error-tracking/parsers/opera.d.ts +4 -0
- package/dist/error-tracking/parsers/opera.d.ts.map +1 -0
- package/dist/error-tracking/parsers/opera.js +49 -0
- package/dist/error-tracking/parsers/opera.mjs +12 -0
- package/dist/error-tracking/parsers/react-native.d.ts +1 -0
- package/dist/error-tracking/parsers/react-native.d.ts.map +1 -0
- package/dist/error-tracking/parsers/react-native.js +5 -0
- package/dist/error-tracking/parsers/react-native.mjs +0 -0
- package/dist/error-tracking/parsers/safari.d.ts +22 -0
- package/dist/error-tracking/parsers/safari.d.ts.map +1 -0
- package/dist/error-tracking/parsers/safari.js +47 -0
- package/dist/error-tracking/parsers/safari.mjs +13 -0
- package/dist/error-tracking/parsers/winjs.d.ts +3 -0
- package/dist/error-tracking/parsers/winjs.d.ts.map +1 -0
- package/dist/error-tracking/parsers/winjs.js +41 -0
- package/dist/error-tracking/parsers/winjs.mjs +7 -0
- package/dist/error-tracking/types.d.ts +87 -0
- package/dist/error-tracking/types.d.ts.map +1 -0
- package/dist/error-tracking/types.js +43 -0
- package/dist/error-tracking/types.mjs +9 -0
- package/dist/error-tracking/utils.d.ts +13 -0
- package/dist/error-tracking/utils.d.ts.map +1 -0
- package/dist/error-tracking/utils.js +57 -0
- package/dist/error-tracking/utils.mjs +23 -0
- package/dist/eventemitter.js +4 -4
- package/dist/eventemitter.mjs +4 -4
- package/dist/featureFlagUtils.js +20 -45
- package/dist/featureFlagUtils.mjs +20 -45
- package/dist/gzip.js +1 -2
- package/dist/gzip.mjs +1 -2
- package/dist/index.d.ts +5 -255
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -1223
- package/dist/index.mjs +6 -1190
- package/dist/posthog-core-stateless.d.ts +204 -0
- package/dist/posthog-core-stateless.d.ts.map +1 -0
- package/dist/posthog-core-stateless.js +675 -0
- package/dist/posthog-core-stateless.mjs +632 -0
- package/dist/posthog-core.d.ts +171 -0
- package/dist/posthog-core.d.ts.map +1 -0
- package/dist/posthog-core.js +554 -0
- package/dist/posthog-core.mjs +520 -0
- package/dist/testing/PostHogCoreTestClient.d.ts +2 -1
- package/dist/testing/PostHogCoreTestClient.d.ts.map +1 -1
- package/dist/testing/PostHogCoreTestClient.js +9 -11
- package/dist/testing/PostHogCoreTestClient.mjs +8 -10
- package/dist/testing/test-utils.d.ts +2 -0
- package/dist/testing/test-utils.d.ts.map +1 -1
- package/dist/testing/test-utils.js +13 -1
- package/dist/testing/test-utils.mjs +11 -2
- package/dist/utils/bucketed-rate-limiter.d.ts.map +1 -1
- package/dist/utils/bucketed-rate-limiter.js +8 -12
- package/dist/utils/bucketed-rate-limiter.mjs +8 -12
- package/dist/utils/index.js +3 -3
- package/dist/utils/index.mjs +3 -3
- package/dist/utils/number-utils.d.ts.map +1 -1
- package/dist/utils/type-utils.d.ts +8 -1
- package/dist/utils/type-utils.d.ts.map +1 -1
- package/dist/utils/type-utils.js +61 -6
- package/dist/utils/type-utils.mjs +36 -2
- package/dist/vendor/uuidv7.js +12 -16
- package/dist/vendor/uuidv7.mjs +12 -16
- package/package.json +10 -4
- package/src/__tests__/featureFlagUtils.spec.ts +427 -0
- package/src/__tests__/gzip.spec.ts +69 -0
- package/src/__tests__/posthog.ai.spec.ts +110 -0
- package/src/__tests__/posthog.capture.spec.ts +91 -0
- package/src/__tests__/posthog.core.spec.ts +135 -0
- package/src/__tests__/posthog.debug.spec.ts +36 -0
- package/src/__tests__/posthog.enqueue.spec.ts +93 -0
- package/src/__tests__/posthog.featureflags.spec.ts +1106 -0
- package/src/__tests__/posthog.featureflags.v1.spec.ts +922 -0
- package/src/__tests__/posthog.flush.spec.ts +237 -0
- package/src/__tests__/posthog.gdpr.spec.ts +50 -0
- package/src/__tests__/posthog.groups.spec.ts +96 -0
- package/src/__tests__/posthog.identify.spec.ts +194 -0
- package/src/__tests__/posthog.init.spec.ts +110 -0
- package/src/__tests__/posthog.listeners.spec.ts +51 -0
- package/src/__tests__/posthog.register.spec.ts +47 -0
- package/src/__tests__/posthog.reset.spec.ts +76 -0
- package/src/__tests__/posthog.sessions.spec.ts +63 -0
- package/src/__tests__/posthog.setProperties.spec.ts +102 -0
- package/src/__tests__/posthog.shutdown.spec.ts +88 -0
- package/src/__tests__/utils.spec.ts +36 -0
- package/src/error-tracking/chunk-ids.ts +58 -0
- package/src/error-tracking/coercers/dom-exception-coercer.ts +38 -0
- package/src/error-tracking/coercers/error-coercer.ts +36 -0
- package/src/error-tracking/coercers/error-event-coercer.ts +24 -0
- package/src/error-tracking/coercers/event-coercer.ts +19 -0
- package/src/error-tracking/coercers/index.ts +8 -0
- package/src/error-tracking/coercers/object-coercer.ts +76 -0
- package/src/error-tracking/coercers/primitive-coercer.ts +19 -0
- package/src/error-tracking/coercers/promise-rejection-event.spec.ts +77 -0
- package/src/error-tracking/coercers/promise-rejection-event.ts +53 -0
- package/src/error-tracking/coercers/string-coercer.spec.ts +26 -0
- package/src/error-tracking/coercers/string-coercer.ts +31 -0
- package/src/error-tracking/coercers/utils.ts +33 -0
- package/src/error-tracking/error-properties-builder.coerce.spec.ts +202 -0
- package/src/error-tracking/error-properties-builder.parse.spec.ts +30 -0
- package/src/error-tracking/error-properties-builder.ts +169 -0
- package/src/error-tracking/index.ts +5 -0
- package/src/error-tracking/parsers/base.ts +29 -0
- package/src/error-tracking/parsers/chrome.ts +53 -0
- package/src/error-tracking/parsers/gecko.ts +38 -0
- package/src/error-tracking/parsers/index.ts +104 -0
- package/src/error-tracking/parsers/node.ts +111 -0
- package/src/error-tracking/parsers/opera.ts +18 -0
- package/src/error-tracking/parsers/react-native.ts +0 -0
- package/src/error-tracking/parsers/safari.ts +33 -0
- package/src/error-tracking/parsers/winjs.ts +12 -0
- package/src/error-tracking/types.ts +107 -0
- package/src/error-tracking/utils.ts +39 -0
- package/src/eventemitter.ts +27 -0
- package/src/featureFlagUtils.ts +192 -0
- package/src/gzip.ts +29 -0
- package/src/index.ts +8 -0
- package/src/posthog-core-stateless.ts +1226 -0
- package/src/posthog-core.ts +958 -0
- package/src/testing/PostHogCoreTestClient.ts +91 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/test-utils.ts +47 -0
- package/src/types.ts +544 -0
- package/src/utils/bucketed-rate-limiter.spec.ts +33 -0
- package/src/utils/bucketed-rate-limiter.ts +85 -0
- package/src/utils/index.ts +98 -0
- package/src/utils/number-utils.spec.ts +89 -0
- package/src/utils/number-utils.ts +30 -0
- package/src/utils/promise-queue.spec.ts +55 -0
- package/src/utils/promise-queue.ts +30 -0
- package/src/utils/string-utils.ts +23 -0
- package/src/utils/type-utils.ts +134 -0
- package/src/vendor/uuidv7.ts +479 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StackFrame, StackLineParser, StackParser } from '../types';
|
|
2
|
+
export { chromeStackLineParser } from './chrome';
|
|
3
|
+
export { winjsStackLineParser } from './winjs';
|
|
4
|
+
export { geckoStackLineParser } from './gecko';
|
|
5
|
+
export { opera10StackLineParser, opera11StackLineParser } from './opera';
|
|
6
|
+
export { nodeStackLineParser } from './node';
|
|
7
|
+
export declare function reverseAndStripFrames(stack: ReadonlyArray<StackFrame>): StackFrame[];
|
|
8
|
+
export declare function createStackParser(...parsers: StackLineParser[]): StackParser;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/error-tracking/parsers/index.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAK5C,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,UAAU,EAAE,CAcpF;AAMD,wBAAgB,iBAAiB,CAAC,GAAG,OAAO,EAAE,eAAe,EAAE,GAAG,WAAW,CA0C5E"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
createStackParser: ()=>createStackParser,
|
|
28
|
+
winjsStackLineParser: ()=>external_winjs_js_namespaceObject.winjsStackLineParser,
|
|
29
|
+
nodeStackLineParser: ()=>external_node_js_namespaceObject.nodeStackLineParser,
|
|
30
|
+
geckoStackLineParser: ()=>external_gecko_js_namespaceObject.geckoStackLineParser,
|
|
31
|
+
opera10StackLineParser: ()=>external_opera_js_namespaceObject.opera10StackLineParser,
|
|
32
|
+
opera11StackLineParser: ()=>external_opera_js_namespaceObject.opera11StackLineParser,
|
|
33
|
+
chromeStackLineParser: ()=>external_chrome_js_namespaceObject.chromeStackLineParser,
|
|
34
|
+
reverseAndStripFrames: ()=>reverseAndStripFrames
|
|
35
|
+
});
|
|
36
|
+
const external_base_js_namespaceObject = require("./base.js");
|
|
37
|
+
const external_chrome_js_namespaceObject = require("./chrome.js");
|
|
38
|
+
const external_winjs_js_namespaceObject = require("./winjs.js");
|
|
39
|
+
const external_gecko_js_namespaceObject = require("./gecko.js");
|
|
40
|
+
const external_opera_js_namespaceObject = require("./opera.js");
|
|
41
|
+
const external_node_js_namespaceObject = require("./node.js");
|
|
42
|
+
const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
|
|
43
|
+
const STACKTRACE_FRAME_LIMIT = 50;
|
|
44
|
+
function reverseAndStripFrames(stack) {
|
|
45
|
+
if (!stack.length) return [];
|
|
46
|
+
const localStack = Array.from(stack);
|
|
47
|
+
localStack.reverse();
|
|
48
|
+
return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame)=>({
|
|
49
|
+
...frame,
|
|
50
|
+
filename: frame.filename || getLastStackFrame(localStack).filename,
|
|
51
|
+
function: frame.function || external_base_js_namespaceObject.UNKNOWN_FUNCTION
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
function getLastStackFrame(arr) {
|
|
55
|
+
return arr[arr.length - 1] || {};
|
|
56
|
+
}
|
|
57
|
+
function createStackParser(...parsers) {
|
|
58
|
+
return (stack, skipFirstLines = 0)=>{
|
|
59
|
+
const frames = [];
|
|
60
|
+
const lines = stack.split('\n');
|
|
61
|
+
for(let i = skipFirstLines; i < lines.length; i++){
|
|
62
|
+
const line = lines[i];
|
|
63
|
+
if (line.length > 1024) continue;
|
|
64
|
+
const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;
|
|
65
|
+
if (!cleanedLine.match(/\S*Error: /)) {
|
|
66
|
+
for (const parser of parsers){
|
|
67
|
+
const frame = parser(cleanedLine);
|
|
68
|
+
if (frame) {
|
|
69
|
+
frames.push(frame);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (frames.length >= STACKTRACE_FRAME_LIMIT) break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return reverseAndStripFrames(frames);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
exports.chromeStackLineParser = __webpack_exports__.chromeStackLineParser;
|
|
80
|
+
exports.createStackParser = __webpack_exports__.createStackParser;
|
|
81
|
+
exports.geckoStackLineParser = __webpack_exports__.geckoStackLineParser;
|
|
82
|
+
exports.nodeStackLineParser = __webpack_exports__.nodeStackLineParser;
|
|
83
|
+
exports.opera10StackLineParser = __webpack_exports__.opera10StackLineParser;
|
|
84
|
+
exports.opera11StackLineParser = __webpack_exports__.opera11StackLineParser;
|
|
85
|
+
exports.reverseAndStripFrames = __webpack_exports__.reverseAndStripFrames;
|
|
86
|
+
exports.winjsStackLineParser = __webpack_exports__.winjsStackLineParser;
|
|
87
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
88
|
+
"chromeStackLineParser",
|
|
89
|
+
"createStackParser",
|
|
90
|
+
"geckoStackLineParser",
|
|
91
|
+
"nodeStackLineParser",
|
|
92
|
+
"opera10StackLineParser",
|
|
93
|
+
"opera11StackLineParser",
|
|
94
|
+
"reverseAndStripFrames",
|
|
95
|
+
"winjsStackLineParser"
|
|
96
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
97
|
+
Object.defineProperty(exports, '__esModule', {
|
|
98
|
+
value: true
|
|
99
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { UNKNOWN_FUNCTION } from "./base.mjs";
|
|
2
|
+
import { chromeStackLineParser } from "./chrome.mjs";
|
|
3
|
+
import { winjsStackLineParser } from "./winjs.mjs";
|
|
4
|
+
import { geckoStackLineParser } from "./gecko.mjs";
|
|
5
|
+
import { opera10StackLineParser, opera11StackLineParser } from "./opera.mjs";
|
|
6
|
+
import { nodeStackLineParser } from "./node.mjs";
|
|
7
|
+
const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
|
|
8
|
+
const STACKTRACE_FRAME_LIMIT = 50;
|
|
9
|
+
function reverseAndStripFrames(stack) {
|
|
10
|
+
if (!stack.length) return [];
|
|
11
|
+
const localStack = Array.from(stack);
|
|
12
|
+
localStack.reverse();
|
|
13
|
+
return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame)=>({
|
|
14
|
+
...frame,
|
|
15
|
+
filename: frame.filename || getLastStackFrame(localStack).filename,
|
|
16
|
+
function: frame.function || UNKNOWN_FUNCTION
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
function getLastStackFrame(arr) {
|
|
20
|
+
return arr[arr.length - 1] || {};
|
|
21
|
+
}
|
|
22
|
+
function createStackParser(...parsers) {
|
|
23
|
+
return (stack, skipFirstLines = 0)=>{
|
|
24
|
+
const frames = [];
|
|
25
|
+
const lines = stack.split('\n');
|
|
26
|
+
for(let i = skipFirstLines; i < lines.length; i++){
|
|
27
|
+
const line = lines[i];
|
|
28
|
+
if (line.length > 1024) continue;
|
|
29
|
+
const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;
|
|
30
|
+
if (!cleanedLine.match(/\S*Error: /)) {
|
|
31
|
+
for (const parser of parsers){
|
|
32
|
+
const frame = parser(cleanedLine);
|
|
33
|
+
if (frame) {
|
|
34
|
+
frames.push(frame);
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (frames.length >= STACKTRACE_FRAME_LIMIT) break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return reverseAndStripFrames(frames);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export { chromeStackLineParser, createStackParser, geckoStackLineParser, nodeStackLineParser, opera10StackLineParser, opera11StackLineParser, reverseAndStripFrames, winjsStackLineParser };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/error-tracking/parsers/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAO1C,eAAO,MAAM,mBAAmB,EAAE,eA4EjC,CAAA"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
nodeStackLineParser: ()=>nodeStackLineParser
|
|
28
|
+
});
|
|
29
|
+
const external_base_js_namespaceObject = require("./base.js");
|
|
30
|
+
const FILENAME_MATCH = /^\s*[-]{4,}$/;
|
|
31
|
+
const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
32
|
+
const nodeStackLineParser = (line)=>{
|
|
33
|
+
const lineMatch = line.match(FULL_MATCH);
|
|
34
|
+
if (lineMatch) {
|
|
35
|
+
let object;
|
|
36
|
+
let method;
|
|
37
|
+
let functionName;
|
|
38
|
+
let typeName;
|
|
39
|
+
let methodName;
|
|
40
|
+
if (lineMatch[1]) {
|
|
41
|
+
functionName = lineMatch[1];
|
|
42
|
+
let methodStart = functionName.lastIndexOf('.');
|
|
43
|
+
if ('.' === functionName[methodStart - 1]) methodStart--;
|
|
44
|
+
if (methodStart > 0) {
|
|
45
|
+
object = functionName.slice(0, methodStart);
|
|
46
|
+
method = functionName.slice(methodStart + 1);
|
|
47
|
+
const objectEnd = object.indexOf('.Module');
|
|
48
|
+
if (objectEnd > 0) {
|
|
49
|
+
functionName = functionName.slice(objectEnd + 1);
|
|
50
|
+
object = object.slice(0, objectEnd);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
typeName = void 0;
|
|
54
|
+
}
|
|
55
|
+
if (method) {
|
|
56
|
+
typeName = object;
|
|
57
|
+
methodName = method;
|
|
58
|
+
}
|
|
59
|
+
if ('<anonymous>' === method) {
|
|
60
|
+
methodName = void 0;
|
|
61
|
+
functionName = void 0;
|
|
62
|
+
}
|
|
63
|
+
if (void 0 === functionName) {
|
|
64
|
+
methodName = methodName || external_base_js_namespaceObject.UNKNOWN_FUNCTION;
|
|
65
|
+
functionName = typeName ? `${typeName}.${methodName}` : methodName;
|
|
66
|
+
}
|
|
67
|
+
let filename = lineMatch[2]?.startsWith('file://') ? lineMatch[2].slice(7) : lineMatch[2];
|
|
68
|
+
const isNative = 'native' === lineMatch[5];
|
|
69
|
+
if (filename?.match(/\/[A-Z]:/)) filename = filename.slice(1);
|
|
70
|
+
if (!filename && lineMatch[5] && !isNative) filename = lineMatch[5];
|
|
71
|
+
return {
|
|
72
|
+
filename: filename ? decodeURI(filename) : void 0,
|
|
73
|
+
module: void 0,
|
|
74
|
+
function: functionName,
|
|
75
|
+
lineno: _parseIntOrUndefined(lineMatch[3]),
|
|
76
|
+
colno: _parseIntOrUndefined(lineMatch[4]),
|
|
77
|
+
in_app: filenameIsInApp(filename || '', isNative),
|
|
78
|
+
platform: "node:javascript"
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
if (line.match(FILENAME_MATCH)) return {
|
|
82
|
+
filename: line,
|
|
83
|
+
platform: "node:javascript"
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
function filenameIsInApp(filename, isNative = false) {
|
|
87
|
+
const isInternal = isNative || filename && !filename.startsWith('/') && !filename.match(/^[A-Z]:/) && !filename.startsWith('.') && !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//);
|
|
88
|
+
return !isInternal && void 0 !== filename && !filename.includes('node_modules/');
|
|
89
|
+
}
|
|
90
|
+
function _parseIntOrUndefined(input) {
|
|
91
|
+
return parseInt(input || '', 10) || void 0;
|
|
92
|
+
}
|
|
93
|
+
exports.nodeStackLineParser = __webpack_exports__.nodeStackLineParser;
|
|
94
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
95
|
+
"nodeStackLineParser"
|
|
96
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
97
|
+
Object.defineProperty(exports, '__esModule', {
|
|
98
|
+
value: true
|
|
99
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { UNKNOWN_FUNCTION } from "./base.mjs";
|
|
2
|
+
const FILENAME_MATCH = /^\s*[-]{4,}$/;
|
|
3
|
+
const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
4
|
+
const nodeStackLineParser = (line)=>{
|
|
5
|
+
const lineMatch = line.match(FULL_MATCH);
|
|
6
|
+
if (lineMatch) {
|
|
7
|
+
let object;
|
|
8
|
+
let method;
|
|
9
|
+
let functionName;
|
|
10
|
+
let typeName;
|
|
11
|
+
let methodName;
|
|
12
|
+
if (lineMatch[1]) {
|
|
13
|
+
functionName = lineMatch[1];
|
|
14
|
+
let methodStart = functionName.lastIndexOf('.');
|
|
15
|
+
if ('.' === functionName[methodStart - 1]) methodStart--;
|
|
16
|
+
if (methodStart > 0) {
|
|
17
|
+
object = functionName.slice(0, methodStart);
|
|
18
|
+
method = functionName.slice(methodStart + 1);
|
|
19
|
+
const objectEnd = object.indexOf('.Module');
|
|
20
|
+
if (objectEnd > 0) {
|
|
21
|
+
functionName = functionName.slice(objectEnd + 1);
|
|
22
|
+
object = object.slice(0, objectEnd);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
typeName = void 0;
|
|
26
|
+
}
|
|
27
|
+
if (method) {
|
|
28
|
+
typeName = object;
|
|
29
|
+
methodName = method;
|
|
30
|
+
}
|
|
31
|
+
if ('<anonymous>' === method) {
|
|
32
|
+
methodName = void 0;
|
|
33
|
+
functionName = void 0;
|
|
34
|
+
}
|
|
35
|
+
if (void 0 === functionName) {
|
|
36
|
+
methodName = methodName || UNKNOWN_FUNCTION;
|
|
37
|
+
functionName = typeName ? `${typeName}.${methodName}` : methodName;
|
|
38
|
+
}
|
|
39
|
+
let filename = lineMatch[2]?.startsWith('file://') ? lineMatch[2].slice(7) : lineMatch[2];
|
|
40
|
+
const isNative = 'native' === lineMatch[5];
|
|
41
|
+
if (filename?.match(/\/[A-Z]:/)) filename = filename.slice(1);
|
|
42
|
+
if (!filename && lineMatch[5] && !isNative) filename = lineMatch[5];
|
|
43
|
+
return {
|
|
44
|
+
filename: filename ? decodeURI(filename) : void 0,
|
|
45
|
+
module: void 0,
|
|
46
|
+
function: functionName,
|
|
47
|
+
lineno: _parseIntOrUndefined(lineMatch[3]),
|
|
48
|
+
colno: _parseIntOrUndefined(lineMatch[4]),
|
|
49
|
+
in_app: filenameIsInApp(filename || '', isNative),
|
|
50
|
+
platform: "node:javascript"
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
if (line.match(FILENAME_MATCH)) return {
|
|
54
|
+
filename: line,
|
|
55
|
+
platform: "node:javascript"
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
function filenameIsInApp(filename, isNative = false) {
|
|
59
|
+
const isInternal = isNative || filename && !filename.startsWith('/') && !filename.match(/^[A-Z]:/) && !filename.startsWith('.') && !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//);
|
|
60
|
+
return !isInternal && void 0 !== filename && !filename.includes('node_modules/');
|
|
61
|
+
}
|
|
62
|
+
function _parseIntOrUndefined(input) {
|
|
63
|
+
return parseInt(input || '', 10) || void 0;
|
|
64
|
+
}
|
|
65
|
+
export { nodeStackLineParser };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opera.d.ts","sourceRoot":"","sources":["../../../src/error-tracking/parsers/opera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAK1C,eAAO,MAAM,sBAAsB,EAAE,eAGpC,CAAA;AAMD,eAAO,MAAM,sBAAsB,EAAE,eAGpC,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
opera11StackLineParser: ()=>opera11StackLineParser,
|
|
28
|
+
opera10StackLineParser: ()=>opera10StackLineParser
|
|
29
|
+
});
|
|
30
|
+
const external_base_js_namespaceObject = require("./base.js");
|
|
31
|
+
const opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
|
|
32
|
+
const opera10StackLineParser = (line)=>{
|
|
33
|
+
const parts = opera10Regex.exec(line);
|
|
34
|
+
return parts ? (0, external_base_js_namespaceObject.createFrame)(parts[2], parts[3] || external_base_js_namespaceObject.UNKNOWN_FUNCTION, +parts[1]) : void 0;
|
|
35
|
+
};
|
|
36
|
+
const opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i;
|
|
37
|
+
const opera11StackLineParser = (line)=>{
|
|
38
|
+
const parts = opera11Regex.exec(line);
|
|
39
|
+
return parts ? (0, external_base_js_namespaceObject.createFrame)(parts[5], parts[3] || parts[4] || external_base_js_namespaceObject.UNKNOWN_FUNCTION, +parts[1], +parts[2]) : void 0;
|
|
40
|
+
};
|
|
41
|
+
exports.opera10StackLineParser = __webpack_exports__.opera10StackLineParser;
|
|
42
|
+
exports.opera11StackLineParser = __webpack_exports__.opera11StackLineParser;
|
|
43
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
44
|
+
"opera10StackLineParser",
|
|
45
|
+
"opera11StackLineParser"
|
|
46
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
47
|
+
Object.defineProperty(exports, '__esModule', {
|
|
48
|
+
value: true
|
|
49
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UNKNOWN_FUNCTION, createFrame } from "./base.mjs";
|
|
2
|
+
const opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
|
|
3
|
+
const opera10StackLineParser = (line)=>{
|
|
4
|
+
const parts = opera10Regex.exec(line);
|
|
5
|
+
return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : void 0;
|
|
6
|
+
};
|
|
7
|
+
const opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i;
|
|
8
|
+
const opera11StackLineParser = (line)=>{
|
|
9
|
+
const parts = opera11Regex.exec(line);
|
|
10
|
+
return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : void 0;
|
|
11
|
+
};
|
|
12
|
+
export { opera10StackLineParser, opera11StackLineParser };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=react-native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native.d.ts","sourceRoot":"","sources":["../../../src/error-tracking/parsers/react-native.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safari web extensions, starting version unknown, can produce "frames-only" stacktraces.
|
|
3
|
+
* What it means, is that instead of format like:
|
|
4
|
+
*
|
|
5
|
+
* Error: wat
|
|
6
|
+
* at function@url:row:col
|
|
7
|
+
* at function@url:row:col
|
|
8
|
+
* at function@url:row:col
|
|
9
|
+
*
|
|
10
|
+
* it produces something like:
|
|
11
|
+
*
|
|
12
|
+
* function@url:row:col
|
|
13
|
+
* function@url:row:col
|
|
14
|
+
* function@url:row:col
|
|
15
|
+
*
|
|
16
|
+
* Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.
|
|
17
|
+
* This function is extracted so that we can use it in both places without duplicating the logic.
|
|
18
|
+
* Unfortunately "just" changing RegExp is too complicated now and making it pass all tests
|
|
19
|
+
* and fix this case seems like an impossible, or at least way too time-consuming task.
|
|
20
|
+
*/
|
|
21
|
+
export declare const extractSafariExtensionDetails: (func: string, filename: string) => [string, string];
|
|
22
|
+
//# sourceMappingURL=safari.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safari.d.ts","sourceRoot":"","sources":["../../../src/error-tracking/parsers/safari.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,6BAA6B,GAAI,MAAM,MAAM,EAAE,UAAU,MAAM,KAAG,CAAC,MAAM,EAAE,MAAM,CAU7F,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
extractSafariExtensionDetails: ()=>extractSafariExtensionDetails
|
|
28
|
+
});
|
|
29
|
+
const external_base_js_namespaceObject = require("./base.js");
|
|
30
|
+
const extractSafariExtensionDetails = (func, filename)=>{
|
|
31
|
+
const isSafariExtension = -1 !== func.indexOf('safari-extension');
|
|
32
|
+
const isSafariWebExtension = -1 !== func.indexOf('safari-web-extension');
|
|
33
|
+
return isSafariExtension || isSafariWebExtension ? [
|
|
34
|
+
-1 !== func.indexOf('@') ? func.split('@')[0] : external_base_js_namespaceObject.UNKNOWN_FUNCTION,
|
|
35
|
+
isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`
|
|
36
|
+
] : [
|
|
37
|
+
func,
|
|
38
|
+
filename
|
|
39
|
+
];
|
|
40
|
+
};
|
|
41
|
+
exports.extractSafariExtensionDetails = __webpack_exports__.extractSafariExtensionDetails;
|
|
42
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
43
|
+
"extractSafariExtensionDetails"
|
|
44
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
45
|
+
Object.defineProperty(exports, '__esModule', {
|
|
46
|
+
value: true
|
|
47
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UNKNOWN_FUNCTION } from "./base.mjs";
|
|
2
|
+
const extractSafariExtensionDetails = (func, filename)=>{
|
|
3
|
+
const isSafariExtension = -1 !== func.indexOf('safari-extension');
|
|
4
|
+
const isSafariWebExtension = -1 !== func.indexOf('safari-web-extension');
|
|
5
|
+
return isSafariExtension || isSafariWebExtension ? [
|
|
6
|
+
-1 !== func.indexOf('@') ? func.split('@')[0] : UNKNOWN_FUNCTION,
|
|
7
|
+
isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`
|
|
8
|
+
] : [
|
|
9
|
+
func,
|
|
10
|
+
filename
|
|
11
|
+
];
|
|
12
|
+
};
|
|
13
|
+
export { extractSafariExtensionDetails };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"winjs.d.ts","sourceRoot":"","sources":["../../../src/error-tracking/parsers/winjs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAK1C,eAAO,MAAM,oBAAoB,EAAE,eAMlC,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
winjsStackLineParser: ()=>winjsStackLineParser
|
|
28
|
+
});
|
|
29
|
+
const external_base_js_namespaceObject = require("./base.js");
|
|
30
|
+
const winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
31
|
+
const winjsStackLineParser = (line)=>{
|
|
32
|
+
const parts = winjsRegex.exec(line);
|
|
33
|
+
return parts ? (0, external_base_js_namespaceObject.createFrame)(parts[2], parts[1] || external_base_js_namespaceObject.UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : void 0) : void 0;
|
|
34
|
+
};
|
|
35
|
+
exports.winjsStackLineParser = __webpack_exports__.winjsStackLineParser;
|
|
36
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
37
|
+
"winjsStackLineParser"
|
|
38
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
39
|
+
Object.defineProperty(exports, '__esModule', {
|
|
40
|
+
value: true
|
|
41
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UNKNOWN_FUNCTION, createFrame } from "./base.mjs";
|
|
2
|
+
const winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
3
|
+
const winjsStackLineParser = (line)=>{
|
|
4
|
+
const parts = winjsRegex.exec(line);
|
|
5
|
+
return parts ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : void 0) : void 0;
|
|
6
|
+
};
|
|
7
|
+
export { winjsStackLineParser };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { JsonType } from '../types';
|
|
2
|
+
export declare const severityLevels: readonly ["fatal", "error", "warning", "log", "info", "debug"];
|
|
3
|
+
export declare type SeverityLevel = (typeof severityLevels)[number];
|
|
4
|
+
export interface PolymorphicEvent {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
readonly type: string;
|
|
7
|
+
readonly target?: unknown;
|
|
8
|
+
readonly currentTarget?: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface EventHint {
|
|
11
|
+
mechanism?: Partial<Mechanism>;
|
|
12
|
+
syntheticException?: Error | null;
|
|
13
|
+
}
|
|
14
|
+
export interface ErrorProperties {
|
|
15
|
+
$exception_list: Exception[];
|
|
16
|
+
$exception_level?: SeverityLevel;
|
|
17
|
+
}
|
|
18
|
+
export interface Exception {
|
|
19
|
+
type?: string;
|
|
20
|
+
value?: string;
|
|
21
|
+
mechanism?: Mechanism;
|
|
22
|
+
module?: string;
|
|
23
|
+
thread_id?: number;
|
|
24
|
+
stacktrace?: {
|
|
25
|
+
frames?: StackFrame[];
|
|
26
|
+
type: 'raw';
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export type ExceptionList = Exception[];
|
|
30
|
+
export interface Mechanism {
|
|
31
|
+
handled?: boolean;
|
|
32
|
+
type?: 'generic' | 'onunhandledrejection' | 'onuncaughtexception' | 'middleware';
|
|
33
|
+
source?: string;
|
|
34
|
+
synthetic?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export type GetModuleFn = (filename: string | undefined) => string | undefined;
|
|
37
|
+
export type StackParser = (stack: string, skipFirstLines?: number) => StackFrame[];
|
|
38
|
+
export type StackLineParser = (line: string) => StackFrame | undefined;
|
|
39
|
+
export type StackFrameModifierFn = (frames: StackFrame[]) => Promise<StackFrame[]>;
|
|
40
|
+
export interface StackFrame {
|
|
41
|
+
platform: string;
|
|
42
|
+
filename?: string;
|
|
43
|
+
function?: string;
|
|
44
|
+
module?: string;
|
|
45
|
+
lineno?: number;
|
|
46
|
+
colno?: number;
|
|
47
|
+
abs_path?: string;
|
|
48
|
+
context_line?: string;
|
|
49
|
+
pre_context?: string[];
|
|
50
|
+
post_context?: string[];
|
|
51
|
+
in_app?: boolean;
|
|
52
|
+
instruction_addr?: string;
|
|
53
|
+
addr_mode?: string;
|
|
54
|
+
vars?: {
|
|
55
|
+
[key: string]: JsonType;
|
|
56
|
+
};
|
|
57
|
+
chunk_id?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface CoercingContext extends EventHint {
|
|
60
|
+
apply: (input: unknown) => ExceptionLike;
|
|
61
|
+
next: (input: unknown) => ExceptionLike | undefined;
|
|
62
|
+
}
|
|
63
|
+
export type ChunkIdMapType = Record<string, string>;
|
|
64
|
+
export interface ParsingContext {
|
|
65
|
+
chunkIdMap?: ChunkIdMapType;
|
|
66
|
+
}
|
|
67
|
+
interface Coercer<T, U, C> {
|
|
68
|
+
match(input: unknown): input is T;
|
|
69
|
+
coerce(input: T, ctx: C): U;
|
|
70
|
+
}
|
|
71
|
+
export type ErrorTrackingCoercer<T> = Coercer<T, ExceptionLike | undefined, CoercingContext>;
|
|
72
|
+
interface BaseException {
|
|
73
|
+
type: string;
|
|
74
|
+
value: string;
|
|
75
|
+
synthetic: boolean;
|
|
76
|
+
}
|
|
77
|
+
export interface ExceptionLike extends BaseException {
|
|
78
|
+
stack?: string;
|
|
79
|
+
cause?: ExceptionLike;
|
|
80
|
+
level?: SeverityLevel;
|
|
81
|
+
}
|
|
82
|
+
export interface ParsedException extends BaseException {
|
|
83
|
+
stack?: StackFrame[];
|
|
84
|
+
cause?: ParsedException;
|
|
85
|
+
}
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=types.d.ts.map
|