Repository URL to install this package:
|
Version:
2.0.3 ▾
|
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
var _excluded = ["event", "properties"];
/**
* Maps tracking data to a format supported by the Avo Inspector.
* @param {TrackingDefinitionData} trackingData - An object produced by getTrackingDefinition function
* @return {Object}
*/
var mapTrackingDataToAvoInspector = function mapTrackingDataToAvoInspector(_ref) {
var track = _ref.track;
if (track) {
var event = track.event,
properties = track.properties,
rootLevelproperties = _rollupPluginBabelHelpers.objectWithoutProperties(track, _excluded);
return {
eventName: event,
eventProperties: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, properties), rootLevelproperties)
};
}
throw new TypeError('Please check a valid tracking intent was provided');
};
exports.mapTrackingDataToAvoInspector = mapTrackingDataToAvoInspector;
//# sourceMappingURL=mapper.js.map