UNPKG

@aller/blink

Version:

A library for tracking user behaviour.

33 lines 1.39 kB
"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var general_data_1 = __importDefault(require("../utils/general-data")); /** * Prepares custom data selecting the right * fields to send to the server */ function prepareCustomEventsForSending(_a) { var page = _a.page, customDomain = _a.customDomain, customType = _a.customType, customContent = _a.customContent, customValue = _a.customValue, _b = _a.time, time = _b === void 0 ? new Date() : _b; var id = customDomain + customType; return __assign({}, general_data_1.default(page.state), { type: 'custom', id: id, customDomain: customDomain, customType: customType, customContent: customContent, customValue: customValue, time: time }); } exports.default = prepareCustomEventsForSending; //# sourceMappingURL=prepare-custom-event.js.map