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

@splitsoftware/splitio

Package Overview
Dependencies
Maintainers
2
Versions
487
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@splitsoftware/splitio - npm Package Compare versions

Comparing version 0.21.0 to 0.22.0

es6/browser.js

39

es6/index.js

@@ -1,36 +0,3 @@

/* @flow */ 'use strict';
let coreSettings = require('./settings');
let core = require('./core');
let tracker = require('@splitsoftware/splitio-metrics').sdk.tracker();
let log = require('debug')('splitio');
function splitio(settings /*: object */) /*: Promise */ {
// setup settings for all the modules
coreSettings.configure(settings);
return core.start().then(storage => {
return {
getTreatment(key /*: string */, featureName /*: string */) /*: string */ {
let split = storage.splits.get(featureName);
let treatment = 'control';
let stop = tracker();
if (split) {
treatment = split.getTreatment(key);
log(`feature ${featureName} key ${key} evaluated as ${treatment}`);
} else {
log(`feature ${featureName} doesn't exist`);
}
stop();
return treatment;
}
};
});
}
module.exports = splitio;
// browserify blacklist the file used for nodejs in the package json, so I
// needed to separate the implementation in this way to prevent problems.
module.exports = require('./node');

@@ -1,37 +0,6 @@

/* @flow */'use strict';
'use strict';
var coreSettings = require('./settings');
var core = require('./core');
var tracker = require('@splitsoftware/splitio-metrics').sdk.tracker();
var log = require('debug')('splitio');
function splitio(settings /*: object */) /*: Promise */{
// setup settings for all the modules
coreSettings.configure(settings);
return core.start().then(function (storage) {
return {
getTreatment: function getTreatment(key /*: string */, featureName /*: string */) /*: string */{
var split = storage.splits.get(featureName);
var treatment = 'control';
var stop = tracker();
if (split) {
treatment = split.getTreatment(key);
log('feature ' + featureName + ' key ' + key + ' evaluated as ' + treatment);
} else {
log('feature ' + featureName + ' doesn\'t exist');
}
stop();
return treatment;
}
};
});
}
module.exports = splitio;
// browserify blacklist the file used for nodejs in the package json, so I
// needed to separate the implementation in this way to prevent problems.
module.exports = require('./node');
//# sourceMappingURL=index.js.map
{
"name": "@splitsoftware/splitio",
"version": "0.21.0",
"version": "0.22.0",
"description": "Split SDK",

@@ -13,2 +13,3 @@ "author": "Facundo Cabrera <facundo@split.io>",

"main": "lib/index.js",
"browser": "lib/browser.js",
"scripts": {

@@ -21,4 +22,4 @@ "build": "./scripts/build.sh",

"dependencies": {
"@splitsoftware/splitio-metrics": "0.21.0",
"@splitsoftware/splitio-cache": "0.21.0",
"@splitsoftware/splitio-metrics": "0.22.0",
"@splitsoftware/splitio-cache": "0.22.0",
"debug": "^2.2.0"

@@ -25,0 +26,0 @@ },

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