@podium/context
Advanced tools
Comparing version 5.0.3 to 5.1.0-beta.1
@@ -0,1 +1,10 @@ | ||
# [5.1.0-beta.1](https://github.com/podium-lib/context/compare/v5.0.3...v5.1.0-beta.1) (2024-03-20) | ||
### Features | ||
* add support for x-podium-base-font-size header ([6a0215c](https://github.com/podium-lib/context/commit/6a0215cce6df9bb87732ae38336206ee9614ab9a)) | ||
* add x-podium-app-id context parser ([6390181](https://github.com/podium-lib/context/commit/63901810466b59a74cffade7d0a3f5674b2e2763)) | ||
* pass on incoming x-podium-device-type as podium-device-type ([fe9cd46](https://github.com/podium-lib/context/commit/fe9cd46a2471cd9060b56c956bc40473ad5c818b)) | ||
## [5.0.3](https://github.com/podium-lib/context/compare/v5.0.2...v5.0.3) (2024-02-01) | ||
@@ -2,0 +11,0 @@ |
@@ -13,2 +13,4 @@ import decamelize from 'decamelize'; | ||
import Locale from './get-locale.js'; | ||
import AppId from './get-app-id.js'; | ||
import BaseFontSize from './get-base-font-size.js'; | ||
import Debug from './get-debug.js'; | ||
@@ -68,2 +70,4 @@ | ||
this.register('debug', new Debug(debug)); | ||
this.register('baseFontSize', new BaseFontSize()); | ||
this.register('appId', new AppId()); | ||
} | ||
@@ -110,2 +114,3 @@ | ||
result.forEach((item, index) => { | ||
if (item === undefined) return; | ||
const key = `${PREFIX}-${parsers[index][0]}`; | ||
@@ -133,2 +138,2 @@ // eslint-disable-next-line no-param-reassign | ||
} | ||
}; | ||
} |
@@ -37,3 +37,17 @@ import Bowser from 'bowser'; | ||
/** | ||
* @param {import('@podium/utils').HttpIncoming} incoming | ||
* @returns {string} | ||
*/ | ||
parse(incoming = {}) { | ||
const deviceType = incoming.request.headers | ||
? incoming.request.headers['x-podium-device-type'] | ||
: ''; | ||
if (deviceType) { | ||
if (typeof deviceType === 'string') { | ||
return deviceType; | ||
} | ||
return deviceType[0]; | ||
} | ||
const userAgent = incoming.request.headers | ||
@@ -66,2 +80,2 @@ ? incoming.request.headers['user-agent'] | ||
} | ||
}; | ||
} |
{ | ||
"name": "@podium/context", | ||
"version": "5.0.3", | ||
"version": "5.1.0-beta.1", | ||
"description": "Module to generate the context which is passed on requests from a Podium Layout server to a Podium Podlet server", | ||
@@ -47,3 +47,3 @@ "type": "module", | ||
"devDependencies": { | ||
"eslint": "8.56.0", | ||
"eslint": "8.57.0", | ||
"eslint-config-airbnb-base": "15.0.0", | ||
@@ -55,3 +55,3 @@ "eslint-config-prettier": "9.1.0", | ||
"tap": "18.7.0", | ||
"prettier": "3.2.4", | ||
"prettier": "3.2.5", | ||
"@semantic-release/changelog": "6.0.3", | ||
@@ -64,4 +64,4 @@ "@semantic-release/commit-analyzer": "11.1.0", | ||
"benchmark": "2.1.4", | ||
"semantic-release": "22.0.12" | ||
"semantic-release": "23.0.2" | ||
} | ||
} |
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
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
70213
394
14
353
1