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

featured

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

featured - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

48

lib/featured.js
// Generated by CoffeeScript 1.6.3
var featured, fs, functionName, generatedFunctionName, path, rules;
fs = require('fs');
featured = void 0;
path = require('path');
fs = void 0;
functionName = void 0;
generatedFunctionName = void 0;
path = void 0;
rules = void 0;
fs = require("fs");
path = require("path");
featured = exports;

@@ -12,14 +24,17 @@

functionName = '';
functionName = "";
generatedFunctionName = '';
generatedFunctionName = "";
featured.configure = function(opts) {
var defaults, key, val;
defaults = void 0;
key = void 0;
val = void 0;
defaults = {
file: './rules.js',
functionName: '__featured',
generatedFunctionName: '__featuredStatic'
file: "./rules.js",
functionName: "__featured",
generatedFunctionName: "__featuredStatic"
};
opts = opts != null ? opts : {};
opts = (opts != null ? opts : {});
for (key in defaults) {

@@ -42,2 +57,5 @@ val = defaults[key];

var key, value, __featured;
key = void 0;
value = void 0;
__featured = void 0;
__featured = function(featureName) {

@@ -51,3 +69,5 @@ return featured.checkFeature(featureName, req.session);

}
res.locals[generatedFunctionName] = 'var ' + functionName + ' = function(featureName){return ' + functionName + '.defaults[featureName] || false;}' + '; ' + functionName + '.defaults = ' + JSON.stringify(__featured.defaults);
res.locals[generatedFunctionName] = "var " + functionName + " = function(featureName){var s = " + functionName + "; if (s[\"defaults\"] === undefined) { s.defaults = JSON.parse(decodeURIComponent(s.encodedDefaults.d)); s.encodedDefaults = null;} return s.defaults[featureName] || false;}" + "; " + functionName + ".encodedDefaults = " + JSON.stringify({
d: encodeURIComponent(JSON.stringify(__featured.defaults))
});
res.locals[functionName] = __featured;

@@ -60,13 +80,15 @@ req[functionName] = __featured;

var rule, _ref;
if ((session != null ? (_ref = session[functionName]) != null ? _ref[featureName] : void 0 : void 0) != null) {
rule = void 0;
_ref = void 0;
if ((session != null ? ((_ref = session[functionName]) != null ? _ref[featureName] : void 0) : void 0) != null) {
return session[functionName][featureName];
}
rule = rules[featureName];
if (typeof rule === 'undefined') {
if (typeof rule === "undefined") {
return false;
}
if (typeof rule === 'boolean') {
if (typeof rule === "boolean") {
return rule;
}
if (typeof rule === 'function') {
if (typeof rule === "function") {
return rule(session);

@@ -73,0 +95,0 @@ }

{
"name": "featured",
"description": "feature flags for node",
"version": "0.0.3",
"version": "0.0.4",
"homepage": "http://github.com/proksoup/featured",

@@ -6,0 +6,0 @@ "repository": {

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