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

unleash-client

Package Overview
Dependencies
Maintainers
3
Versions
135
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unleash-client - npm Package Compare versions

Comparing version 3.19.0 to 3.19.1

39

lib/client.js

@@ -36,8 +36,10 @@ "use strict";

const enabled = this.isFeatureEnabled(feature, context, fallback);
this.emit(events_2.UnleashEvents.Impression, (0, events_2.createImpressionEvent)({
featureName: name,
context,
enabled,
eventType: 'isEnabled'
}));
if (feature === null || feature === void 0 ? void 0 : feature.impressionData) {
this.emit(events_2.UnleashEvents.Impression, (0, events_2.createImpressionEvent)({
featureName: name,
context,
enabled,
eventType: 'isEnabled',
}));
}
return enabled;

@@ -97,10 +99,13 @@ }

getVariant(name, context, fallbackVariant) {
const variant = this.resolveVariant(name, context, true, fallbackVariant);
this.emit(events_2.UnleashEvents.Impression, (0, events_2.createImpressionEvent)({
featureName: name,
context,
enabled: variant.enabled,
eventType: 'getVariant',
variant: variant.name,
}));
const feature = this.repository.getToggle(name);
const variant = this.resolveVariant(feature, context, true, fallbackVariant);
if (feature === null || feature === void 0 ? void 0 : feature.impressionData) {
this.emit(events_2.UnleashEvents.Impression, (0, events_2.createImpressionEvent)({
featureName: name,
context,
enabled: variant.enabled,
eventType: 'getVariant',
variant: variant.name,
}));
}
return variant;

@@ -112,7 +117,7 @@ }

forceGetVariant(name, context, fallbackVariant) {
return this.resolveVariant(name, context, false, fallbackVariant);
const feature = this.repository.getToggle(name);
return this.resolveVariant(feature, context, false, fallbackVariant);
}
resolveVariant(name, context, checkToggle, fallbackVariant) {
resolveVariant(feature, context, checkToggle, fallbackVariant) {
const fallback = fallbackVariant || (0, variant_1.getDefaultVariant)();
const feature = this.repository.getToggle(name);
if (typeof feature === 'undefined' ||

@@ -119,0 +124,0 @@ !feature.variants ||

@@ -1,1 +0,1 @@

{ "name": "unleash-client-node", "version": "3.19.0", "sdkVersion": "unleash-client-node:3.19.0" }
{ "name": "unleash-client-node", "version": "3.19.1", "sdkVersion": "unleash-client-node:3.19.1" }

@@ -23,3 +23,5 @@ "use strict";

const unleash = initialize(options);
await (0, events_1.once)(unleash, 'synchronized');
if (!unleash.isSynchronized()) {
await (0, events_1.once)(unleash, 'synchronized');
}
return unleash;

@@ -26,0 +28,0 @@ }

@@ -34,2 +34,3 @@ /// <reference types="node" />

private cleanUnleashUrl;
isSynchronized(): boolean;
start(): Promise<void>;

@@ -36,0 +37,0 @@ destroy(): void;

@@ -158,2 +158,5 @@ "use strict";

}
isSynchronized() {
return this.synchronized;
}
async start() {

@@ -160,0 +163,0 @@ await Promise.all([this.repository.start(), this.metrics.start()]);

{
"name": "unleash-client",
"version": "3.19.0",
"version": "3.19.1",
"description": "Unleash Client for Node",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

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 not supported yet

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 not supported yet

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