From 9fc9d6d46d06f4b340ebb6dc969d6e826a8a539c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Og=C3=B3rek?= Date: Tue, 29 Sep 2020 17:00:51 +0200 Subject: [PATCH] Use Record in scope type as well --- packages/hub/src/scope.ts | 2 +- packages/types/src/scope.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/hub/src/scope.ts b/packages/hub/src/scope.ts index 0f3e86fc6d0c..4799f465a7e8 100644 --- a/packages/hub/src/scope.ts +++ b/packages/hub/src/scope.ts @@ -40,7 +40,7 @@ export class Scope implements ScopeInterface { protected _tags: { [key: string]: string } = {}; /** Extra */ - protected _extra: { [key: string]: unknown } = {}; + protected _extra: Extras = {}; /** Contexts */ protected _contexts: { [key: string]: Record } = {}; diff --git a/packages/types/src/scope.ts b/packages/types/src/scope.ts index d53d525d8af8..bea3217826d1 100644 --- a/packages/types/src/scope.ts +++ b/packages/types/src/scope.ts @@ -13,8 +13,8 @@ export type CaptureContext = Scope | Partial | ((scope: Scope) => export interface ScopeContext { user: User; level: Severity; - extra: { [key: string]: any }; - contexts: { [key: string]: Record }; + extra: Extras; + contexts: { [key: string]: Record }; tags: { [key: string]: string }; fingerprint: string[]; } @@ -82,7 +82,7 @@ export interface Scope { * @param name of the context * @param context Any kind of data. This data will be normailzed. */ - setContext(name: string, context: { [key: string]: any } | null): this; + setContext(name: string, context: Record | null): this; /** * Sets the Span on the scope.