@schibsted/niche-tracking
Advanced tools
Comparing version 4.4.3 to 4.4.4
@@ -135,9 +135,7 @@ "use strict"; | ||
if (enabled && !skip) { | ||
const hasOptions = Array.isArray(trackerOptions) && trackerOptions.length === 2; | ||
const eventArgs = hasOptions ? trackerOptions : [trackerOptions]; | ||
if (initialized) { | ||
try { | ||
if (Array.isArray(trackerOptions) && trackerOptions.length === 2) { | ||
tracker.event(...trackerOptions); | ||
} else { | ||
tracker.event(trackerOptions); | ||
} | ||
tracker.event(...eventArgs); | ||
} catch (e) { | ||
@@ -147,3 +145,3 @@ // ignore | ||
} else { | ||
this.queue.push(() => tracker.event(trackerOptions)); | ||
this.queue.push(() => tracker.event(...eventArgs)); | ||
} | ||
@@ -176,9 +174,7 @@ } | ||
if (enabled && !skip) { | ||
const hasOptions = Array.isArray(trackerOptions) && trackerOptions.length === 2; | ||
const eventArgs = hasOptions ? trackerOptions : [trackerOptions]; | ||
if (initialized) { | ||
try { | ||
if (Array.isArray(trackerOptions) && trackerOptions.length === 2) { | ||
tracker.navigationEvent(...trackerOptions); | ||
} else { | ||
tracker.navigationEvent(trackerOptions); | ||
} | ||
tracker.navigationEvent(...eventArgs); | ||
} catch (e) { | ||
@@ -188,3 +184,3 @@ // ignore | ||
} else { | ||
this.queue.push(() => tracker.navigationEvent(trackerOptions)); | ||
this.queue.push(() => tracker.navigationEvent(...eventArgs)); | ||
} | ||
@@ -191,0 +187,0 @@ } |
{ | ||
"name": "@schibsted/niche-tracking", | ||
"version": "4.4.3", | ||
"version": "4.4.4", | ||
"description": "Package containing tracking logic reused between multiple Schibsted niche sites", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -117,9 +117,8 @@ import { isWeb, isPromise } from './utils'; | ||
if (enabled && !skip) { | ||
const hasOptions = Array.isArray(trackerOptions) && trackerOptions.length === 2; | ||
const eventArgs = hasOptions ? trackerOptions : [trackerOptions]; | ||
if (initialized) { | ||
try { | ||
if (Array.isArray(trackerOptions) && trackerOptions.length === 2) { | ||
tracker.event(...trackerOptions); | ||
} else { | ||
tracker.event(trackerOptions); | ||
} | ||
tracker.event(...eventArgs); | ||
} catch (e) { | ||
@@ -129,3 +128,3 @@ // ignore | ||
} else { | ||
this.queue.push(() => tracker.event(trackerOptions)); | ||
this.queue.push(() => tracker.event(...eventArgs)); | ||
} | ||
@@ -155,9 +154,8 @@ } | ||
if (enabled && !skip) { | ||
const hasOptions = Array.isArray(trackerOptions) && trackerOptions.length === 2; | ||
const eventArgs = hasOptions ? trackerOptions : [trackerOptions]; | ||
if (initialized) { | ||
try { | ||
if (Array.isArray(trackerOptions) && trackerOptions.length === 2) { | ||
tracker.navigationEvent(...trackerOptions); | ||
} else { | ||
tracker.navigationEvent(trackerOptions); | ||
} | ||
tracker.navigationEvent(...eventArgs); | ||
} catch (e) { | ||
@@ -167,3 +165,3 @@ // ignore | ||
} else { | ||
this.queue.push(() => tracker.navigationEvent(trackerOptions)); | ||
this.queue.push(() => tracker.navigationEvent(...eventArgs)); | ||
} | ||
@@ -170,0 +168,0 @@ } |
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
61891
1302