@nuskin/events
Advanced tools
Comparing version 1.0.0-cx16-8326.3 to 1.0.0-cx16-8326.4
{ | ||
"name": "@nuskin/events", | ||
"version": "1.0.0-cx16-8326.3", | ||
"version": "1.0.0-cx16-8326.4", | ||
"description": "The description that will amaze and astound your audience when they read it", | ||
@@ -5,0 +5,0 @@ "main": "src/event.js", |
@@ -20,7 +20,14 @@ 'use strict' | ||
fn.psToken = psToken; | ||
return psToken; | ||
}; | ||
const parseValue = (value) => { | ||
return Array.isArray(value) && value.length > 0 | ||
? value[0] | ||
: value | ||
? value | ||
: true | ||
} | ||
const publish = (eventId, value, gtmConfig) => { | ||
ps.publish(eventId, value); | ||
ps.publish(eventId, parseValue(value)); | ||
@@ -87,4 +94,3 @@ // Push the event out to GTM if the dataLayer is defined | ||
if (typeof eventId === 'string' && eventId.length > 0) { | ||
value = value || true; | ||
value = parseValue(value); | ||
state[eventId] = value; | ||
@@ -91,0 +97,0 @@ publish(eventId, value); |
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
13822
87