joi-router.js
function checkMethods(spec) {
  assert(spec.method, 'missing route methods');

  if (typeof spec.method === 'string') {
    spec.method = spec.method.split(' ');
  }

  if (!Array.isArray(spec.method)) {
    throw new TypeError('route methods must be an array or string');
  }

  if (spec.method.length === 0) {
    throw new Error('missing route method');
  }

  spec.method.forEach((method, i) => {
    assert(typeof method === 'string', 'route method must be a string');
    spec.method[i] = method.toLowerCase();
  });
}
function checkMethods(spec) {
  assert(spec.method, 'missing route methods');

  if (typeof spec.method === 'string') {
    spec.method = spec.method.split(' ');
  }

  if (!Array.isArray(spec.method)) {
    throw new TypeError('route methods must be an array or string');
  }

  if (spec.method.length === 0) {
    throw new Error('missing route method');
  }

  spec.method.forEach((method, i) => {
    assert(typeof method === 'string', 'route method must be a string');
    spec.method[i] = method.toLowerCase();
  });
}
function checkMethods ( spec ) { assert ( spec . method , 'missing route methods' ) ; if ( typeof spec . method === 'string' ) { spec . method = spec . method . split ( ' ' ) ; } if ( ! Array . isArray ( spec . method ) ) { throw new TypeError ( 'route methods must be an array or string' ) ; } if ( spec . method . length === 0 ) { throw new Error ( 'missing route method' ) ; } spec . method . forEach ( ( method , i ) => { assert ( typeof method === 'string' , 'route method must be a string' ) ; spec . method [ i ] = method . toLowerCase ( ) ; } ) ; }
Validate the spec.method

@param {Object} spec
@api private
Validate the spec . method