function _validStatusAndVerb(verb, status) {
    const statusCodeMap = {
      DELETE: ['204', '202', '301', '307', '400', '401', '403', '404', '406', '409', '410', '412', '415', '429', '500', '501', '503', '505'],
      GET: ['200', '202', '203', '206', '301', '302', '304', '307', '400', '401', '403', '404', '406', '409', '410', '412', '415', '429', '500', '501', '503', '505'],
      PATCH: ['202', '204', '301', '307', '400', '401', '403', '404', '406', '409', '410', '412', '415', '422', '429', '500', '501', '503', '505'],
      POST: ['201', '202', '301', '307', '400', '401', '403', '404', '406', '409', '410', '412', '415', '429', '500', '501', '503', '505'],
      PUT: ['201', '202', '301', '307', '400', '401', '403', '404', '406', '409', '410', '412', '415', '429', '500', '501', '503', '505']
    };

    if (status && status.toValue) {
      status = status.toValue();
    }

    if (verb && verb.toValue) {
      verb = verb.toValue();
    }

    if (statusCodeMap[verb].includes(status)) {
      return true;
    }
   return false;
  }
/*
  Helper function which validates correct combination of method and status code
*/
Helper function which validates correct combination of method and status code
Helper function which validates correct combination of method and status code
function _validStatusAndVerb(verb, status) {
    const statusCodeMap = {
      DELETE: ['204', '202', '301', '307', '400', '401', '403', '404', '406', '409', '410', '412', '415', '429', '500', '501', '503', '505'],
      GET: ['200', '202', '203', '206', '301', '302', '304', '307', '400', '401', '403', '404', '406', '409', '410', '412', '415', '429', '500', '501', '503', '505'],
      PATCH: ['202', '204', '301', '307', '400', '401', '403', '404', '406', '409', '410', '412', '415', '422', '429', '500', '501', '503', '505'],
      POST: ['201', '202', '301', '307', '400', '401', '403', '404', '406', '409', '410', '412', '415', '429', '500', '501', '503', '505'],
      PUT: ['201', '202', '301', '307', '400', '401', '403', '404', '406', '409', '410', '412', '415', '429', '500', '501', '503', '505']
    };
    if (status && status.toValue) {
      status = status.toValue();
    }
    if (verb && verb.toValue) {
      verb = verb.toValue();
    }
    if (statusCodeMap[verb].includes(status)) {
      return true;
    }
   return false;
  }
function _validStatusAndVerb ( verb , status ) { const statusCodeMap = { DELETE : [ '204' , '202' , '301' , '307' , '400' , '401' , '403' , '404' , '406' , '409' , '410' , '412' , '415' , '429' , '500' , '501' , '503' , '505' ] , GET : [ '200' , '202' , '203' , '206' , '301' , '302' , '304' , '307' , '400' , '401' , '403' , '404' , '406' , '409' , '410' , '412' , '415' , '429' , '500' , '501' , '503' , '505' ] , PATCH : [ '202' , '204' , '301' , '307' , '400' , '401' , '403' , '404' , '406' , '409' , '410' , '412' , '415' , '422' , '429' , '500' , '501' , '503' , '505' ] , POST : [ '201' , '202' , '301' , '307' , '400' , '401' , '403' , '404' , '406' , '409' , '410' , '412' , '415' , '429' , '500' , '501' , '503' , '505' ] , PUT : [ '201' , '202' , '301' , '307' , '400' , '401' , '403' , '404' , '406' , '409' , '410' , '412' , '415' , '429' , '500' , '501' , '503' , '505' ] } ; if ( status && status . toValue ) { status = status . toValue ( ) ; } if ( verb && verb . toValue ) { verb = verb . toValue ( ) ; } if ( statusCodeMap [ verb ] . includes ( status ) ) { return true ; } return false ; }
Helper function which validates correct combination of method and status code
Helper function which validates correct combination of method and status code