@garbarino/gb-context
Advanced tools
Comparing version 1.0.6 to 1.0.7
18
index.js
/** | ||
* devuelvo un objeto con xBrand y folder segun request | ||
* Recibe los headers del request y devuelve un objeto con | ||
* xBrand, xSubdomain y salesCompany | ||
*/ | ||
module.exports = ({ headers }) => { | ||
var xBrand = headers['x-brand'] ? headers['x-brand'].toLowerCase() : 'garbarino'; | ||
var xSubdomain = headers['x-subdomain'] ? headers['x-subdomain'].toLowerCase() : undefined; | ||
return { | ||
xBrand, | ||
xSubdomain, | ||
salesCompany: xSubdomain === 'empresas' | ||
}; | ||
} | ||
module.exports = ({ headers: { 'x-brand': xBrand, 'x-subdomain': xSubdomain } }) => ({ | ||
xBrand: xBrand ? xBrand.toLowerCase() : 'garbarino', | ||
xSubdomain: xSubdomain ? xSubdomain.toLowerCase() : undefined, | ||
salesCompany: xSubdomain === 'empresas' | ||
}); |
{ | ||
"name": "@garbarino/gb-context", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Devuelve variables de contextos apartir de un request", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
1231
9
1