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

feature-toggle-service

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feature-toggle-service - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

generate-banner.js

98

lib/feature-toggle-service.js

@@ -0,74 +1,36 @@

/*!
* feature-toggle-service.js v1.2.0
* https://willmendesneto.github.io/feature-toggle-service.js
*
* Licensed MIT © Will Mendes
*/
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(["module"], factory);
} else if (typeof exports !== "undefined") {
factory(module);
} else {
var mod = {
exports: {}
};
factory(mod);
global.featureToggleService = mod.exports;
}
})(this, function (module) {
"use strict";
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
if (typeof define === "function" && define.amd) {
define("FeatureToggleService", ["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
} else {
var mod = {
exports: {}
};
factory(mod.exports);
global.FeatureToggleService = mod.exports;
}
}
})(this, function (exports) {
"use strict";
var _createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
Object.defineProperty(exports, "__esModule", { value: true });
var settings = {};
var isOn = function isOn(key) {
return !!settings[key];
};
}();
var settings = {};
var instance = null;
var FeatureToggleService = function () {
function FeatureToggleService() {
_classCallCheck(this, FeatureToggleService);
if (!instance) {
instance = this;
}
return instance;
}
_createClass(FeatureToggleService, [{
key: "isOn",
value: function isOn(key) {
return !!settings[key];
}
}, {
key: "isOff",
value: function isOff(key) {
return !this.isOn(key);
}
}, {
key: "setConfigurationObject",
value: function setConfigurationObject(obj) {
exports.isOn = isOn;
var isOff = function isOff(key) {
return !isOn(key);
};
exports.isOff = isOff;
var setConfigurationObject = function setConfigurationObject(obj) {
settings = obj;
}
}]);
return FeatureToggleService;
}();
module.exports = FeatureToggleService;
};
exports.setConfigurationObject = setConfigurationObject;
});

@@ -6,3 +6,3 @@ // Package metadata for feature-toggle-service.js.

summary: "The simplest solution for feature toggle in Javascript. Simple how it should be.",
version: "1.1.0",
version: "2.0.0",
git: "https://github.com/willmendesneto/feature-toggle-service.js"

@@ -9,0 +9,0 @@ });

{
"name": "feature-toggle-service",
"version": "1.1.0",
"version": "1.2.0",
"author": "Will Mendes <willmendesneto@gmail.com>",

@@ -12,2 +12,3 @@ "description": "The simplest solution for feature toggle in Javascript. Simple how it should be.",

"main": "lib/feature-toggle-service.js",
"types": "lib/feature-toggle-service.d.ts",
"keywords": [

@@ -23,36 +24,44 @@ "feature-toggle-service",

"babel-cli": "^6.24.1",
"babel-core": "^6.24.1",
"babel-core": "^6.25.0",
"babel-loader": "^6.4.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.24.1",
"babel-plugin-transform-es2015-modules-umd": "^6.24.1",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babelify": "^7.3.0",
"bannerify": "Vekat/bannerify#feature-option",
"browserify": "^14.3.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.24.1",
"babel-runtime": "^6.23.0",
"commitizen": "^2.9.6",
"conventional-changelog-cli": "^1.3.1",
"cz-conventional-changelog": "^2.0.0",
"eslint": "^3.19.0",
"ghooks": "^2.0.0",
"install": "^0.10.1",
"karma": "^1.6.0",
"karma-browserify": "^5.1.1",
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "^1.0.4",
"mocha": "^3.3.0",
"phantomjs-prebuilt": "^2.1.14",
"mocha": "^3.4.2",
"mustache": "^2.3.0",
"nyc": "^11.0.2",
"ts-node": "^3.0.6",
"tslint": "^5.4.3",
"typescript": "^2.3.4",
"typings": "^2.1.1",
"uglify-js": "^3.0.10",
"validate-commit-msg": "^2.12.1",
"watchify": "^3.9.0"
"semantic-release": "^6.3.6"
},
"engines": {
"node": "6.10.2"
"node": ">=6.10.2"
},
"scripts": {
"build": "npm run build-debug && npm run build-min",
"build-debug": "browserify src/feature-toggle-service.js -s FeatureToggleService -t [babelify] -p [bannerify --file .banner ] -o dist/feature-toggle-service.js",
"build-min": "uglifyjs dist/feature-toggle-service.js --comments '/!/' -m ie8=false -c ie8=false,unused=false -o dist/feature-toggle-service.min.js",
"build-watch": "watchify src/feature-toggle-service.js -s feature-toggle-service -t [babelify] -o dist/feature-toggle-service.js -v",
"test": "karma start --single-run",
"test-watch": "karma start",
"compile": "tsc",
"build": "npm run compile && babel lib --out-dir lib && npm run build-min && npm run generate-banner",
"build-min": "uglifyjs lib/feature-toggle-service.js --comments '/!/' -m ie8=false -c ie8=false,unused=false -o lib/feature-toggle-service.min.js",
"commit": "git-cz",
"check-coverage": "cat ./coverage/report-lcov/lcov.info | ./node_modules/.bin/coveralls && rm -rf coverage",
"prepublish": "babel src --out-dir lib",
"pretest": "tslint src",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf coverage",
"test": "npm run compile && NODE_ENV=test nyc --reporter=lcov --reporter=text-summary mocha ./test/*.spec.js --require ./test/setup.js",
"check-coverage": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf coverage",
"prepublish": "npm run build",
"generate-banner": "node generate-banner.js",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"

@@ -73,2 +82,2 @@ },

}
}
}

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

# NGX Feature Toggle
# Feature Toggle Service
[![npm version](https://badge.fury.io/js/feature-toggle-service.svg)](http://badge.fury.io/js/feature-toggle-service) [![npm downloads](https://img.shields.io/npm/dm/feature-toggle-service.svg)](https://npmjs.org/feature-toggle-service)
[![MIT License][license-badge]][LICENSE]
[![MIT License](https://img.shields.io/badge/license-MIT%20License-blue.svg?style=flat-square)](LICENSE)

@@ -58,6 +58,10 @@ [![Build Status](https://travis-ci.org/willmendesneto/feature-toggle-service.svg?branch=master)](https://travis-ci.org/willmendesneto/feature-toggle-service)

```bash
$ choco install nodejs.install -version 6.9.4
$ choco install nodejs.install -version 6.10.2
```
## Demo
Try out the [demo](https://github.com/willmendesneto/feature-toggle-service/blob/master/demo/index.html)!
## Run the app

@@ -77,2 +81,8 @@

## Run the build
```bash
$ npm run build # run the tests
```
## `FeatureToggleService`

@@ -101,5 +111,1 @@

+ <http://github.com/willmendesneto>
[license-badge]: https://img.shields.io/badge/license-MIT%20License-blue.svg?style=flat-square
[license]: https://github.com/willmendesneto/nodebots-workshop/blob/master/LICENSE
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