From 9b55819c790457e3c0b587b2f1452f70846551e7 Mon Sep 17 00:00:00 2001 From: Michael Beemer Date: Fri, 8 Apr 2022 13:18:22 -0400 Subject: [PATCH] Fix setTrait Return Type The `setTrait` method returns a promise but the interface makes it look like a synchronous operation. This could lead to race conditions if the call is not awaited before a `getValue` with a userId is executed. --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index eeac23b..9515fbc 100644 --- a/index.d.ts +++ b/index.d.ts @@ -57,7 +57,7 @@ declare module 'flagsmith-nodejs' { userId: string, key: string, value: string | number | boolean - ): IUserIdentity; + ): Promise; interface IFeature { enabled: boolean;