From 46f74a74d5b301efddfa88ec9e414d595a900df9 Mon Sep 17 00:00:00 2001 From: Kim Gustyr Date: Mon, 21 Oct 2024 17:02:15 +0100 Subject: [PATCH] fix: Incorrect argument type, interface extension (#261) * fix: Incorrect argument type, interface extension --------- Co-authored-by: Kyle Johnson --- flagsmith-core.ts | 2 +- lib/flagsmith-es/package.json | 2 +- lib/flagsmith/package.json | 2 +- lib/react-native-flagsmith/package.json | 2 +- types.d.ts | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/flagsmith-core.ts b/flagsmith-core.ts index 88d6cc2..d71b70f 100644 --- a/flagsmith-core.ts +++ b/flagsmith-core.ts @@ -677,7 +677,7 @@ const Flagsmith = class { return this.evaluationContext; } - updateContext = (evaluationContext: EvaluationContext) => { + updateContext = (evaluationContext: ClientEvaluationContext) => { return this.setContext({ ...this.getContext(), ...evaluationContext, diff --git a/lib/flagsmith-es/package.json b/lib/flagsmith-es/package.json index befb15e..6c22810 100644 --- a/lib/flagsmith-es/package.json +++ b/lib/flagsmith-es/package.json @@ -1,6 +1,6 @@ { "name": "flagsmith-es", - "version": "7.0.1", + "version": "7.0.2", "description": "Feature flagging to support continuous development. This is an esm equivalent of the standard flagsmith npm module.", "main": "./index.js", "type": "module", diff --git a/lib/flagsmith/package.json b/lib/flagsmith/package.json index 4bfdf3e..0966277 100644 --- a/lib/flagsmith/package.json +++ b/lib/flagsmith/package.json @@ -1,6 +1,6 @@ { "name": "flagsmith", - "version": "7.0.1", + "version": "7.0.2", "description": "Feature flagging to support continuous development", "main": "./index.js", "repository": { diff --git a/lib/react-native-flagsmith/package.json b/lib/react-native-flagsmith/package.json index 4b3cf7c..6d53d31 100644 --- a/lib/react-native-flagsmith/package.json +++ b/lib/react-native-flagsmith/package.json @@ -1,6 +1,6 @@ { "name": "react-native-flagsmith", - "version": "7.0.1", + "version": "7.0.2", "description": "Feature flagging to support continuous development", "main": "./index.js", "repository": { diff --git a/types.d.ts b/types.d.ts index 4ffbb11..0fb55fb 100644 --- a/types.d.ts +++ b/types.d.ts @@ -20,9 +20,9 @@ export declare type ITraits = Record = Record; export interface ClientIdentityEvaluationContext extends IdentityEvaluationContext { - traits?: ITraits; + traits?: null | ITraits; } -export interface ClientEvaluationContext extends EvaluationContext { +export interface ClientEvaluationContext extends Omit { identity?: null | ClientIdentityEvaluationContext; } @@ -153,7 +153,7 @@ export interface IFlagsmith Promise; + updateContext: (context: ClientEvaluationContext) => Promise; /** /** * Get current context.