Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../../_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 = _objectWithoutProperties(track, _excluded);

    return {
      eventName: event,
      eventProperties: _objectSpread2(_objectSpread2({}, properties), rootLevelproperties)
    };
  }

  throw new TypeError('Please check a valid tracking intent was provided');
};

export { mapTrackingDataToAvoInspector };
//# sourceMappingURL=mapper.js.map