Socket
Socket
Sign inDemoInstall

sap-cf-features

Package Overview
Dependencies
72
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.0.2

2

dist/index.d.ts

@@ -6,2 +6,2 @@ export { IFeatureFlagExport, IFeatureFlagMap, IReturnFlag, IFeatureService } from './types';

export declare function getFeatureFlagString(name: string, tenant: string): Promise<string | undefined>;
export declare function featureFlagRouter(): Promise<import("express-serve-static-core").Router>;
export declare function featureFlagRouter(): import("express-serve-static-core").Router;

@@ -54,24 +54,22 @@ "use strict";

function featureFlagRouter() {
return __awaiter(this, void 0, void 0, function* () {
const router = express_1.Router();
function getDomain(req) {
return req.authInfo ? req.authInfo.subdomain : "";
}
router.get('/:flagName', (req, res, next) => __awaiter(this, void 0, void 0, function* () {
//@ts-ignore
const { flagName } = req.params;
const result = yield getFeatureFlags(flagName, getDomain(req));
res.status(200).json(result);
next();
}));
router.get('/', (req, res, next) => __awaiter(this, void 0, void 0, function* () {
// get all feature-flags
const flagNames = yield FeatureFlagsApi_1.getAllFlagNames();
const result = yield getFeatureFlags(flagNames, getDomain(req));
res.status(200).json(result);
next();
}));
return router;
});
const router = express_1.Router();
function getDomain(req) {
return req.authInfo ? req.authInfo.subdomain : "";
}
router.get('/:flagName', (req, res, next) => __awaiter(this, void 0, void 0, function* () {
//@ts-ignore
const { flagName } = req.params;
const result = yield getFeatureFlags(flagName, getDomain(req));
res.status(200).json(result);
next();
}));
router.get('/', (req, res, next) => __awaiter(this, void 0, void 0, function* () {
// get all feature-flags
const flagNames = yield FeatureFlagsApi_1.getAllFlagNames();
const result = yield getFeatureFlags(flagNames, getDomain(req));
res.status(200).json(result);
next();
}));
return router;
}
exports.featureFlagRouter = featureFlagRouter;
{
"name": "sap-cf-features",
"version": "0.0.1",
"version": "0.0.2",
"description": "Read SAP CF feature flags in nodejs",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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