@xifan0/monitor-core 0.0.2-beta.15 → 0.0.2-beta.17

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 CHANGED
@@ -26,13 +26,11 @@ module.exports = __toCommonJS(index_exports);
26
26
 
27
27
  // src/createMonitor.ts
28
28
  function createMonitor(sentry) {
29
- const sentryInstance = sentry && typeof sentry === "object" && sentry.default ? sentry.default : sentry;
29
+ const sentryInstance = (sentry == null ? void 0 : sentry.default) || sentry;
30
30
  const monitor = {
31
31
  init(options) {
32
32
  if (!sentryInstance || typeof sentryInstance.init !== "function") {
33
- throw new Error(
34
- "Sentry.init is not a function. Please ensure @sentry/react is properly imported."
35
- );
33
+ throw new Error("Sentry.init is not a function");
36
34
  }
37
35
  return sentryInstance.init(options);
38
36
  },
@@ -55,7 +53,8 @@ function createMonitor(sentry) {
55
53
  /** 设置用户信息 */
56
54
  setUser(user) {
57
55
  return sentryInstance.setUser(user);
58
- }
56
+ },
57
+ ErrorBoundary: sentryInstance.ErrorBoundary
59
58
  };
60
59
  const proxy = new Proxy(monitor, {
61
60
  get(target, key, receiver) {
package/dist/index.mjs CHANGED
@@ -1,12 +1,10 @@
1
1
  // src/createMonitor.ts
2
2
  function createMonitor(sentry) {
3
- const sentryInstance = sentry && typeof sentry === "object" && sentry.default ? sentry.default : sentry;
3
+ const sentryInstance = (sentry == null ? void 0 : sentry.default) || sentry;
4
4
  const monitor = {
5
5
  init(options) {
6
6
  if (!sentryInstance || typeof sentryInstance.init !== "function") {
7
- throw new Error(
8
- "Sentry.init is not a function. Please ensure @sentry/react is properly imported."
9
- );
7
+ throw new Error("Sentry.init is not a function");
10
8
  }
11
9
  return sentryInstance.init(options);
12
10
  },
@@ -29,7 +27,8 @@ function createMonitor(sentry) {
29
27
  /** 设置用户信息 */
30
28
  setUser(user) {
31
29
  return sentryInstance.setUser(user);
32
- }
30
+ },
31
+ ErrorBoundary: sentryInstance.ErrorBoundary
33
32
  };
34
33
  const proxy = new Proxy(monitor, {
35
34
  get(target, key, receiver) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xifan0/monitor-core",
3
- "version": "0.0.2-beta.15",
3
+ "version": "0.0.2-beta.17",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",