Skip to content

Commit c469fdf

Browse files
authored
Fix missing getParsedJSONAssignment property in IEppoClient (#15)
* Fix missing getParsedJSONAssignment property in IEppoClient * Fix subject attributes type
1 parent b2b1e0d commit c469fdf

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eppo/js-client-sdk-common",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"description": "Eppo SDK for client-side JavaScript applications (base for both web and react native)",
55
"main": "dist/index.js",
66
"files": [

src/client/eppo-client.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ export interface IEppoClient {
7676
subjectAttributes?: Record<string, any>,
7777
assignmentHooks?: IAssignmentHooks,
7878
): string | null;
79+
80+
getParsedJSONAssignment(
81+
subjectKey: string,
82+
flagKey: string,
83+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
84+
subjectAttributes?: Record<string, any>,
85+
assignmentHooks?: IAssignmentHooks,
86+
): object | null;
7987
}
8088

8189
export default class EppoClient implements IEppoClient {
@@ -101,7 +109,8 @@ export default class EppoClient implements IEppoClient {
101109
public getStringAssignment(
102110
subjectKey: string,
103111
flagKey: string,
104-
subjectAttributes: Record<string, EppoValue> = {},
112+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
113+
subjectAttributes: Record<string, any> = {},
105114
assignmentHooks?: IAssignmentHooks | undefined,
106115
): string | null {
107116
return (
@@ -118,7 +127,8 @@ export default class EppoClient implements IEppoClient {
118127
getBoolAssignment(
119128
subjectKey: string,
120129
flagKey: string,
121-
subjectAttributes: Record<string, EppoValue> = {},
130+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
131+
subjectAttributes: Record<string, any> = {},
122132
assignmentHooks?: IAssignmentHooks | undefined,
123133
): boolean | null {
124134
return (
@@ -152,7 +162,8 @@ export default class EppoClient implements IEppoClient {
152162
public getJSONStringAssignment(
153163
subjectKey: string,
154164
flagKey: string,
155-
subjectAttributes: Record<string, EppoValue> = {},
165+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
166+
subjectAttributes: Record<string, any> = {},
156167
assignmentHooks?: IAssignmentHooks | undefined,
157168
): string | null {
158169
return (
@@ -169,7 +180,8 @@ export default class EppoClient implements IEppoClient {
169180
public getParsedJSONAssignment(
170181
subjectKey: string,
171182
flagKey: string,
172-
subjectAttributes: Record<string, EppoValue> = {},
183+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
184+
subjectAttributes: Record<string, any> = {},
173185
assignmentHooks?: IAssignmentHooks | undefined,
174186
): object | null {
175187
return (
@@ -186,7 +198,8 @@ export default class EppoClient implements IEppoClient {
186198
private getAssignmentVariation(
187199
subjectKey: string,
188200
flagKey: string,
189-
subjectAttributes: Record<string, EppoValue> = {},
201+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
202+
subjectAttributes: Record<string, any> = {},
190203
assignmentHooks: IAssignmentHooks | undefined,
191204
valueType?: ValueType,
192205
): EppoValue {
@@ -292,7 +305,8 @@ export default class EppoClient implements IEppoClient {
292305
allocationKey: string,
293306
variation: EppoValue,
294307
subjectKey: string,
295-
subjectAttributes: Record<string, EppoValue> | undefined = {},
308+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
309+
subjectAttributes: Record<string, any> | undefined = {},
296310
) {
297311
const event: IAssignmentEvent = {
298312
allocation: allocationKey,

0 commit comments

Comments
 (0)