@crashsense/core 1.1.0 → 1.1.1
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.js +34 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1564,9 +1564,40 @@ function createCrashSense(userConfig) {
|
|
|
1564
1564
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
1565
1565
|
const rawEvent = buildRawEvent(err, "manual");
|
|
1566
1566
|
if (context) {
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1567
|
+
const frameworkKeys = /* @__PURE__ */ new Set([
|
|
1568
|
+
"framework",
|
|
1569
|
+
"lifecycleStage",
|
|
1570
|
+
"componentStack",
|
|
1571
|
+
"componentTree",
|
|
1572
|
+
"currentRoute",
|
|
1573
|
+
"storeState",
|
|
1574
|
+
"renderCount",
|
|
1575
|
+
"componentName",
|
|
1576
|
+
"lifecycleInfo"
|
|
1577
|
+
]);
|
|
1578
|
+
const tagEntries = [];
|
|
1579
|
+
for (const [key, value] of Object.entries(context)) {
|
|
1580
|
+
if (key === "framework" && typeof value === "string") {
|
|
1581
|
+
rawEvent.framework.name = value;
|
|
1582
|
+
} else if (key === "lifecycleStage" || key === "lifecycleInfo") {
|
|
1583
|
+
rawEvent.framework.lifecycleStage = String(value);
|
|
1584
|
+
} else if (key === "componentStack" || key === "componentTree") {
|
|
1585
|
+
rawEvent.framework.componentTree = Array.isArray(value) ? value : [String(value)];
|
|
1586
|
+
} else if (key === "currentRoute" && typeof value === "string") {
|
|
1587
|
+
rawEvent.framework.currentRoute = value;
|
|
1588
|
+
} else if (key === "storeState" && typeof value === "object" && value !== null) {
|
|
1589
|
+
rawEvent.framework.storeState = value;
|
|
1590
|
+
} else if (key === "renderCount" && typeof value === "number") {
|
|
1591
|
+
rawEvent.framework.renderCount = value;
|
|
1592
|
+
} else if (key === "componentName") {
|
|
1593
|
+
tagEntries.push([key, String(value)]);
|
|
1594
|
+
} else if (!frameworkKeys.has(key)) {
|
|
1595
|
+
tagEntries.push([key, String(value)]);
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
if (tagEntries.length > 0) {
|
|
1599
|
+
rawEvent.meta.tags = { ...rawEvent.meta.tags, ...Object.fromEntries(tagEntries) };
|
|
1600
|
+
}
|
|
1570
1601
|
}
|
|
1571
1602
|
processRawEvent(rawEvent);
|
|
1572
1603
|
},
|