lib/mongoose-hidden.js
function shouldHide(schema, options, target, doc, transformed, pathname) {
  let hideTarget = hide + target

  // Is hiding turned off?
  if (options[hideTarget] === false) {
    return false
  }

  // Test hide by option or schema
  return (
    testOptions(options, pathname)
    || testSchema(schema, hide, doc, transformed)
    || testSchema(schema, hideTarget, doc, transformed)
  )
}
function shouldHide(schema, options, target, doc, transformed, pathname) {
  let hideTarget = hide + target

  // Is hiding turned off?
  if (options[hideTarget] === false) {
    return false
  }

  // Test hide by option or schema
  return (
    testOptions(options, pathname)
    || testSchema(schema, hide, doc, transformed)
    || testSchema(schema, hideTarget, doc, transformed)
  )
}
function shouldHide ( schema , options , target , doc , transformed , pathname ) { let hideTarget = hide + target // Is hiding turned off? if ( options [ hideTarget ] === false ) { return false } // Test hide by option or schema return ( testOptions ( options , pathname ) || testSchema ( schema , hide , doc , transformed ) || testSchema ( schema , hideTarget , doc , transformed ) ) }
Should a property be hidden er not

@access private
@param {Schema} schema a mongoose schema
@param {object} options a set of options
@param {string} target the target to test, e.g 'JSON'
@param {object} doc original document
@param {object} transformed transformed document
@param {string} pathname property path
@returns {Boolen} true of pathname should be hidden
Should a property be hidden er not