@guardian/ophan-tracker-js 2.6.1 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NPM-dist/core.js CHANGED
@@ -87,7 +87,7 @@ sendInitialEvent = function (httpStatus, url = location.href, referrer = window.
87
87
  if (loadType !== 'normal') {
88
88
  event.loadType = loadType;
89
89
  }
90
- appendContentType(event);
90
+ appendContentType(event, platform, window.guardian);
91
91
  appendDataFromLocalStorageToEvent(event);
92
92
  transmit.sendInitial(event);
93
93
  return adblockDetection.run().then(function (adBlockerEnabled) {
@@ -198,13 +198,13 @@ storeDataToSendOnNextEvent = function (newData) {
198
198
  /**
199
199
  * Determines the 'content type' based on the platform and guardian object.
200
200
  * @param {Record<string, unknown>} event - The event object that will be updated with contentType.
201
- * @param {string} platform - The current platform ('next-gen', 'embed' or other).
202
- * @param {Record<string, unknown>} guardian - The guardian object.
201
+ * @param {string} localPlatform - The current platform ('next-gen', 'embed' or other).
202
+ * @param {Record<string, unknown>} localGuardian - The guardian object.
203
203
  */
204
- const appendContentType = (event, platform, guardian) => {
205
- const contentType = platform === 'next-gen' || platform === 'embed'
206
- ? guardian?.config?.page?.contentType
207
- : guardian?.page?.contentTypes;
204
+ const appendContentType = (event, localPlatform, localGuardian) => {
205
+ const contentType = localPlatform === 'next-gen' || localPlatform === 'embed'
206
+ ? localGuardian?.config?.page?.contentType
207
+ : localGuardian?.page?.contentTypes;
208
208
  if (contentType) {
209
209
  event.contentType = contentType.toLowerCase();
210
210
  }
@@ -58,7 +58,7 @@ declare function processCaptures(): void;
58
58
  /**
59
59
  * Determines the 'content type' based on the platform and guardian object.
60
60
  * @param {Record<string, unknown>} event - The event object that will be updated with contentType.
61
- * @param {string} platform - The current platform ('next-gen', 'embed' or other).
62
- * @param {Record<string, unknown>} guardian - The guardian object.
61
+ * @param {string} localPlatform - The current platform ('next-gen', 'embed' or other).
62
+ * @param {Record<string, unknown>} localGuardian - The guardian object.
63
63
  */
64
- declare function appendContentType(event: Record<string, unknown>, platform: string, guardian: Record<string, unknown>): void;
64
+ declare function appendContentType(event: Record<string, unknown>, localPlatform: string, localGuardian: Record<string, unknown>): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/ophan-tracker-js",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=16"