Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rox-node

Package Overview
Dependencies
Maintainers
6
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rox-node - npm Package Compare versions

Comparing version 1.2.9 to 2.0.2

src/lib/Overrider.js

16

package.json
{
"name": "rox-node",
"version": "1.2.9",
"version": "2.0.2",
"description": "Rollout.io ROX JS SDK Node",

@@ -45,3 +45,3 @@ "author": "Rollout.io <support@rollout.io>",

"dependencies": {
"rox-base": "^1.2.9"
"rox-base": "^2.0.2"
},

@@ -65,6 +65,12 @@ "devDependencies": {

"jest": {
"moduleFileExtensions": ["js"],
"moduleDirectories": ["node_modules"],
"transformIgnorePatterns": ["/node_modules/(?!rox-base).+\\.js$"]
"moduleFileExtensions": [
"js"
],
"moduleDirectories": [
"node_modules"
],
"transformIgnorePatterns": [
"/node_modules/(?!rox-base).+\\.js$"
]
}
}
export const defaultSetupOptions = {
distinctId: null,
version: '0',
syncCompletionHandler: null,
configurationFetchedHandler: function() {},
flagImpressionHandler: null,
fetchIntervalInSec: 60,
devModeSecret: null
};
import RoxBase from 'rox-base';
import Manifest from '../manifest';
import RoxCache from './RoxCache';

@@ -27,2 +28,2 @@ const { DeviceProperties: DevicePropertiesBase } = RoxBase;

export default new DeviceProperties()
export default new DeviceProperties(RoxCache);

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

import Rox from 'rox-base'
import * as Overrider from './Overrider';
export default {
hasFlagOverride: Rox.Overrider.hasOverride,
resetFlagOverride: Rox.Overrider.clearOverride,
setFlagValue: Rox.Overrider.setOverride
}
hasFlagOverride: Overrider.hasOverride,
resetFlagOverride: Overrider.clearOverride,
setFlagValue: Overrider.setOverride
};
import { ROUTES, TYPES } from './httpConst';
import roxBase from 'rox-base';
import * as Overrider from './Overrider';

@@ -70,3 +71,3 @@ const flagsPattern = new RegExp(`^${ROUTES.FLAGS}\/?(.+)?`);

if (!name || !value) return;
roxBase.Overrider.setOverride(name, value);
Overrider.setOverride(name, value);
});

@@ -86,6 +87,6 @@ return allFlagsJSON();

// delete specific override
roxBase.Overrider.clearOverride(matched[1]);
Overrider.clearOverride(matched[1]);
} else {
// delete all overrides
roxBase.Overrider.clearAllOverrides();
Overrider.clearAllOverrides();
}

@@ -92,0 +93,0 @@ } else {

import RoxBase from 'rox-base';
const { RoxLogger, Config: configuration, ConfigurationFetcher } = RoxBase;
const { RoxLogger, Config: configuration } = RoxBase;
import client from './RoxClient';

@@ -19,14 +19,3 @@

return client
.setup(options)
.then(() => {
this.configurationFetcher = new ConfigurationFetcher(
client.appKey,
client.deviceProperties,
client.devModeSecret
);
return this.configurationFetcher.fetchFromNetwork();
})
.then(response => this.configurationFetcher.process(response))
.then(() => client.fetchPeriodically());
return client.setup(options).then(() => client.fetchPeriodically());
}

@@ -33,0 +22,0 @@

@@ -5,2 +5,3 @@ import RoxBase from 'rox-base';

import { getDefaultCustomProperties } from './DefaultProperties';
import RoxCache from './RoxCache';

@@ -12,3 +13,4 @@ const { createRoxClient } = RoxBase;

getDefaultCustomProperties,
DefaultSetupOptions
DefaultSetupOptions,
cacheService: RoxCache
});
import RoxBase from 'rox-base';
import * as Overrider from './Overrider';
const { Variant: BaseVariant } = RoxBase.Entities;

@@ -17,3 +18,5 @@ const { RoxxParser } = RoxBase.Parsers;

const evaluatedResult = parser.evaluateExpression(this.condition, mergedContext);
if (typeof evaluatedResult !== 'undefined') return evaluatedResult;
if (typeof evaluatedResult !== 'undefined' && this._options.indexOf(evaluatedResult) !== -1) {
return evaluatedResult;
}
}

@@ -23,10 +26,19 @@ return this._defaultValue;

getValue(context) {
getValue(context, dontInvokeFlagImpression) {
const overridenValue = this.overridenValue;
return overridenValue ? overridenValue : this.getActiveValue(context);
if (overridenValue) {
return overridenValue;
}
const value = this.getActiveValue(context);
dontInvokeFlagImpression || this._flagImpression(value, context);
return value;
}
_peek() {
return this.getValue();
peek(context) {
return this.getValue(context, true);
}
get overrider() {
return Overrider;
}
}

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