@ninetailed/experience.js-plugin-analytics
Advanced tools
| export * from "./src/index"; |
+0
-2
| 'use strict'; | ||
| Object.defineProperty(exports, '__esModule', { value: true }); | ||
| var radash = require('radash'); | ||
@@ -6,0 +4,0 @@ var experience_jsShared = require('@ninetailed/experience.js-shared'); |
+9
-13
@@ -12,3 +12,2 @@ import { isEqual } from 'radash'; | ||
| }); | ||
| // Element specific schema | ||
@@ -58,6 +57,7 @@ const ElementSeenPayloadSchema = BaseSeenPayloadSchema.extend({ | ||
| var _a$1, _b; | ||
| class NinetailedPlugin { | ||
| constructor() { | ||
| this.componentViewTrackingThreshold = 0; | ||
| this[HAS_SEEN_ELEMENT] = event => { | ||
| this[_a$1] = event => { | ||
| if (event.payload.seenFor !== this.getComponentViewTrackingThreshold()) { | ||
@@ -68,3 +68,3 @@ return; | ||
| }; | ||
| this[HAS_SEEN_VARIABLE] = event => { | ||
| this[_b] = event => { | ||
| this.onHasSeenVariable(event); | ||
@@ -82,14 +82,12 @@ }; | ||
| } | ||
| _a$1 = HAS_SEEN_ELEMENT, _b = HAS_SEEN_VARIABLE; | ||
| var _a; | ||
| const TEMPLATE_OPTIONS = { | ||
| interpolate: /{{([\s\S]+?)}}/g | ||
| }; | ||
| /** | ||
| * This type is only used for the `onTrackExperience` method that is implemented in subclasses of `NinetailedAnalyticsPlugin`. | ||
| */ | ||
| class NinetailedAnalyticsPlugin extends NinetailedPlugin { | ||
| constructor(hasSeenExperienceEventTemplate = {}) { | ||
| super(); | ||
| this.hasSeenExperienceEventTemplate = hasSeenExperienceEventTemplate; | ||
| this.seenElements = new WeakMap(); | ||
@@ -115,3 +113,3 @@ this.seenVariables = new Map(); | ||
| }; | ||
| return Object.assign({}, acc, { | ||
| return Object.assign(Object.assign({}, acc), { | ||
| [key()]: value() | ||
@@ -180,3 +178,2 @@ }); | ||
| }); | ||
| // Should we track it once or multiple times if it is the same payload? | ||
@@ -187,3 +184,2 @@ if (isVariableAlreadySeenWithPayload) { | ||
| this.seenVariables.set(variableKey, [...variablePayloads, sanitizedTrackVariableProperties]); | ||
| // TODO: this does nothing for now, we need to implement how track variables to 3rd party plugins | ||
@@ -194,3 +190,3 @@ }; | ||
| */ | ||
| this[HAS_SEEN_COMPONENT] = ({ | ||
| this[_a] = ({ | ||
| payload | ||
@@ -205,5 +201,5 @@ }) => { | ||
| }; | ||
| this.hasSeenExperienceEventTemplate = hasSeenExperienceEventTemplate; | ||
| } | ||
| } | ||
| _a = HAS_SEEN_COMPONENT; | ||
@@ -210,0 +206,0 @@ const hasComponentViewTrackingThreshold = arg => { |
+2
-2
@@ -5,3 +5,3 @@ { | ||
| "license": "MIT", | ||
| "version": "7.18.12-alpha.3", | ||
| "version": "7.18.13", | ||
| "keywords": [ | ||
@@ -33,3 +33,3 @@ "analytics", | ||
| "@anatine/zod-mock": "3.8.1", | ||
| "@ninetailed/experience.js-shared": "7.18.12-alpha.3", | ||
| "@ninetailed/experience.js-shared": "7.18.13", | ||
| "analytics": "0.8.1", | ||
@@ -36,0 +36,0 @@ "radash": "10.9.0", |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
14
7.69%689
0.15%1
-50%29754
-0.41%+ Added
- Removed