You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
736 B
TypeScript
23 lines
736 B
TypeScript
// Copyright (C) 2020 Intel Corporation
|
|
//
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
export function isDev(): boolean {
|
|
return process.env.NODE_ENV === 'development';
|
|
}
|
|
|
|
export function isPublic(): boolean {
|
|
return process.env.PUBLIC_INSTANCE === 'true';
|
|
}
|
|
|
|
export function customWaViewHit(pageName?: string, queryString?: string, hashInfo?: string) {
|
|
const waHitFunctionName = process.env.WA_PAGE_VIEW_HIT
|
|
if (waHitFunctionName) {
|
|
const waHitFunction = new Function('pageName', 'queryString', 'hashInfo',
|
|
`if (typeof ${waHitFunctionName} === 'function') {
|
|
${waHitFunctionName}(pageName, queryString, hashInfo);
|
|
}`);
|
|
waHitFunction(pageName, queryString, hashInfo);
|
|
}
|
|
}
|