@venncity/nested-config
Advanced tools
Comparing version 3.1.19 to 3.1.20-jest-memory-fixes2.31
{ | ||
"name": "@venncity/nested-config", | ||
"version": "3.1.19", | ||
"version": "3.1.20-jest-memory-fixes2.31+73cc60c52", | ||
"author": "Venn Engineering", | ||
@@ -32,3 +32,3 @@ "main": "src/nestedConfig.js", | ||
"dependencies": { | ||
"@venncity/package-info": "^1.1.63", | ||
"@venncity/package-info": "^1.1.64-jest-memory-fixes2.31+73cc60c52", | ||
"config": "^3.1.0", | ||
@@ -53,3 +53,3 @@ "lodash": "^4.17.11", | ||
}, | ||
"gitHead": "a2b3814145dc03f83e6368cedf6cc8724e19b1fe" | ||
"gitHead": "73cc60c5288b558d72f44ce4abb2fc4d7d435041" | ||
} |
@@ -9,3 +9,3 @@ const cls = require('cls-hooked'); | ||
} | ||
const requestNamespace = cls.getNamespace(config.get('clsNamespace.request')); | ||
const requestNamespace = cls.getNamespace(getNamespaceName('request')); | ||
return requestNamespace && requestNamespace.get(key); | ||
@@ -15,3 +15,3 @@ } | ||
function setReqV(key, value) { | ||
const requestNamespace = cls.getNamespace(config.get('clsNamespace.request')); | ||
const requestNamespace = cls.getNamespace(getNamespaceName('request')); | ||
if (requestNamespace) { | ||
@@ -25,10 +25,17 @@ requestNamespace.set(key, value); | ||
function isInRequestContext() { | ||
const requestNamespace = cls.getNamespace(config.get('clsNamespace.request')); | ||
const requestNamespace = cls.getNamespace(getNamespaceName('request')); | ||
return requestNamespace && requestNamespace.active; | ||
} | ||
function getNamespaceName(nsName) { | ||
// Required so that cls namespaces are not mixed between jest global init & workers. | ||
const jestWorkerId = process.env.JEST_WORKER_ID || ''; | ||
return config.get(`clsNamespace.${nsName}`) + jestWorkerId; | ||
} | ||
module.exports = { | ||
getReqV, | ||
setReqV, | ||
isInRequestContext | ||
isInRequestContext, | ||
getNamespaceName | ||
}; |
@@ -100,2 +100,3 @@ process.env.ALLOW_CONFIG_MUTATIONS = true; | ||
module.exports = (options) => { | ||
@@ -102,0 +103,0 @@ if (_.isObject(options) && options.prebuiltConfigJson) { |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
39826
434
2
17
2