src/EventStore.js
function validateEvent(event) {
	if (typeof event !== 'object' || !event) throw new TypeError('event must be an Object');
	if (typeof event.type !== 'string' || !event.type.length) throw new TypeError('event.type must be a non-empty String');
	if (!event.aggregateId && !event.sagaId) throw new TypeError('either event.aggregateId or event.sagaId is required');
	if (event.sagaId && typeof event.sagaVersion === 'undefined') throw new TypeError('event.sagaVersion is required, when event.sagaId is defined');
}
function validateEvent(event) {
	if (typeof event !== 'object' || !event) throw new TypeError('event must be an Object');
	if (typeof event.type !== 'string' || !event.type.length) throw new TypeError('event.type must be a non-empty String');
	if (!event.aggregateId && !event.sagaId) throw new TypeError('either event.aggregateId or event.sagaId is required');
	if (event.sagaId && typeof event.sagaVersion === 'undefined') throw new TypeError('event.sagaVersion is required, when event.sagaId is defined');
}
function validateEvent ( event ) { if ( typeof event !== 'object' || ! event ) throw new TypeError ( 'event must be an Object' ) ; if ( typeof event . type !== 'string' || ! event . type . length ) throw new TypeError ( 'event.type must be a non-empty String' ) ; if ( ! event . aggregateId && ! event . sagaId ) throw new TypeError ( 'either event.aggregateId or event.sagaId is required' ) ; if ( event . sagaId && typeof event . sagaVersion === 'undefined' ) throw new TypeError ( 'event.sagaVersion is required, when event.sagaId is defined' ) ; }
Validate event structure

@param {IEvent} event
Validate event structure