|
| 1 | +/* eslint-disable max-lines */ |
1 | 2 | import {
|
2 | 3 | Breadcrumb,
|
3 | 4 | BreadcrumbHint,
|
@@ -66,19 +67,6 @@ export class Hub implements HubInterface {
|
66 | 67 | this.bindClient(client);
|
67 | 68 | }
|
68 | 69 |
|
69 |
| - /** |
70 |
| - * Internal helper function to call a method on the top client if it exists. |
71 |
| - * |
72 |
| - * @param method The method to call on the client. |
73 |
| - * @param args Arguments to pass to the client function. |
74 |
| - */ |
75 |
| - private _invokeClient<M extends keyof Client>(method: M, ...args: any[]): void { |
76 |
| - const top = this.getStackTop(); |
77 |
| - if (top && top.client && top.client[method]) { |
78 |
| - (top.client as any)[method](...args, top.scope); |
79 |
| - } |
80 |
| - } |
81 |
| - |
82 | 70 | /**
|
83 | 71 | * @inheritDoc
|
84 | 72 | */
|
@@ -156,6 +144,7 @@ export class Hub implements HubInterface {
|
156 | 144 | /**
|
157 | 145 | * @inheritDoc
|
158 | 146 | */
|
| 147 | + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types |
159 | 148 | public captureException(exception: any, hint?: EventHint): string {
|
160 | 149 | const eventId = (this._lastEventId = uuid4());
|
161 | 150 | let finalHint = hint;
|
@@ -244,6 +233,7 @@ export class Hub implements HubInterface {
|
244 | 233 | return;
|
245 | 234 | }
|
246 | 235 |
|
| 236 | + // eslint-disable-next-line @typescript-eslint/unbound-method |
247 | 237 | const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =
|
248 | 238 | (top.client.getOptions && top.client.getOptions()) || {};
|
249 | 239 |
|
@@ -322,7 +312,7 @@ export class Hub implements HubInterface {
|
322 | 312 | /**
|
323 | 313 | * @inheritDoc
|
324 | 314 | */
|
325 |
| - public setContext(name: string, context: { [key: string]: any } | null): void { |
| 315 | + public setContext(name: string, context: { [key: string]: unknown } | null): void { |
326 | 316 | const top = this.getStackTop();
|
327 | 317 | if (!top.scope) {
|
328 | 318 | return;
|
@@ -389,14 +379,29 @@ export class Hub implements HubInterface {
|
389 | 379 | return this._callExtensionMethod<{ [key: string]: string }>('traceHeaders');
|
390 | 380 | }
|
391 | 381 |
|
| 382 | + /** |
| 383 | + * Internal helper function to call a method on the top client if it exists. |
| 384 | + * |
| 385 | + * @param method The method to call on the client. |
| 386 | + * @param args Arguments to pass to the client function. |
| 387 | + */ |
| 388 | + // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 389 | + private _invokeClient<M extends keyof Client>(method: M, ...args: any[]): void { |
| 390 | + const top = this.getStackTop(); |
| 391 | + if (top && top.client && top.client[method]) { |
| 392 | + // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 393 | + (top.client as any)[method](...args, top.scope); |
| 394 | + } |
| 395 | + } |
| 396 | + |
392 | 397 | /**
|
393 | 398 | * Calls global extension method and binding current instance to the function call
|
394 | 399 | */
|
395 |
| - // @ts-ignore |
| 400 | + // @ts-ignore Function lacks ending return statement and return type does not include 'undefined'. ts(2366) |
| 401 | + // eslint-disable-next-line @typescript-eslint/no-explicit-any |
396 | 402 | private _callExtensionMethod<T>(method: string, ...args: any[]): T {
|
397 | 403 | const carrier = getMainCarrier();
|
398 | 404 | const sentry = carrier.__SENTRY__;
|
399 |
| - // tslint:disable-next-line: strict-type-predicates |
400 | 405 | if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {
|
401 | 406 | return sentry.extensions[method].apply(this, args);
|
402 | 407 | }
|
@@ -459,10 +464,10 @@ function getHubFromActiveDomain(registry: Carrier): Hub {
|
459 | 464 | const property = 'domain';
|
460 | 465 | const carrier = getMainCarrier();
|
461 | 466 | const sentry = carrier.__SENTRY__;
|
462 |
| - // tslint:disable-next-line: strict-type-predicates |
463 | 467 | if (!sentry || !sentry.extensions || !sentry.extensions[property]) {
|
464 | 468 | return getHubFromCarrier(registry);
|
465 | 469 | }
|
| 470 | + // eslint-disable-next-line @typescript-eslint/no-explicit-any |
466 | 471 | const domain = sentry.extensions[property] as any;
|
467 | 472 | const activeDomain = domain.active;
|
468 | 473 |
|
|
0 commit comments