@optionfactory/ful 6.0.7 → 7.0.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/ful-client-errors.iife.js +40 -11
- package/dist/ful-client-errors.iife.js.map +1 -1
- package/dist/ful-client-errors.iife.min.js +1 -1
- package/dist/ful-client-errors.iife.min.js.map +1 -1
- package/dist/ful.d.mts +941 -0
- package/dist/ful.iife.js +77 -32
- package/dist/ful.iife.js.map +1 -1
- package/dist/ful.iife.min.js +1 -1
- package/dist/ful.iife.min.js.map +1 -1
- package/dist/ful.min.mjs +1 -1
- package/dist/ful.min.mjs.map +1 -1
- package/dist/ful.mjs +77 -32
- package/dist/ful.mjs.map +1 -1
- package/package.json +19 -12
|
@@ -1,24 +1,41 @@
|
|
|
1
1
|
(function () {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Global error and unhandled promise rejection report handler.
|
|
6
|
+
* @param {any} evt - The triggered event instance (ErrorEvent or PromiseRejectionEvent).
|
|
7
|
+
*/
|
|
4
8
|
function ful_report_error(evt) {
|
|
9
|
+
/**
|
|
10
|
+
* Extracts the content value of a specified meta tag.
|
|
11
|
+
* @param {string} name - The name attribute of the meta tag.
|
|
12
|
+
* @returns {string|undefined} The content of the meta tag, or undefined if not found.
|
|
13
|
+
*/
|
|
5
14
|
function meta_content(name) {
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return v.content;
|
|
11
|
-
});
|
|
12
|
-
return content[0];
|
|
15
|
+
var cleanName = name.replace(/["\\]/g, '\\$&');
|
|
16
|
+
/** @type {HTMLMetaElement | null} */
|
|
17
|
+
var metaEl = document.querySelector('meta[name="' + cleanName + '"]');
|
|
18
|
+
return metaEl ? metaEl.content : undefined;
|
|
13
19
|
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Resolves the configured reporting URI from the DOM script element attribute.
|
|
23
|
+
* @returns {string|null} The reporting URI string, or null if missing.
|
|
24
|
+
*/
|
|
14
25
|
function configured_report_uri() {
|
|
26
|
+
/** @type {HTMLScriptElement | null} */
|
|
15
27
|
var scriptEl = document.querySelector('script[data-report-client-errors-uri]');
|
|
16
28
|
if (!scriptEl) {
|
|
17
29
|
console && console.error && console.error("missing attribute data-report-client-errors-uri");
|
|
18
30
|
return null;
|
|
19
31
|
}
|
|
20
|
-
return scriptEl.
|
|
32
|
+
return scriptEl.getAttribute('data-report-client-errors-uri');
|
|
21
33
|
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Extracts and splits the error stack trace into an array of lines.
|
|
37
|
+
* @returns {string[]|undefined} An array of stack trace lines, or undefined if unavailable.
|
|
38
|
+
*/
|
|
22
39
|
function split_stack() {
|
|
23
40
|
if (evt.error && evt.error.stack && evt.error.stack.split) {
|
|
24
41
|
return evt.error.stack.split("\n");
|
|
@@ -26,8 +43,13 @@
|
|
|
26
43
|
if (evt.reason && evt.reason.stack && evt.reason.stack.split) {
|
|
27
44
|
return evt.reason.stack.split("\n");
|
|
28
45
|
}
|
|
29
|
-
return undefined
|
|
46
|
+
return undefined;
|
|
30
47
|
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Extracts the error message from the event properties.
|
|
51
|
+
* @returns {string|undefined} The extracted error message string, or undefined.
|
|
52
|
+
*/
|
|
31
53
|
function message() {
|
|
32
54
|
if (evt.message) {
|
|
33
55
|
return evt.message;
|
|
@@ -45,10 +67,17 @@
|
|
|
45
67
|
if (!uri) {
|
|
46
68
|
return;
|
|
47
69
|
}
|
|
70
|
+
|
|
71
|
+
/** @type {Record<string, any>} */
|
|
48
72
|
var headers = {
|
|
49
73
|
'Content-Type': 'application/json'
|
|
50
74
|
};
|
|
51
|
-
|
|
75
|
+
|
|
76
|
+
var csrfHeader = meta_content("_csrf_header");
|
|
77
|
+
if (csrfHeader) {
|
|
78
|
+
headers[csrfHeader] = meta_content("_csrf");
|
|
79
|
+
}
|
|
80
|
+
|
|
52
81
|
try {
|
|
53
82
|
fetch(uri, {
|
|
54
83
|
method: 'POST',
|
|
@@ -68,7 +97,7 @@
|
|
|
68
97
|
})
|
|
69
98
|
});
|
|
70
99
|
} catch (e) {
|
|
71
|
-
//nothing to do here
|
|
100
|
+
// nothing to do here
|
|
72
101
|
}
|
|
73
102
|
}
|
|
74
103
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ful-client-errors.iife.js","sources":["../src/client-errors.
|
|
1
|
+
{"version":3,"file":"ful-client-errors.iife.js","sources":["../src/client-errors.mjs"],"sourcesContent":["/**\n * Global error and unhandled promise rejection report handler.\n * @param {any} evt - The triggered event instance (ErrorEvent or PromiseRejectionEvent).\n */\nfunction ful_report_error(evt) {\n /**\n * Extracts the content value of a specified meta tag.\n * @param {string} name - The name attribute of the meta tag.\n * @returns {string|undefined} The content of the meta tag, or undefined if not found.\n */\n function meta_content(name) {\n var cleanName = name.replace(/[\"\\\\]/g, '\\\\$&'); \n /** @type {HTMLMetaElement | null} */\n var metaEl = document.querySelector('meta[name=\"' + cleanName + '\"]');\n return metaEl ? metaEl.content : undefined;\n }\n\n /**\n * Resolves the configured reporting URI from the DOM script element attribute.\n * @returns {string|null} The reporting URI string, or null if missing.\n */\n function configured_report_uri() {\n /** @type {HTMLScriptElement | null} */\n var scriptEl = document.querySelector('script[data-report-client-errors-uri]');\n if (!scriptEl) {\n console && console.error && console.error(\"missing attribute data-report-client-errors-uri\");\n return null;\n }\n return scriptEl.getAttribute('data-report-client-errors-uri');\n }\n\n /**\n * Extracts and splits the error stack trace into an array of lines.\n * @returns {string[]|undefined} An array of stack trace lines, or undefined if unavailable.\n */\n function split_stack() {\n if (evt.error && evt.error.stack && evt.error.stack.split) {\n return evt.error.stack.split(\"\\n\");\n }\n if (evt.reason && evt.reason.stack && evt.reason.stack.split) {\n return evt.reason.stack.split(\"\\n\");\n }\n return undefined;\n }\n\n /**\n * Extracts the error message from the event properties.\n * @returns {string|undefined} The extracted error message string, or undefined.\n */\n function message() {\n if (evt.message) {\n return evt.message;\n }\n if (evt.reason && evt.reason.message) {\n return evt.reason.message;\n }\n if (evt.error && evt.error.message) {\n return evt.error.message;\n }\n return undefined;\n }\n\n var uri = configured_report_uri();\n if (!uri) {\n return;\n }\n\n /** @type {Record<string, any>} */\n var headers = {\n 'Content-Type': 'application/json'\n };\n \n var csrfHeader = meta_content(\"_csrf_header\");\n if (csrfHeader) {\n headers[csrfHeader] = meta_content(\"_csrf\");\n }\n\n try {\n fetch(uri, {\n method: 'POST',\n mode: 'same-origin',\n cache: 'no-cache',\n credentials: 'same-origin',\n headers: headers,\n redirect: 'error',\n referrerPolicy: 'no-referrer-when-downgrade',\n body: JSON.stringify({\n page: window.location && window.location.href ? window.location.href : \"unknown\",\n filename: evt.filename,\n line: evt.lineno,\n col: evt.colno,\n message: message(),\n stack: split_stack()\n })\n });\n } catch (e) {\n // nothing to do here\n }\n}\n\nwindow.addEventListener('error', ful_report_error);\nwindow.addEventListener('unhandledrejection', ful_report_error);"],"names":[],"mappings":";;;IAAA;IACA;IACA;IACA;IACA,SAAS,gBAAgB,CAAC,GAAG,EAAE;IAC/B;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,YAAY,CAAC,IAAI,EAAE;IAChC,QAAQ,IAAI,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACvD;IACA,QAAQ,IAAI,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,aAAa,GAAG,SAAS,GAAG,IAAI,CAAC;IAC7E,QAAQ,OAAO,MAAM,GAAG,MAAM,CAAC,OAAO,GAAG,SAAS;IAClD,IAAI;;IAEJ;IACA;IACA;IACA;IACA,IAAI,SAAS,qBAAqB,GAAG;IACrC;IACA,QAAQ,IAAI,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,uCAAuC,CAAC;IACtF,QAAQ,IAAI,CAAC,QAAQ,EAAE;IACvB,YA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e(e){function r(e){var r=
|
|
1
|
+
!function(){"use strict";function e(e){function r(e){var r=e.replace(/["\\]/g,"\\$&"),o=document.querySelector('meta[name="'+r+'"]');return o?o.content:void 0}var o,n=(o=document.querySelector("script[data-report-client-errors-uri]"))?o.getAttribute("data-report-client-errors-uri"):(console&&console.error&&console.error("missing attribute data-report-client-errors-uri"),null);if(n){var t={"Content-Type":"application/json"},a=r("_csrf_header");a&&(t[a]=r("_csrf"));try{fetch(n,{method:"POST",mode:"same-origin",cache:"no-cache",credentials:"same-origin",headers:t,redirect:"error",referrerPolicy:"no-referrer-when-downgrade",body:JSON.stringify({page:window.location&&window.location.href?window.location.href:"unknown",filename:e.filename,line:e.lineno,col:e.colno,message:e.message?e.message:e.reason&&e.reason.message?e.reason.message:e.error&&e.error.message?e.error.message:void 0,stack:e.error&&e.error.stack&&e.error.stack.split?e.error.stack.split("\n"):e.reason&&e.reason.stack&&e.reason.stack.split?e.reason.stack.split("\n"):void 0})})}catch(e){}}}window.addEventListener("error",e),window.addEventListener("unhandledrejection",e)}();
|
|
2
2
|
//# sourceMappingURL=ful-client-errors.iife.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ful-client-errors.iife.min.js","sources":["../src/client-errors.
|
|
1
|
+
{"version":3,"file":"ful-client-errors.iife.min.js","sources":["../src/client-errors.mjs"],"sourcesContent":["/**\n * Global error and unhandled promise rejection report handler.\n * @param {any} evt - The triggered event instance (ErrorEvent or PromiseRejectionEvent).\n */\nfunction ful_report_error(evt) {\n /**\n * Extracts the content value of a specified meta tag.\n * @param {string} name - The name attribute of the meta tag.\n * @returns {string|undefined} The content of the meta tag, or undefined if not found.\n */\n function meta_content(name) {\n var cleanName = name.replace(/[\"\\\\]/g, '\\\\$&'); \n /** @type {HTMLMetaElement | null} */\n var metaEl = document.querySelector('meta[name=\"' + cleanName + '\"]');\n return metaEl ? metaEl.content : undefined;\n }\n\n /**\n * Resolves the configured reporting URI from the DOM script element attribute.\n * @returns {string|null} The reporting URI string, or null if missing.\n */\n function configured_report_uri() {\n /** @type {HTMLScriptElement | null} */\n var scriptEl = document.querySelector('script[data-report-client-errors-uri]');\n if (!scriptEl) {\n console && console.error && console.error(\"missing attribute data-report-client-errors-uri\");\n return null;\n }\n return scriptEl.getAttribute('data-report-client-errors-uri');\n }\n\n /**\n * Extracts and splits the error stack trace into an array of lines.\n * @returns {string[]|undefined} An array of stack trace lines, or undefined if unavailable.\n */\n function split_stack() {\n if (evt.error && evt.error.stack && evt.error.stack.split) {\n return evt.error.stack.split(\"\\n\");\n }\n if (evt.reason && evt.reason.stack && evt.reason.stack.split) {\n return evt.reason.stack.split(\"\\n\");\n }\n return undefined;\n }\n\n /**\n * Extracts the error message from the event properties.\n * @returns {string|undefined} The extracted error message string, or undefined.\n */\n function message() {\n if (evt.message) {\n return evt.message;\n }\n if (evt.reason && evt.reason.message) {\n return evt.reason.message;\n }\n if (evt.error && evt.error.message) {\n return evt.error.message;\n }\n return undefined;\n }\n\n var uri = configured_report_uri();\n if (!uri) {\n return;\n }\n\n /** @type {Record<string, any>} */\n var headers = {\n 'Content-Type': 'application/json'\n };\n \n var csrfHeader = meta_content(\"_csrf_header\");\n if (csrfHeader) {\n headers[csrfHeader] = meta_content(\"_csrf\");\n }\n\n try {\n fetch(uri, {\n method: 'POST',\n mode: 'same-origin',\n cache: 'no-cache',\n credentials: 'same-origin',\n headers: headers,\n redirect: 'error',\n referrerPolicy: 'no-referrer-when-downgrade',\n body: JSON.stringify({\n page: window.location && window.location.href ? window.location.href : \"unknown\",\n filename: evt.filename,\n line: evt.lineno,\n col: evt.colno,\n message: message(),\n stack: split_stack()\n })\n });\n } catch (e) {\n // nothing to do here\n }\n}\n\nwindow.addEventListener('error', ful_report_error);\nwindow.addEventListener('unhandledrejection', ful_report_error);"],"names":["ful_report_error","evt","meta_content","name","cleanName","replace","metaEl","document","querySelector","content","undefined","scriptEl","uri","getAttribute","console","error","headers","csrfHeader","fetch","method","mode","cache","credentials","redirect","referrerPolicy","body","JSON","stringify","page","window","location","href","filename","line","lineno","col","colno","message","reason","stack","split","e","addEventListener"],"mappings":"yBAIA,SAASA,EAAiBC,GAMtB,SAASC,EAAaC,GAClB,IAAIC,EAAYD,EAAKE,QAAQ,SAAU,QAEnCC,EAASC,SAASC,cAAc,cAAgBJ,EAAY,MAChE,OAAOE,EAASA,EAAOG,aAAUC,CACrC,CA+CA,IAvCQC,EAuCJC,GAvCID,EAAWJ,SAASC,cAAc,0CAK/BG,EAASE,aAAa,kCAHzBC,SAAWA,QAAQC,OAASD,QAAQC,MAAM,mDACnC,MAqCf,GAAKH,EAAL,CAKA,IAAII,EAAU,CACV,eAAgB,oBAGhBC,EAAaf,EAAa,gBAC1Be,IACAD,EAAQC,GAAcf,EAAa,UAGvC,IACIgB,MAAMN,EAAK,CACPO,OAAQ,OACRC,KAAM,cACNC,MAAO,WACPC,YAAa,cACbN,QAASA,EACTO,SAAU,QACVC,eAAgB,6BAChBC,KAAMC,KAAKC,UAAU,CACjBC,KAAMC,OAAOC,UAAYD,OAAOC,SAASC,KAAOF,OAAOC,SAASC,KAAO,UACvEC,SAAU/B,EAAI+B,SACdC,KAAMhC,EAAIiC,OACVC,IAAKlC,EAAImC,MACTC,QAzCJpC,EAAIoC,QACGpC,EAAIoC,QAEXpC,EAAIqC,QAAUrC,EAAIqC,OAAOD,QAClBpC,EAAIqC,OAAOD,QAElBpC,EAAIc,OAASd,EAAIc,MAAMsB,QAChBpC,EAAIc,MAAMsB,aADrB,EAoCQE,MAxDJtC,EAAIc,OAASd,EAAIc,MAAMwB,OAAStC,EAAIc,MAAMwB,MAAMC,MACzCvC,EAAIc,MAAMwB,MAAMC,MAAM,MAE7BvC,EAAIqC,QAAUrC,EAAIqC,OAAOC,OAAStC,EAAIqC,OAAOC,MAAMC,MAC5CvC,EAAIqC,OAAOC,MAAMC,MAAM,WADlC,KAwDJ,CAAE,MAAOC,GAET,CAhCA,CAiCJ,CAEAZ,OAAOa,iBAAiB,QAA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