lib/overload.js
function match(args, typeMap) {
  // No arguments, no win.
  if (!args || !args.length) {
    throw new Error('Cannot perform overload.match: args must be non-null array');
  } else if (!typeMap || !typeMap.length) {
    // We always satisfy a null or empty typeMap
    return true;
  }

  // Validate the arguments one by one
  for (let index = 0; index < args.length; index++) {
    if (!compatible(args[index], typeMap[index])) {
      return false;
    }
  }

  // If not incompatible, sucess
  return true;
}
function match(args, typeMap) {
  // No arguments, no win.
  if (!args || !args.length) {
    throw new Error('Cannot perform overload.match: args must be non-null array');
  } else if (!typeMap || !typeMap.length) {
    // We always satisfy a null or empty typeMap
    return true;
  }

  // Validate the arguments one by one
  for (let index = 0; index < args.length; index++) {
    if (!compatible(args[index], typeMap[index])) {
      return false;
    }
  }

  // If not incompatible, sucess
  return true;
}
function match ( args , typeMap ) { // No arguments, no win. if ( ! args || ! args . length ) { throw new Error ( 'Cannot perform overload.match: args must be non-null array' ) ; } else if ( ! typeMap || ! typeMap . length ) { // We always satisfy a null or empty typeMap return true ; } // Validate the arguments one by one for ( let index = 0 ; index < args . length ; index ++ ) { if ( ! compatible ( args [ index ] , typeMap [ index ] ) ) { return false ; } } // If not incompatible, sucess return true ; }
Does the specified method match the overload requirements for the method?
@param {Array}     args      - Method arguments
@param {Array}     typeMap   - Type map
@returns {Boolean}           - True if matches, false otherwise.
Does the specified method match the overload requirements for the method?