errorreporter 1.0.357 → 1.0.358
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/index.js +51 -74
- package/package.json +15 -15
package/index.js
CHANGED
|
@@ -3,14 +3,22 @@ if(typeof window==='undefined'||window===null)var window=(typeof globalThis==='u
|
|
|
3
3
|
/* 0 */
|
|
4
4
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5
5
|
|
|
6
|
+
// ESM COMPAT FLAG
|
|
6
7
|
__webpack_require__.r(__webpack_exports__);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/*
|
|
8
|
+
|
|
9
|
+
// EXPORTS
|
|
10
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
11
|
+
BASE_ISSUE: function() { return /* binding */ BASE_ISSUE; },
|
|
12
|
+
BROWSER_ISSUE: function() { return /* binding */ BROWSER_ISSUE; },
|
|
13
|
+
"default": function() { return /* binding */ index; },
|
|
14
|
+
determineGlobalContext: function() { return /* binding */ determineGlobalContext; },
|
|
15
|
+
errorHandler: function() { return /* binding */ _errorHandler; },
|
|
16
|
+
globalContext: function() { return /* binding */ globalContext; }
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
;// external "ua-parser-js"
|
|
20
|
+
var external_ua_parser_js_namespaceObject = __WEBPACK_EXTERNAL_MODULE_ua_parser_js_bfffbf01__;
|
|
21
|
+
;// ./index.ts
|
|
14
22
|
/* module decorator */ module = __webpack_require__.hmd(module);
|
|
15
23
|
// #!/usr/bin/env babel-node
|
|
16
24
|
// -*- coding: utf-8 -*-
|
|
@@ -45,18 +53,12 @@ issue.errorMessage=String(errorMessage)||"Unclear";// Checks if given object com
|
|
|
45
53
|
var _matches=function matches(issueItem,issueItemSpecification){if(Object.prototype.toString.call(issueItemSpecification)==="[object Object]"&&Object.prototype.toString.call(issueItem)==="[object Object]"){for(var _i=0,_Object$keys=Object.keys(issueItemSpecification);_i<_Object$keys.length;_i++){var key=_Object$keys[_i];if(!(issueItem[key]&&_matches(issueItem[key],issueItemSpecification[key])))return false}return true}if(Object.prototype.toString.call(issueItemSpecification)==="[object RegExp]")return issueItemSpecification.test(String(issueItem));return issueItemSpecification===issueItem};var _iterator=_createForOfIteratorHelper(_errorHandler.issuesToIgnore),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var issueToIgnore=_step.value;if(_matches(issue,issueToIgnore))_errorHandler.issueToIgnoreHandler(issue,issueToIgnore)}}catch(err){_iterator.e(err)}finally{_iterator.f()}var toString=function toString(value){if(["boolean","number"].includes(_typeof(value))||value===null)return String(value);return"\""+/* eslint-disable @typescript-eslint/no-base-to-string */String(value)/* eslint-enable @typescript-eslint/no-base-to-string */.replace(/\\/g,"\\\\").replace(/\r\n|\r/g,"\\n").replace(/"/g,"\\\"")+"\""};var _serialize=function serialize(value){if(value!==null&&_typeof(value)==="object"&&!(value instanceof RegExp)){if(Array.isArray(value)){var _result="[";var _iterator2=_createForOfIteratorHelper(value),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var item=_step2.value;if(_result!=="[")_result+=",";_result+=_serialize(item)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return"".concat(_result,"]")}var result="{";for(var _i2=0,_Object$keys2=Object.keys(value);_i2<_Object$keys2.length;_i2++){var key=_Object$keys2[_i2];if(result!=="{")result+=",";result+="\"".concat(key,"\":")+_serialize(value[key])}return"".concat(result,"}")}return toString(value)};var errorKey="".concat(errorMessage,"#").concat(location.href,"#")+"".concat(String(lineNumber),"#").concat(String(columnNumber));if(!Object.prototype.hasOwnProperty.call(_errorHandler.reported,errorKey)){_errorHandler.reported[errorKey]=true;var portPrefix=location.port?": ".concat(location.port):"";var headers={"Content-type":"application/json"};globalContext.fetch("".concat(location.protocol,"//").concat(location.hostname).concat(portPrefix)+_errorHandler.reportPath,{body:_serialize({absoluteURL:location.href,columnNumber:columnNumber,errorMessage:errorMessage,issuesToIgnore:_errorHandler.issuesToIgnore,lineNumber:lineNumber,stack:error===null||error===void 0?void 0:error.stack,technologyDescription:issue.technologyDescription,url:url,userAgent:Object.prototype.hasOwnProperty.call(globalContext,"window")&&Object.prototype.hasOwnProperty.call(globalContext.window,"navigator")&&globalContext.window.navigator.userAgent?globalContext.window.navigator.userAgent:"unclear"}),headers:Object.prototype.hasOwnProperty.call(globalContext,"Headers")?new globalContext.Headers(headers):headers,method:"PUT"}).then(_errorHandler.reportedHandler).catch(function(error){_errorHandler.failedHandler(error)})}}catch(error){_errorHandler.failedHandler(error)}};_errorHandler.location={hostname:"localhost",href:"http://localhost",protocol:"http"};/*
|
|
46
54
|
Bound reported errors to globale error handler to avoid global variable
|
|
47
55
|
pollution.
|
|
48
|
-
*/_errorHandler.reported={};var BASE_ISSUE={errorMessage:"",technologyDescription:"Unclear",ua:"",engine:{name:"",version:""},os:{name:"",version:""}};var BROWSER_ISSUE=_objectSpread({},BASE_ISSUE);try{BROWSER_ISSUE=_objectSpread(_objectSpread({},BROWSER_ISSUE),
|
|
49
|
-
}try{if(BROWSER_ISSUE.browser){var _BROWSER_ISSUE$device;BROWSER_ISSUE.technologyDescription="".concat(BROWSER_ISSUE.browser.name," ").concat(BROWSER_ISSUE.browser.major," (")+"".concat(BROWSER_ISSUE.browser.version," | ").concat(BROWSER_ISSUE.engine.name," ")+"".concat(BROWSER_ISSUE.engine.version,") | ").concat(BROWSER_ISSUE.os.name," ")+BROWSER_ISSUE.os.version;if((_BROWSER_ISSUE$device=BROWSER_ISSUE.device)!==null&&_BROWSER_ISSUE$device!==void 0&&_BROWSER_ISSUE$device.model&&BROWSER_ISSUE.device.type&&BROWSER_ISSUE.device.vendor)BROWSER_ISSUE.technologyDescription+=" | ".concat(BROWSER_ISSUE.device.model," ")+"".concat(BROWSER_ISSUE.device.type," ").concat(BROWSER_ISSUE.device.vendor)}}catch(error){console.warn(error)}/* harmony default export */
|
|
56
|
+
*/_errorHandler.reported={};var BASE_ISSUE={errorMessage:"",technologyDescription:"Unclear",ua:"",engine:{name:"",version:""},os:{name:"",version:""}};var BROWSER_ISSUE=_objectSpread({},BASE_ISSUE);try{BROWSER_ISSUE=_objectSpread(_objectSpread({},BROWSER_ISSUE),external_ua_parser_js_namespaceObject())}catch(_unused){// Ignore error.
|
|
57
|
+
}try{if(BROWSER_ISSUE.browser){var _BROWSER_ISSUE$device;BROWSER_ISSUE.technologyDescription="".concat(BROWSER_ISSUE.browser.name," ").concat(BROWSER_ISSUE.browser.major," (")+"".concat(BROWSER_ISSUE.browser.version," | ").concat(BROWSER_ISSUE.engine.name," ")+"".concat(BROWSER_ISSUE.engine.version,") | ").concat(BROWSER_ISSUE.os.name," ")+BROWSER_ISSUE.os.version;if((_BROWSER_ISSUE$device=BROWSER_ISSUE.device)!==null&&_BROWSER_ISSUE$device!==void 0&&_BROWSER_ISSUE$device.model&&BROWSER_ISSUE.device.type&&BROWSER_ISSUE.device.vendor)BROWSER_ISSUE.technologyDescription+=" | ".concat(BROWSER_ISSUE.device.model," ")+"".concat(BROWSER_ISSUE.device.type," ").concat(BROWSER_ISSUE.device.vendor)}}catch(error){console.warn(error)}/* harmony default export */ var index = (_errorHandler);// Register extended error handler globally.
|
|
50
58
|
if(globalContext.addEventListener){// Handling synchronous errors and general runtime errors
|
|
51
59
|
globalContext.addEventListener("error",function(event){_errorHandler(event.message,event.source,event.lineno,event.colno,event.error,event.filename)});// Intercepting unhandled promise rejections (async/await)
|
|
52
60
|
globalContext.addEventListener("unhandledrejection",function(event){_errorHandler(event.reason)})}
|
|
53
61
|
|
|
54
|
-
/***/ }),
|
|
55
|
-
/* 1 */
|
|
56
|
-
/***/ (function(module) {
|
|
57
|
-
|
|
58
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_ua_parser_js_bfffbf01__;
|
|
59
|
-
|
|
60
62
|
/***/ })
|
|
61
63
|
/******/ ]);
|
|
62
64
|
/************************************************************************/
|
|
@@ -89,74 +91,49 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_ua_parser_js_bfffbf01__;
|
|
|
89
91
|
/******/
|
|
90
92
|
/************************************************************************/
|
|
91
93
|
/******/ /* webpack/runtime/define property getters */
|
|
92
|
-
/******/
|
|
93
|
-
/******/
|
|
94
|
-
/******/
|
|
95
|
-
/******/ if(
|
|
96
|
-
/******/
|
|
97
|
-
/******/ while(i < definition.length) {
|
|
98
|
-
/******/ var key = definition[i++];
|
|
99
|
-
/******/ var binding = definition[i++];
|
|
100
|
-
/******/ if(!__webpack_require__.o(exports, key)) {
|
|
101
|
-
/******/ if(binding === 0) {
|
|
102
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
|
|
103
|
-
/******/ } else {
|
|
104
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
|
|
105
|
-
/******/ }
|
|
106
|
-
/******/ } else if(binding === 0) { i++; }
|
|
107
|
-
/******/ }
|
|
108
|
-
/******/ } else {
|
|
109
|
-
/******/ for(var key in definition) {
|
|
110
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
111
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
112
|
-
/******/ }
|
|
113
|
-
/******/ }
|
|
94
|
+
/******/ // define getter/value functions for harmony exports
|
|
95
|
+
/******/ __webpack_require__.d = function(exports, definition) {
|
|
96
|
+
/******/ for(var key in definition) {
|
|
97
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
98
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
114
99
|
/******/ }
|
|
115
|
-
/******/ }
|
|
116
|
-
/******/ }
|
|
100
|
+
/******/ }
|
|
101
|
+
/******/ };
|
|
117
102
|
/******/
|
|
118
103
|
/******/ /* webpack/runtime/global */
|
|
119
|
-
/******/
|
|
120
|
-
/******/
|
|
121
|
-
/******/
|
|
122
|
-
/******/
|
|
123
|
-
/******/
|
|
124
|
-
/******/
|
|
125
|
-
/******/
|
|
126
|
-
/******/
|
|
127
|
-
/******/ })();
|
|
128
|
-
/******/ }();
|
|
104
|
+
/******/ __webpack_require__.g = (function() {
|
|
105
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
106
|
+
/******/ try {
|
|
107
|
+
/******/ return this || new Function('return this')();
|
|
108
|
+
/******/ } catch (e) {
|
|
109
|
+
/******/ if (typeof window === 'object') return window;
|
|
110
|
+
/******/ }
|
|
111
|
+
/******/ })();
|
|
129
112
|
/******/
|
|
130
113
|
/******/ /* webpack/runtime/harmony module decorator */
|
|
131
|
-
/******/
|
|
132
|
-
/******/
|
|
133
|
-
/******/
|
|
134
|
-
/******/
|
|
135
|
-
/******/
|
|
136
|
-
/******/
|
|
137
|
-
/******/
|
|
138
|
-
/******/
|
|
139
|
-
/******/
|
|
140
|
-
/******/
|
|
141
|
-
/******/
|
|
142
|
-
/******/ };
|
|
143
|
-
/******/ }();
|
|
114
|
+
/******/ __webpack_require__.hmd = function(module) {
|
|
115
|
+
/******/ module = Object.create(module);
|
|
116
|
+
/******/ if (!module.children) module.children = [];
|
|
117
|
+
/******/ Object.defineProperty(module, 'exports', {
|
|
118
|
+
/******/ enumerable: true,
|
|
119
|
+
/******/ set: function() {
|
|
120
|
+
/******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
|
|
121
|
+
/******/ }
|
|
122
|
+
/******/ });
|
|
123
|
+
/******/ return module;
|
|
124
|
+
/******/ };
|
|
144
125
|
/******/
|
|
145
126
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
146
|
-
/******/
|
|
147
|
-
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
148
|
-
/******/ }();
|
|
127
|
+
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); };
|
|
149
128
|
/******/
|
|
150
129
|
/******/ /* webpack/runtime/make namespace object */
|
|
151
|
-
/******/
|
|
152
|
-
/******/
|
|
153
|
-
/******/
|
|
154
|
-
/******/
|
|
155
|
-
/******/
|
|
156
|
-
/******/
|
|
157
|
-
/******/
|
|
158
|
-
/******/ };
|
|
159
|
-
/******/ }();
|
|
130
|
+
/******/ // define __esModule on exports
|
|
131
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
132
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
133
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
134
|
+
/******/ }
|
|
135
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
136
|
+
/******/ };
|
|
160
137
|
/******/
|
|
161
138
|
/************************************************************************/
|
|
162
139
|
/******/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "errorreporter",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.358",
|
|
4
4
|
"description": "Error reporter for client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"client",
|
|
@@ -52,26 +52,26 @@
|
|
|
52
52
|
"watch": "weboptimizer build --watch"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@babel/eslint-parser": "^8.0.
|
|
55
|
+
"@babel/eslint-parser": "^8.0.5",
|
|
56
56
|
"@babel/plugin-transform-proto-to-assign": "^8.0.1",
|
|
57
57
|
"@eslint/js": "^10.0.1",
|
|
58
58
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
59
59
|
"@types/jsdom": "^30.0.0",
|
|
60
|
-
"@types/node": "^26.
|
|
60
|
+
"@types/node": "^26.5.1",
|
|
61
61
|
"@types/webpack-env": "^1.18.8",
|
|
62
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
63
|
-
"@typescript-eslint/parser": "^8.
|
|
64
|
-
"clientnode": "^4.0.
|
|
65
|
-
"eslint": "^10.
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^8.70.0",
|
|
63
|
+
"@typescript-eslint/parser": "^8.70.0",
|
|
64
|
+
"clientnode": "^4.0.1516",
|
|
65
|
+
"eslint": "^10.10.0",
|
|
66
66
|
"eslint-config-google": "^0.14.0",
|
|
67
|
-
"eslint-plugin-jsdoc": "^64.
|
|
68
|
-
"jest": "^30.
|
|
67
|
+
"eslint-plugin-jsdoc": "^64.3.9",
|
|
68
|
+
"jest": "^30.5.1",
|
|
69
69
|
"jsdoc": "^4.0.5",
|
|
70
70
|
"node-fetch": "^3.3.2",
|
|
71
|
-
"typescript-eslint": "^8.
|
|
71
|
+
"typescript-eslint": "^8.70.0",
|
|
72
72
|
"ua-parser-js": "^2.0.10",
|
|
73
|
-
"web-documentation": "^1.0.
|
|
74
|
-
"weboptimizer": "^4.0.
|
|
73
|
+
"web-documentation": "^1.0.52",
|
|
74
|
+
"weboptimizer": "^4.0.81",
|
|
75
75
|
"webpack-dev-server": "^6.0.0"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
"globals@npm:^9.18.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch"
|
|
90
90
|
},
|
|
91
91
|
"engines": {
|
|
92
|
-
"node": ">=
|
|
93
|
-
"npm": ">=
|
|
92
|
+
"node": ">=26",
|
|
93
|
+
"npm": ">=12",
|
|
94
94
|
"yarn": ">=4"
|
|
95
95
|
},
|
|
96
96
|
"webDocumentation": {
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
|
-
"packageManager": "yarn@4.
|
|
119
|
+
"packageManager": "yarn@4.18.0"
|
|
120
120
|
}
|