@venncity/nested-config
Advanced tools
Comparing version 3.1.20-jest-memory-fixes2.41 to 3.1.20
@@ -6,2 +6,10 @@ # Change Log | ||
## [3.1.20](https://github.com/venn-city/npm-shelf/compare/@venncity/nested-config@3.1.19...@venncity/nested-config@3.1.20) (2022-02-26) | ||
**Note:** Version bump only for package @venncity/nested-config | ||
## [3.1.19](https://github.com/venn-city/npm-shelf/compare/@venncity/nested-config@3.1.18...@venncity/nested-config@3.1.19) (2022-01-26) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@venncity/nested-config", | ||
"version": "3.1.20-jest-memory-fixes2.41+73f612dca", | ||
"version": "3.1.20", | ||
"author": "Venn Engineering", | ||
@@ -32,3 +32,3 @@ "main": "src/nestedConfig.js", | ||
"dependencies": { | ||
"@venncity/package-info": "^1.1.64-jest-memory-fixes2.41+73f612dca", | ||
"@venncity/package-info": "^1.1.64", | ||
"config": "^3.1.0", | ||
@@ -53,3 +53,3 @@ "lodash": "^4.17.11", | ||
}, | ||
"gitHead": "73f612dcaea8199294e55f4eb055fdff06c7772e" | ||
"gitHead": "fede8b8570da02b7b6e52d9e87f272980fffa611" | ||
} |
@@ -9,4 +9,3 @@ const cls = require('cls-hooked'); | ||
} | ||
const jestWorkerId = process.env.JEST_WORKER_ID || ''; | ||
const requestNamespace = cls.getNamespace(config.get('clsNamespace.request') + jestWorkerId); | ||
const requestNamespace = cls.getNamespace(getNamespaceName('request')); | ||
return requestNamespace && requestNamespace.get(key); | ||
@@ -16,4 +15,3 @@ } | ||
function setReqV(key, value) { | ||
const jestWorkerId = process.env.JEST_WORKER_ID || ''; | ||
const requestNamespace = cls.getNamespace(config.get('clsNamespace.request') + jestWorkerId); | ||
const requestNamespace = cls.getNamespace(getNamespaceName('request')); | ||
if (requestNamespace) { | ||
@@ -27,11 +25,17 @@ requestNamespace.set(key, value); | ||
function isInRequestContext() { | ||
const jestWorkerId = process.env.JEST_WORKER_ID || ''; | ||
const requestNamespace = cls.getNamespace(config.get('clsNamespace.request') + jestWorkerId); | ||
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 | ||
}; |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
39969
434
1
17
1