lib/pathMatch.js
function setup(check) {
  if (!check) {
    throw new Error('Data to match is not defined')
  } else if (!check.jsonBody) {
    throw new Error('jsonBody is not defined')
  } else if (!check.jsonTest) {
    throw new Error('jsonTest is not defined')
  }

  // define the defaults
  const defaults = {
    isNot: false,
    path: undefined,
    // jsonBody will be present
    // jsonTest will be present
  }

  // merge the passed in values with the defaults
  return _.merge(defaults, check)
}
function setup(check) {
  if (!check) {
    throw new Error('Data to match is not defined')
  } else if (!check.jsonBody) {
    throw new Error('jsonBody is not defined')
  } else if (!check.jsonTest) {
    throw new Error('jsonTest is not defined')
  }

  // define the defaults
  const defaults = {
    isNot: false,
    path: undefined,
    // jsonBody will be present
    // jsonTest will be present
  }

  // merge the passed in values with the defaults
  return _.merge(defaults, check)
}
function setup ( check ) { if ( ! check ) { throw new Error ( 'Data to match is not defined' ) } else if ( ! check . jsonBody ) { throw new Error ( 'jsonBody is not defined' ) } else if ( ! check . jsonTest ) { throw new Error ( 'jsonTest is not defined' ) } // define the defaults const defaults = { isNot : false , path : undefined , // jsonBody will be present // jsonTest will be present } // merge the passed in values with the defaults return _ . merge ( defaults , check ) }
performs a setup operation by checking the input data and merging the input data with a set of defaults returns the result of merging the default options and the input data
performs a setup operation by checking the input data and merging the input data with a set of defaults returns the result of merging the default options and the input data