suite-flipper-js
Advanced tools
Comparing version 1.0.5 to 2.0.0
'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; }; })(); | ||
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; }; })(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var InvalidFlippersError = require('./errors').InvalidFlippersError; | ||
var Flipper = (function () { | ||
function Flipper(avalaibleFlippers) { | ||
function Flipper() { | ||
var avalaibleFlippers = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; | ||
_classCallCheck(this, Flipper); | ||
this._avalaibleFlippers = avalaibleFlippers || []; | ||
this._avalaibleFlippers = avalaibleFlippers; | ||
this.isOn = this.isOn.bind(this); | ||
@@ -28,3 +32,7 @@ this.isOff = this.isOff.bind(this); | ||
key: 'create', | ||
value: function create(avalaibleFlippers) { | ||
value: function create() { | ||
var avalaibleFlippers = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; | ||
if (!Array.isArray(avalaibleFlippers)) throw new InvalidFlippersError(); | ||
return new Flipper(avalaibleFlippers); | ||
@@ -34,3 +42,7 @@ } | ||
key: 'createForApiResponse', | ||
value: function createForApiResponse(apiResponse) { | ||
value: function createForApiResponse() { | ||
var apiResponse = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; | ||
if (!Array.isArray(apiResponse)) throw new InvalidFlippersError(); | ||
var flippers = apiResponse.filter(function (flipper) { | ||
@@ -49,2 +61,4 @@ return flipper.isOn; | ||
module.exports = Flipper; | ||
module.exports = Flipper; | ||
module.exports.InvalidFlippersError = InvalidFlippersError; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "suite-flipper-js", | ||
"version": "1.0.5", | ||
"description": "Flipper Class", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"test": "mocha test", | ||
"build": "rm -rf dist/* && babel lib --ignore __tests__ --out-dir dist", | ||
"prepublish": "npm test && npm run build" | ||
"test": "npm run build && mocha test", | ||
"build": "rm -rf dist/* && babel lib --out-dir dist --source-maps --presets es2015", | ||
"prepublish": "npm test && npm run build", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
}, | ||
"release": { | ||
"verifyConditions": { | ||
"path": "./node_modules/semantic-release/dist/lib/plugin-noop.js" | ||
} | ||
}, | ||
"repository": { | ||
@@ -15,3 +20,3 @@ "type": "git", | ||
}, | ||
"author": "Viktor Somodi <viktor.somodi@emarsys.com>", | ||
"author": "Emartech", | ||
"license": "ISC", | ||
@@ -22,10 +27,10 @@ "bugs": { | ||
"devDependencies": { | ||
"babel": "^5.8.23", | ||
"chai": "^3.2.0", | ||
"lodash": "^3.10.1", | ||
"mocha": "^2.2.5", | ||
"sinon": "^1.16.1", | ||
"sinon-chai": "^2.8.0" | ||
"babel-cli": "6.3.17", | ||
"babel-preset-es2015": "6.3.13", | ||
"chai": "3.4.1", | ||
"mocha": "2.3.4", | ||
"semantic-release": "4.3.5" | ||
}, | ||
"homepage": "https://github.com/emartech/flipper-js#readme" | ||
} | ||
"homepage": "https://github.com/emartech/flipper-js#readme", | ||
"version": "2.0.0" | ||
} |
@@ -1,2 +0,2 @@ | ||
# suite-flipper-js | ||
# Suite Flipper JS | ||
@@ -3,0 +3,0 @@ Install |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
64
8548
7
1