From bbb6fb55b7f3b8695ec31fa1e5fbfacc74a50a9f Mon Sep 17 00:00:00 2001 From: Sadie Norman Date: Fri, 15 Mar 2024 14:29:00 +0000 Subject: [PATCH] Make sure to pass disableAppFormat val to every instance of configSchema --- src/oTracker/index.ts | 5 ++++- src/utils/yupValidator.ts | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/oTracker/index.ts b/src/oTracker/index.ts index ae59317..fd005d3 100644 --- a/src/oTracker/index.ts +++ b/src/oTracker/index.ts @@ -19,7 +19,10 @@ export class oTracker { options: TrackingOptions; constructor(config: ConfigType, options: TrackingOptions) { - this._config = parseConfig(config); + this._config = parseConfig( + config, + options.disableAppFormatTransform || false + ); validateConfig(this._config, options.disableAppFormatTransform || false); this._config.source_id = oTracking.getRootID(); this.options = options; diff --git a/src/utils/yupValidator.ts b/src/utils/yupValidator.ts index af8ded1..c2207a4 100644 --- a/src/utils/yupValidator.ts +++ b/src/utils/yupValidator.ts @@ -127,7 +127,11 @@ const origamiEventSchema = object({ export type ConfigType = InferType; export type OrigamiEventType = InferType; -export const parseConfig = (config: ConfigType): ConfigType => { +export const parseConfig = ( + config: ConfigType, + disableAppFormatTransform: boolean +): ConfigType => { + disableAppFormatTransformValue = disableAppFormatTransform; try { //Replace app value based on deprecated hasVideo field and then remove hasVideo if (config.hasVideo && config.app.toLowerCase() === "article") {