@financial-times/dotcom-server-app-context
Advanced tools
Comparing version 0.2.3 to 0.3.0
@@ -11,3 +11,3 @@ "use strict"; | ||
this.data = {}; | ||
const data = filterEmptyData_1.default({ ...options.context }); | ||
const data = filterEmptyData_1.default({ ...options.appContext }); | ||
for (const [property, value] of Object.entries(data)) { | ||
@@ -14,0 +14,0 @@ this.set(property, value); |
@@ -59,2 +59,7 @@ { | ||
}, | ||
"isUserLoggedIn": { | ||
"type": "boolean", | ||
"description": "If the visitor is signed in to an FT account", | ||
"default": false | ||
}, | ||
"product": { | ||
@@ -61,0 +66,0 @@ "type": "string", |
{ | ||
"name": "@financial-times/dotcom-server-app-context", | ||
"version": "0.2.3", | ||
"version": "0.3.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/node/index.js", |
@@ -11,3 +11,3 @@ # FT App Context Schema | ||
* Regex pattern: `^([0-9A-Za-z]+:[0-9A-Za-z]+,?)+$` | ||
* Regex pattern: `^,*([0-9A-Za-z-_]+:[0-9A-Za-z-_]+,*)+$` | ||
@@ -76,2 +76,8 @@ ## `appName` (string) | ||
## `isUserLoggedIn` (boolean) | ||
If the visitor is signed in to an FT account | ||
Default: `false` | ||
## `product` (string) | ||
@@ -78,0 +84,0 @@ |
@@ -6,3 +6,3 @@ import { TAppContext } from './types' | ||
export type TAppContextOptions = { | ||
context?: Partial<TAppContext> | ||
appContext?: Partial<TAppContext> | ||
} | ||
@@ -14,5 +14,5 @@ | ||
constructor(options: TAppContextOptions = {}) { | ||
const data = filterEmptyData({ ...options.context }) | ||
const data = filterEmptyData({ ...options.appContext }) | ||
for (const [ property, value ] of Object.entries(data)) { | ||
for (const [property, value] of Object.entries(data)) { | ||
this.set(property, value) | ||
@@ -19,0 +19,0 @@ } |
@@ -59,2 +59,7 @@ { | ||
}, | ||
"isUserLoggedIn": { | ||
"type": "boolean", | ||
"description": "If the visitor is signed in to an FT account", | ||
"default": false | ||
}, | ||
"product": { | ||
@@ -61,0 +66,0 @@ "type": "string", |
@@ -12,4 +12,5 @@ export interface TAppContext { | ||
isProduction: boolean | ||
isUserLoggedIn?: boolean | ||
publishReference?: string | ||
[key: string]: any | ||
} |
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
14599
293