validate(event) {
        return this.validatorFor(event)
        .then((validateFn) => {

            if (!validateFn(event)) {
                throw new EventInvalidError(
                    `Event failed validation with schema at ${this.extractSchemaUri(event)}`,
                    validateFn.errors
                );
            }
            return event;
        });
    }
/**
     * Returns a Promise of the validated event using it's JSONSchema at its schema URL,
     * Or throws an EventInvalidError.
     * @param {Object} event
     * @return {Promise<Object>} event (with defaults filled in by AJV validator).
     * @throws {EventInvalidError}
     */
Returns a Promise of the validated event using it's JSONSchema at its schema URL,
Or throws an EventInvalidError.
@param {Object} event
@return {Promise} event (with defaults filled in by AJV validator).
Returns a Promise of the validated event using it ' s JSONSchema at its schema URL Or throws an EventInvalidError . @param { Object } event @return { Promise } event ( with defaults filled in by AJV validator ) .
validate(event) {
        return this.validatorFor(event)
        .then((validateFn) => {
            if (!validateFn(event)) {
                throw new EventInvalidError(
                    `Event failed validation with schema at ${this.extractSchemaUri(event)}`,
                    validateFn.errors
                );
            }
            return event;
        });
    }
validate ( event ) { return this . validatorFor ( event ) . then ( ( validateFn ) => { if ( ! validateFn ( event ) ) { throw new EventInvalidError ( ` ${ this . extractSchemaUri ( event ) } ` , validateFn . errors ) ; } return event ; } ) ; }
Returns a Promise of the validated event using it's JSONSchema at its schema URL,
 Or throws an EventInvalidError.
Returns a Promise of the validated event using it ' s JSONSchema at its schema URL Or throws an EventInvalidError .