Socket
Socket
Sign inDemoInstall

feature-toggle

Package Overview
Dependencies
3
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.3.0

23

dist/feature-toggle-client.js

@@ -1,3 +0,2 @@

!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.setFeatures=e():"undefined"!=typeof global?global.setFeatures=e():"undefined"!=typeof self&&(self.setFeatures=e())}(function(){var define,module,exports;
return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.setFeatures=e():"undefined"!=typeof global?global.setFeatures=e():"undefined"!=typeof self&&(self.setFeatures=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';

@@ -17,4 +16,4 @@

var params = {};
if (location.search) {
var parts = location.search.slice(1).split('&');
if (window.location.search) {
var parts = window.location.search.slice(1).split('&');

@@ -63,3 +62,3 @@ parts.forEach(function (part) {

inactiveFeatures = inactiveFeatures || [];
inactiveFeatures = inactiveFeatures || [];

@@ -79,3 +78,3 @@ return features.filter(function (feature) {

* .ft-new-feature .new-feature { display: block; }
*
*
* @param {Array} features An array of active features.

@@ -91,3 +90,3 @@ */

});
document.getElementsByTagName('body')[0].className =
document.getElementsByTagName('body')[0].className =
classNames.join(' ') + ' ' + featureClasses;

@@ -112,3 +111,3 @@ },

* Check to see if a feature is active.
* @param {String} feature
* @param {String} feature
* @return {Boolean}

@@ -125,3 +124,3 @@ */

* @emits activated
* @param {Array} features
* @param {Array} features
* @return {Object} this (for chaining)

@@ -145,3 +144,3 @@ */

* @emits deactivated
* @param {Array} features
* @param {Array} features
* @return {Object} this (for chaining)

@@ -154,5 +153,5 @@ */

* @type {Array} deactivated features
*/
*/
deactivate: function deactivate(features) {
activeFeatures =
activeFeatures =
activeFeatures.filter(function (feature) {

@@ -159,0 +158,0 @@ return !contains(features, feature);

@@ -15,4 +15,4 @@ 'use strict';

var params = {};
if (location.search) {
var parts = location.search.slice(1).split('&');
if (window.location.search) {
var parts = window.location.search.slice(1).split('&');

@@ -61,3 +61,3 @@ parts.forEach(function (part) {

inactiveFeatures = inactiveFeatures || [];
inactiveFeatures = inactiveFeatures || [];

@@ -77,3 +77,3 @@ return features.filter(function (feature) {

* .ft-new-feature .new-feature { display: block; }
*
*
* @param {Array} features An array of active features.

@@ -89,3 +89,3 @@ */

});
document.getElementsByTagName('body')[0].className =
document.getElementsByTagName('body')[0].className =
classNames.join(' ') + ' ' + featureClasses;

@@ -110,3 +110,3 @@ },

* Check to see if a feature is active.
* @param {String} feature
* @param {String} feature
* @return {Boolean}

@@ -123,3 +123,3 @@ */

* @emits activated
* @param {Array} features
* @param {Array} features
* @return {Object} this (for chaining)

@@ -143,3 +143,3 @@ */

* @emits deactivated
* @param {Array} features
* @param {Array} features
* @return {Object} this (for chaining)

@@ -152,5 +152,5 @@ */

* @type {Array} deactivated features
*/
*/
deactivate: function deactivate(features) {
activeFeatures =
activeFeatures =
activeFeatures.filter(function (feature) {

@@ -157,0 +157,0 @@ return !contains(features, feature);

{
"name": "feature-toggle",
"version": "0.2.0",
"version": "0.3.0",
"description": "A painless feature toggle system in JavaScript. Decouple development and deployment.",
"browser": "feature-toggle-client.js",
"main": "feature-toggle.js",
"main": "feature-toggle-client.js",
"directories": {

@@ -8,0 +8,0 @@ "test": "test"

@@ -117,2 +117,2 @@ feature-toggle

Eric Elliott for ["Programming JavaScript Applications"](http://ericleads.com/javascript-applications/) (O'Reilly)
Eric Elliott for ["Programming JavaScript Applications"](http://pjabook.com) (O'Reilly)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc