New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gtm-event-tracker

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gtm-event-tracker - npm Package Compare versions

Comparing version 1.7.0-beta.2 to 1.7.0-beta.3

7

dist/data-layer/data-layer.d.ts
import type { EventProperties, DataLayerFunctions } from './data-layer-types';
export declare function getDefaultTargetProperty(): EventProperties[];
export declare function createDataLayer(): DataLayerFunctions;
declare type DataLayerOptions = Partial<{
targetProperty: EventProperties[];
}>;
export declare function createDataLayer(options?: DataLayerOptions): DataLayerFunctions;
export declare const dataLayer: DataLayerFunctions;
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.dataLayer = exports.createDataLayer = exports.getDefaultTargetProperty = void 0;
exports.dataLayer = exports.createDataLayer = void 0;
const data_layer_error_1 = require("./data-layer-error");
function getDefaultTargetProperty() {
return window.dataLayer;
}
exports.getDefaultTargetProperty = getDefaultTargetProperty;
function createDataLayer() {
function createDataLayer(options = {}) {
function getTargetProperty() {
var _a;
const defaultTarget = window.dataLayer;
return (_a = options.targetProperty) !== null && _a !== void 0 ? _a : defaultTarget;
}
function addEvent(payload) {
const targetProperty = getDefaultTargetProperty();
const targetProperty = getTargetProperty();
targetProperty.push(payload);

@@ -16,4 +17,4 @@ }

const isServer = () => typeof window === 'undefined';
const isDefined = () => typeof getDefaultTargetProperty() !== 'undefined';
const isArray = () => Array.isArray(getDefaultTargetProperty());
const isDefined = () => typeof getTargetProperty() !== 'undefined';
const isArray = () => Array.isArray(getTargetProperty());
if (isServer())

@@ -20,0 +21,0 @@ (0, data_layer_error_1.throwIsServer)();

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "1.7.0-beta.2",
"version": "1.7.0-beta.3",
"description": "A type-safe, reusable, and flexible way for triggering Google Tag Manager track events.",

@@ -8,0 +8,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc