@financial-times/dotcom-server-app-context
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -7,5 +7,6 @@ "use strict"; | ||
const validate_1 = __importDefault(require("./validate")); | ||
const filterEmptyData_1 = __importDefault(require("./filterEmptyData")); | ||
class AppContext { | ||
constructor(options = {}) { | ||
this.data = { ...options.context }; | ||
this.data = filterEmptyData_1.default({ ...options.context }); | ||
this.validate(); | ||
@@ -12,0 +13,0 @@ } |
@@ -10,3 +10,3 @@ { | ||
"examples": ["subscriberCohort:on,premiumCohort:on,nonUSACohort:on"], | ||
"pattern": "^([0-9A-Za-z]+:[0-9A-Za-z]+,?)+$" | ||
"pattern": "^,*([0-9A-Za-z-_]+:[0-9A-Za-z-_]+,*)+$" | ||
}, | ||
@@ -13,0 +13,0 @@ "appName": { |
{ | ||
"name": "@financial-times/dotcom-server-app-context", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/node/index.js", |
import { TAppContext } from './types' | ||
import validate from './validate' | ||
import filterEmptyData from './filterEmptyData' | ||
@@ -12,3 +13,3 @@ export type TAppContextOptions = { | ||
constructor(options: TAppContextOptions = {}) { | ||
this.data = { ...options.context } | ||
this.data = filterEmptyData({ ...options.context }) | ||
this.validate() | ||
@@ -15,0 +16,0 @@ } |
@@ -10,3 +10,3 @@ { | ||
"examples": ["subscriberCohort:on,premiumCohort:on,nonUSACohort:on"], | ||
"pattern": "^([0-9A-Za-z]+:[0-9A-Za-z]+,?)+$" | ||
"pattern": "^,*([0-9A-Za-z-_]+:[0-9A-Za-z-_]+,*)+$" | ||
}, | ||
@@ -13,0 +13,0 @@ "appName": { |
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
13742
15
271