index.js
function validateArgs (type, payload) {
  if (!type) {
    return new Error('type is required');
  }
  if (!payload) {
    return new Error('payload is required');
  }
  if (!isNumber(type)) {
    return new Error('type must be a number');
  }
  if (!isBuffer(payload) && !isString(payload)) {
    return new Error('payload must be buffer or string');
  }
  if (type > 3) {
    return new Error('type must be a number less than 3');
  }
}
function validateArgs (type, payload) {
  if (!type) {
    return new Error('type is required');
  }
  if (!payload) {
    return new Error('payload is required');
  }
  if (!isNumber(type)) {
    return new Error('type must be a number');
  }
  if (!isBuffer(payload) && !isString(payload)) {
    return new Error('payload must be buffer or string');
  }
  if (type > 3) {
    return new Error('type must be a number less than 3');
  }
}
function validateArgs ( type , payload ) { if ( ! type ) { return new Error ( 'type is required' ) ; } if ( ! payload ) { return new Error ( 'payload is required' ) ; } if ( ! isNumber ( type ) ) { return new Error ( 'type must be a number' ) ; } if ( ! isBuffer ( payload ) && ! isString ( payload ) ) { return new Error ( 'payload must be buffer or string' ) ; } if ( type > 3 ) { return new Error ( 'type must be a number less than 3' ) ; } }
validates arguments for createFrame
@param {number} ioConnectionType - 2=stderr, 1=stdout, 0=stdin
@param {string|buffer} payloadData
@return {undefined|error} error - returns error if an argument is invalid
validates arguments for createFrame