event-buffer-factory.js
function validEvent(eventKeys, typeKeys, emitter, typeName) {

    if (eventKeys.length > typeKeys.length) {
      emitter.emit('error', 'An event has more properties than its type, ' + typeName +
        '. Event properties: [' + eventKeys + ']. ' + typeName + ' properties: [' + typeKeys + '].');
      return false;
    } else {

      for (var i = 0; i < eventKeys.length; i++) {
        if (typeKeys.indexOf(eventKeys[i]) === -1) {
          emitter.emit('error', 'An event has property "' + eventKeys[i] + '" which is not in its type, ' + typeName +
            '. Event properties: [' + eventKeys + ']. ' + typeName + ' properties: [' + typeKeys + '].');
          return false;
        }
      }
      return true;
    }
  }
function validEvent(eventKeys, typeKeys, emitter, typeName) {

    if (eventKeys.length > typeKeys.length) {
      emitter.emit('error', 'An event has more properties than its type, ' + typeName +
        '. Event properties: [' + eventKeys + ']. ' + typeName + ' properties: [' + typeKeys + '].');
      return false;
    } else {

      for (var i = 0; i < eventKeys.length; i++) {
        if (typeKeys.indexOf(eventKeys[i]) === -1) {
          emitter.emit('error', 'An event has property "' + eventKeys[i] + '" which is not in its type, ' + typeName +
            '. Event properties: [' + eventKeys + ']. ' + typeName + ' properties: [' + typeKeys + '].');
          return false;
        }
      }
      return true;
    }
  }
function validEvent ( eventKeys , typeKeys , emitter , typeName ) { if ( eventKeys . length > typeKeys . length ) { emitter . emit ( 'error' , 'An event has more properties than its type, ' + typeName + '. Event properties: [' + eventKeys + ']. ' + typeName + ' properties: [' + typeKeys + '].' ) ; return false ; } else { for ( var i = 0 ; i < eventKeys . length ; i ++ ) { if ( typeKeys . indexOf ( eventKeys [ i ] ) === - 1 ) { emitter . emit ( 'error' , 'An event has property "' + eventKeys [ i ] + '" which is not in its type, ' + typeName + '. Event properties: [' + eventKeys + ']. ' + typeName + ' properties: [' + typeKeys + '].' ) ; return false ; } } return true ; } }
Returns true if every element of eventKeys is in typeKeys.
Returns true if every element of eventKeys is in typeKeys .