New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@eppo/js-client-sdk-common

Package Overview
Dependencies
Maintainers
5
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eppo/js-client-sdk-common - npm Package Compare versions

Comparing version 1.5.1 to 1.5.2

3

dist/client/eppo-client.d.ts

@@ -42,2 +42,3 @@ import { IAssignmentHooks } from '../assignment-hooks';

private assignmentLogger;
private isGracefulFailureMode;
constructor(configurationStore: IConfigurationStore);

@@ -50,5 +51,7 @@ getAssignment(subjectKey: string, flagKey: string, subjectAttributes?: Record<string, any>, assignmentHooks?: IAssignmentHooks | undefined): string | null;

getParsedJSONAssignment(subjectKey: string, flagKey: string, subjectAttributes?: Record<string, any>, assignmentHooks?: IAssignmentHooks | undefined): object | null;
private rethrowIfNotGraceful;
private getAssignmentVariation;
private getAssignmentInternal;
setLogger(logger: IAssignmentLogger): void;
setIsGracefulFailureMode(gracefulFailureMode: boolean): void;
private flushQueuedEvents;

@@ -55,0 +58,0 @@ private logAssignment;

@@ -13,2 +13,3 @@ "use strict";

this.queuedEvents = [];
this.isGracefulFailureMode = true;
}

@@ -20,4 +21,9 @@ // @deprecated getAssignment is deprecated in favor of the typed get<Type>Assignment methods

var _a;
return ((_a = this.getAssignmentVariation(subjectKey, flagKey, subjectAttributes, assignmentHooks)
.stringValue) !== null && _a !== void 0 ? _a : null);
try {
return ((_a = this.getAssignmentVariation(subjectKey, flagKey, subjectAttributes, assignmentHooks)
.stringValue) !== null && _a !== void 0 ? _a : null);
}
catch (error) {
return this.rethrowIfNotGraceful(error);
}
}

@@ -28,3 +34,8 @@ getStringAssignment(subjectKey, flagKey,

var _a;
return ((_a = this.getAssignmentVariation(subjectKey, flagKey, subjectAttributes, assignmentHooks, eppo_value_1.ValueType.StringType).stringValue) !== null && _a !== void 0 ? _a : null);
try {
return ((_a = this.getAssignmentVariation(subjectKey, flagKey, subjectAttributes, assignmentHooks, eppo_value_1.ValueType.StringType).stringValue) !== null && _a !== void 0 ? _a : null);
}
catch (error) {
return this.rethrowIfNotGraceful(error);
}
}

@@ -35,7 +46,17 @@ getBoolAssignment(subjectKey, flagKey,

var _a;
return ((_a = this.getAssignmentVariation(subjectKey, flagKey, subjectAttributes, assignmentHooks, eppo_value_1.ValueType.BoolType).boolValue) !== null && _a !== void 0 ? _a : null);
try {
return ((_a = this.getAssignmentVariation(subjectKey, flagKey, subjectAttributes, assignmentHooks, eppo_value_1.ValueType.BoolType).boolValue) !== null && _a !== void 0 ? _a : null);
}
catch (error) {
return this.rethrowIfNotGraceful(error);
}
}
getNumericAssignment(subjectKey, flagKey, subjectAttributes, assignmentHooks) {
var _a;
return ((_a = this.getAssignmentVariation(subjectKey, flagKey, subjectAttributes, assignmentHooks, eppo_value_1.ValueType.NumericType).numericValue) !== null && _a !== void 0 ? _a : null);
try {
return ((_a = this.getAssignmentVariation(subjectKey, flagKey, subjectAttributes, assignmentHooks, eppo_value_1.ValueType.NumericType).numericValue) !== null && _a !== void 0 ? _a : null);
}
catch (error) {
return this.rethrowIfNotGraceful(error);
}
}

@@ -46,3 +67,8 @@ getJSONStringAssignment(subjectKey, flagKey,

var _a;
return ((_a = this.getAssignmentVariation(subjectKey, flagKey, subjectAttributes, assignmentHooks, eppo_value_1.ValueType.JSONType).stringValue) !== null && _a !== void 0 ? _a : null);
try {
return ((_a = this.getAssignmentVariation(subjectKey, flagKey, subjectAttributes, assignmentHooks, eppo_value_1.ValueType.JSONType).stringValue) !== null && _a !== void 0 ? _a : null);
}
catch (error) {
return this.rethrowIfNotGraceful(error);
}
}

@@ -53,4 +79,16 @@ getParsedJSONAssignment(subjectKey, flagKey,

var _a;
return ((_a = this.getAssignmentVariation(subjectKey, flagKey, subjectAttributes, assignmentHooks, eppo_value_1.ValueType.JSONType).objectValue) !== null && _a !== void 0 ? _a : null);
try {
return ((_a = this.getAssignmentVariation(subjectKey, flagKey, subjectAttributes, assignmentHooks, eppo_value_1.ValueType.JSONType).objectValue) !== null && _a !== void 0 ? _a : null);
}
catch (error) {
return this.rethrowIfNotGraceful(error);
}
}
rethrowIfNotGraceful(err) {
if (this.isGracefulFailureMode) {
console.error(`[Eppo SDK] Error getting assignment: ${err.message}`);
return null;
}
throw err;
}
getAssignmentVariation(subjectKey, flagKey,

@@ -110,2 +148,5 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any

}
setIsGracefulFailureMode(gracefulFailureMode) {
this.isGracefulFailureMode = gracefulFailureMode;
}
flushQueuedEvents() {

@@ -112,0 +153,0 @@ var _a;

2

package.json
{
"name": "@eppo/js-client-sdk-common",
"version": "1.5.1",
"version": "1.5.2",
"description": "Eppo SDK for client-side JavaScript applications (base for both web and react native)",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc