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

rox-base

Package Overview
Dependencies
Maintainers
6
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rox-base - npm Package Compare versions

Comparing version 1.2.8 to 1.2.9

2

package.json
{
"name": "rox-base",
"version": "1.2.8",
"version": "1.2.9",
"description": "Rollout.io ROX JS SDK Base",

@@ -5,0 +5,0 @@ "author": "Rollout.io <support@rollout.io>",

import { Configuration as configurationRepository, Flags as flagsRepository } from '../repositories';
const defaultOptions = { flagsRepository, configurationRepository };
export default class RoxClassRegister {
constructor(options = {} ){
this.options = Object.assign({}, defaultOptions, options)
this._flagsRepository = this.options.flagsRepository
this._configurationRepository = this.options.configurationRepository
constructor(options = {}) {
this.options = Object.assign({}, defaultOptions, options);
this._flagsRepository = this.options.flagsRepository;
this._configurationRepository = this.options.configurationRepository;
}
handleContainer(baseName, container) {
baseName = baseName.length > 0 ? baseName + '.' : ''
for (let prop in container){
baseName = baseName.length > 0 ? baseName + '.' : '';
for (let prop in container) {
if (container.hasOwnProperty(prop)) {
let value = container[prop]
if (value._entityType === 'flag' ||
value._entityType === 'variant'){
this._flagsRepository.addFlag(`${baseName}${prop}`, value);
let entity = container[prop];
if (entity._entityType === 'flag' || entity._entityType === 'variant') {
this._flagsRepository.addFlag(`${baseName}${prop}`, entity);
}
if (value._entityType === 'configuration'){
this._configurationRepository.addRemoteConfiguration(`${baseName}${prop}`, value);
if (entity._entityType === 'configuration') {
this._configurationRepository.addRemoteConfiguration(`${baseName}${prop}`, entity);
}

@@ -24,0 +22,0 @@ }

@@ -14,3 +14,5 @@ import { CustomProperty } from '../entities';

let _deps = {};
let _deps = {
ClassRegister
};
const minimumIntervalInSec = 30;

@@ -78,3 +80,3 @@ const disableIntervalTime = 0;

useCache: false,
shouldProcess: false
shouldProcess: true
});

@@ -97,3 +99,3 @@ }

this.containers[name] = container;
new ClassRegister().handleContainer(name, container);
new _deps.ClassRegister().handleContainer(name, container);
}

@@ -109,8 +111,19 @@

unfreeze() {
FlagsRepository.flags.forEach(flag => {
unfreeze(namespace) {
const namespaceFilter = flag => {
if (!flag.name || typeof namespace !== 'string') return true;
const flagNameParts = flag.name.split('.');
if (flagNameParts.length === 1 && namespace === '') {
return true;
} else if (flagNameParts.slice(0, flagNameParts.length - 1).join('.') === namespace) {
return true;
}
return false;
};
FlagsRepository.flags.filter(namespaceFilter).forEach(flag => {
flag.unfreeze();
});
ConfigurationRepository.remoteConfigurations.forEach(remoteConfiguration => {
ConfigurationRepository.remoteConfigurations.filter(namespaceFilter).forEach(remoteConfiguration => {
remoteConfiguration.unfreeze();

@@ -148,4 +161,4 @@ });

export default function(deps = {}) {
_deps = deps;
_deps = Object.assign({}, _deps, deps);
return instance;
}

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

Sorry, the diff of this file is not supported yet

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

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