Comparing version 2.1.0 to 2.2.0
@@ -109,2 +109,4 @@ /** | ||
maxCookieAge: 900000, | ||
/** | ||
@@ -260,3 +262,3 @@ * Configure fflip. | ||
// set new fflip cookie with new data | ||
res.cookie('fflip', flags, { maxAge: 900000 }); | ||
res.cookie('fflip', flags, { maxAge: self.maxCookieAge }); | ||
res.json(200, { | ||
@@ -263,0 +265,0 @@ feature: name, |
@@ -6,3 +6,3 @@ { | ||
"licence": "MIT", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"main": "lib/fflip", | ||
@@ -9,0 +9,0 @@ "repository": "FredKSchott/fflip", |
@@ -1,6 +0,6 @@ | ||
[![Build Status](https://travis-ci.org/FredKSchott/fflip.png)](https://travis-ci.org/FredKSchott/fflip) | ||
<a href="https://www.npmjs.com/package/fflip"> | ||
<img align="right" src="https://nodei.co/npm/fflip.png?compact=true" /> | ||
</a> | ||
# <img src="http://fredkschott.com/img/fflipIcon2.png" /> fflip | ||
<img src="http://fredkschott.com/images/fflipIcon2.png" /> fflip | ||
============================ | ||
Working on an experimental new design? Starting a closed beta? Rolling out a new feature over the next few weeks? Fa-fa-fa-flip it! __fflip__ gives you complete control over releasing new functionality to your users based on their user id, join date, membership status, and whatever else you can think of. __fflip's__ goal is to be the most powerful and extensible feature flipping/toggling module on. the. planet. | ||
@@ -28,3 +28,3 @@ | ||
// Get a User's Enabled Features | ||
// Get all of a user's enabled features | ||
var Features = fflip.userFeatures(someFreeUser); | ||
@@ -34,2 +34,6 @@ if(Features.closedBeta) { | ||
} | ||
// Or, just get a single one | ||
if (fflip.userHasFeature(someFreeUser, 'closedBeta')) { | ||
console.log('Welcome to the Closed Beta!'); | ||
} | ||
``` | ||
@@ -48,7 +52,3 @@ | ||
allowUserIDs: function(user, idArr) { | ||
for(var id in idArr) { | ||
if(user.id == idArr[id]) | ||
return true; | ||
} | ||
return false; | ||
return idArr.indexOf(user.id) > -1; | ||
} | ||
@@ -55,0 +55,0 @@ } |
@@ -346,2 +346,12 @@ 'use strict'; | ||
it('should set the right cookie flags when maxCookieAge is set', function() { | ||
var oneMonthMs = 31 * 86400 * 1000; | ||
var oldMaxCookieAge = fflip.maxCookieAge; | ||
fflip.maxCookieAge = oneMonthMs; | ||
fflip.express_route(this.reqMock, this.resMock); | ||
fflip.maxCookieAge = oldMaxCookieAge; | ||
assert(this.resMock.cookie.calledWithMatch('fflip', {fClosed: true}, { maxAge: oneMonthMs })); | ||
}); | ||
it('should send back 200 json response on successful call', function() { | ||
@@ -348,0 +358,0 @@ fflip.express_route(this.reqMock, this.resMock); |
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
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
28370
634