@flareapp/js 2.5.1 → 2.6.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/browser.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_catchWindowErrors = require('./catchWindowErrors-iATwOwc8.cjs');
2
+ const require_catchWindowErrors = require('./catchWindowErrors-_IlVo06V.cjs');
3
3
  let _flareapp_core = require("@flareapp/core");
4
4
 
5
5
  //#region src/browser.ts
package/dist/browser.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as BrowserFlushScheduler, i as collectBrowser, n as CLIENT_VERSION, r as FetchFileReader, t as catchWindowErrors } from "./catchWindowErrors-Ccmm0zG2.mjs";
1
+ import { a as BrowserFlushScheduler, i as collectBrowser, n as CLIENT_VERSION, r as FetchFileReader, t as catchWindowErrors } from "./catchWindowErrors-DaCqd2yC.mjs";
2
2
  import { Api, Flare as Flare$1, GlobalScopeProvider } from "@flareapp/core";
3
3
 
4
4
  //#region src/browser.ts
@@ -1,4 +1,4 @@
1
- import { redactUrlQuery } from "@flareapp/core";
1
+ import { redactUrlQuery, routeRejection } from "@flareapp/core";
2
2
 
3
3
  //#region src/browser/BrowserFlushScheduler.ts
4
4
  var BrowserFlushScheduler = class {
@@ -102,7 +102,7 @@ var FetchFileReader = class {
102
102
 
103
103
  //#endregion
104
104
  //#region src/env/index.ts
105
- const CLIENT_VERSION = typeof process !== "undefined" && true ? "2.5.1" : "?";
105
+ const CLIENT_VERSION = typeof process !== "undefined" && true ? "2.6.0" : "?";
106
106
 
107
107
  //#endregion
108
108
  //#region src/browser/catchWindowErrors.ts
@@ -116,36 +116,9 @@ function catchWindowErrors() {
116
116
  window.addEventListener("unhandledrejection", (event) => {
117
117
  const flare = window.flare;
118
118
  if (!flare) return;
119
- const reason = event.reason;
120
- if (reason instanceof Error) {
121
- flare.reportSilently(reason);
122
- return;
123
- }
124
- if (hasStack(reason)) {
125
- const error = new Error(describeRejectionReason(reason));
126
- error.stack = reason.stack;
127
- flare.reportSilently(error);
128
- return;
129
- }
130
- Promise.resolve(flare.reportUnhandledRejection(describeRejectionReason(reason))).catch(() => {});
119
+ routeRejection(flare, event.reason);
131
120
  });
132
121
  }
133
- function describeRejectionReason(reason) {
134
- if (typeof reason === "string") return reason;
135
- if (reason && typeof reason === "object") {
136
- const message = reason.message;
137
- if (typeof message === "string") return message;
138
- try {
139
- return JSON.stringify(reason);
140
- } catch {
141
- return "Unhandled promise rejection (non-serializable reason)";
142
- }
143
- }
144
- return String(reason);
145
- }
146
- function hasStack(value) {
147
- return typeof value === "object" && value !== null && "stack" in value && typeof value.stack === "string";
148
- }
149
122
 
150
123
  //#endregion
151
124
  export { BrowserFlushScheduler as a, collectBrowser as i, CLIENT_VERSION as n, FetchFileReader as r, catchWindowErrors as t };
@@ -102,7 +102,7 @@ var FetchFileReader = class {
102
102
 
103
103
  //#endregion
104
104
  //#region src/env/index.ts
105
- const CLIENT_VERSION = typeof process !== "undefined" && true ? "2.5.1" : "?";
105
+ const CLIENT_VERSION = typeof process !== "undefined" && true ? "2.6.0" : "?";
106
106
 
107
107
  //#endregion
108
108
  //#region src/browser/catchWindowErrors.ts
@@ -116,36 +116,9 @@ function catchWindowErrors() {
116
116
  window.addEventListener("unhandledrejection", (event) => {
117
117
  const flare = window.flare;
118
118
  if (!flare) return;
119
- const reason = event.reason;
120
- if (reason instanceof Error) {
121
- flare.reportSilently(reason);
122
- return;
123
- }
124
- if (hasStack(reason)) {
125
- const error = new Error(describeRejectionReason(reason));
126
- error.stack = reason.stack;
127
- flare.reportSilently(error);
128
- return;
129
- }
130
- Promise.resolve(flare.reportUnhandledRejection(describeRejectionReason(reason))).catch(() => {});
119
+ (0, _flareapp_core.routeRejection)(flare, event.reason);
131
120
  });
132
121
  }
133
- function describeRejectionReason(reason) {
134
- if (typeof reason === "string") return reason;
135
- if (reason && typeof reason === "object") {
136
- const message = reason.message;
137
- if (typeof message === "string") return message;
138
- try {
139
- return JSON.stringify(reason);
140
- } catch {
141
- return "Unhandled promise rejection (non-serializable reason)";
142
- }
143
- }
144
- return String(reason);
145
- }
146
- function hasStack(value) {
147
- return typeof value === "object" && value !== null && "stack" in value && typeof value.stack === "string";
148
- }
149
122
 
150
123
  //#endregion
151
124
  Object.defineProperty(exports, 'BrowserFlushScheduler', {
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_catchWindowErrors = require('./catchWindowErrors-iATwOwc8.cjs');
2
+ const require_catchWindowErrors = require('./catchWindowErrors-_IlVo06V.cjs');
3
3
  const require_browser = require('./browser.cjs');
4
4
  let _flareapp_core = require("@flareapp/core");
5
5
 
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as catchWindowErrors } from "./catchWindowErrors-Ccmm0zG2.mjs";
1
+ import { t as catchWindowErrors } from "./catchWindowErrors-DaCqd2yC.mjs";
2
2
  import { Flare } from "./browser.mjs";
3
3
  import { DEFAULT_URL_DENYLIST, GlobalScopeProvider, Logger, NullFileReader, Scope, convertToError, redactUrlQuery, redactUrlQuery as redactFullPath, resolveDenylist } from "@flareapp/core";
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flareapp/js",
3
- "version": "2.5.1",
3
+ "version": "2.6.0",
4
4
  "description": "JavaScript client for flareapp.io",
5
5
  "homepage": "https://flareapp.io",
6
6
  "bugs": {
@@ -59,7 +59,7 @@
59
59
  "release": "release-it"
60
60
  },
61
61
  "dependencies": {
62
- "@flareapp/core": "2.5.1"
62
+ "@flareapp/core": "2.6.0"
63
63
  },
64
64
  "devDependencies": {
65
65
  "error-stack-parser": "^2.0.2",