src/validate.js
function validateMethod (method) {
  if (!method) {
    return option.some('HTTP method is not specified')
  }
  if (typeof method !== 'string') {
    return option.some('HTTP method should be type of string')
  }
  if (supportedMethods.indexOf(method.toUpperCase()) < 0) {
    return option.some(`Http method ${method} is not supported`)
  }
  return option.none
}
function validateMethod (method) {
  if (!method) {
    return option.some('HTTP method is not specified')
  }
  if (typeof method !== 'string') {
    return option.some('HTTP method should be type of string')
  }
  if (supportedMethods.indexOf(method.toUpperCase()) < 0) {
    return option.some(`Http method ${method} is not supported`)
  }
  return option.none
}
function validateMethod ( method ) { if ( ! method ) { return option . some ( 'HTTP method is not specified' ) } if ( typeof method !== 'string' ) { return option . some ( 'HTTP method should be type of string' ) } if ( supportedMethods . indexOf ( method . toUpperCase ( ) ) < 0 ) { return option . some ( ` ${ method } ` ) } return option . none }
Validate HTTP method
@param {String} method – HTTP method
@return {String} error
Validate HTTP method