vendor/paho-mqtt.js
function(obj, keys) {
      for (var key in obj) {
        if (obj.hasOwnProperty(key)) {
          if (keys.hasOwnProperty(key)) {
            if (typeof obj[key] !== keys[key])
              throw new Error(format(ERROR.INVALID_TYPE, [typeof obj[key], key]));
          } else {
            var errorStr = "Unknown property, " + key + ". Valid properties are:";
            for (var validKey in keys)
              if (keys.hasOwnProperty(validKey))
                errorStr = errorStr+" "+validKey;
            throw new Error(errorStr);
          }
        }
      }
    }
function(obj, keys) {
      for (var key in obj) {
        if (obj.hasOwnProperty(key)) {
          if (keys.hasOwnProperty(key)) {
            if (typeof obj[key] !== keys[key])
              throw new Error(format(ERROR.INVALID_TYPE, [typeof obj[key], key]));
          } else {
            var errorStr = "Unknown property, " + key + ". Valid properties are:";
            for (var validKey in keys)
              if (keys.hasOwnProperty(validKey))
                errorStr = errorStr+" "+validKey;
            throw new Error(errorStr);
          }
        }
      }
    }
function ( obj , keys ) { for ( var key in obj ) { if ( obj . hasOwnProperty ( key ) ) { if ( keys . hasOwnProperty ( key ) ) { if ( typeof obj [ key ] !== keys [ key ] ) throw new Error ( format ( ERROR . INVALID_TYPE , [ typeof obj [ key ] , key ] ) ) ; } else { var errorStr = "Unknown property, " + key + ". Valid properties are:" ; for ( var validKey in keys ) if ( keys . hasOwnProperty ( validKey ) ) errorStr = errorStr + " " + validKey ; throw new Error ( errorStr ) ; } } } }
Collection of utility methods used to simplify module code and promote the DRY pattern. 
Validate an object's parameter names to ensure they
match a list of expected variables name for this option
type. Used to ensure option object passed into the API don't
contain erroneous parameters.
@param {Object} obj - User options object
@param {Object} keys - valid keys and types that may exist in obj.
@throws {Error} Invalid option parameter found.
@private
Collection of utility methods used to simplify module code and promote the DRY pattern . Validate an object s parameter names to ensure they match a list of expected variables name for this option type . Used to ensure option object passed into the API don t contain erroneous parameters .