src/runtime/client-event-manager.js
/**
 * Throws an error if the event is invalid.
 * @param {!../api/client-event-manager-api.ClientEvent} event
 */
Throws an error if the event is invalid.
Throws an error if the event is invalid .
function validateEvent(event) {
  if (!isObject(event)) {
    throw new Error('Event must be a valid object');
  }
  if (!isEnumValue(AnalyticsEvent, event.eventType)) {
    throw new Error(createEventErrorMessage('eventType', event.eventType));
  }
  if (!isEnumValue(EventOriginator, event.eventOriginator)) {
    throw new Error(
      createEventErrorMessage('eventOriginator', event.eventOriginator)
    );
  }
  if (
    !isObject(event.additionalParameters) &&
    event.additionalParameters != null
  ) {
    throw new Error(
      createEventErrorMessage(
        'additionalParameters',
        event.additionalParameters
      )
    );
  }
  if (event.isFromUserAction != null && !isBoolean(event.isFromUserAction)) {
    throw new Error(
      createEventErrorMessage('isFromUserAction', event.isFromUserAction)
    );
  }
}
function validateEvent ( event ) { if ( ! isObject ( event ) ) { throw new Error ( 'Event must be a valid object' ) ; } if ( ! isEnumValue ( AnalyticsEvent , event . eventType ) ) { throw new Error ( createEventErrorMessage ( 'eventType' , event . eventType ) ) ; } if ( ! isEnumValue ( EventOriginator , event . eventOriginator ) ) { throw new Error ( createEventErrorMessage ( 'eventOriginator' , event . eventOriginator ) ) ; } if ( ! isObject ( event . additionalParameters ) && event . additionalParameters != null ) { throw new Error ( createEventErrorMessage ( 'additionalParameters' , event . additionalParameters ) ) ; } if ( event . isFromUserAction != null && ! isBoolean ( event . isFromUserAction ) ) { throw new Error ( createEventErrorMessage ( 'isFromUserAction' , event . isFromUserAction ) ) ; } }
Throws an error if the event is invalid.
Throws an error if the event is invalid .