lib/mongoose-hidden.js
function prepOptions(options, defaults) {
  let _options = (options = options || {})

  // Set defaults from options and default
  let ensure = ensureOption(options)
  options = {
    hide: ensure(hide, defaults.autoHide),
    hideJSON: ensure(hideJSON, defaults.autoHideJSON),
    hideObject: ensure(hideObject, defaults.autoHideObject),
    defaultHidden: Object.assign({}, ensure(defaultHidden, defaults.defaultHidden)),
    virtuals: ensure(virtuals, defaults.virtuals),
  }

  // Add to list of default hidden
  if (typeof _options[hidden] === 'object') {
    options[defaultHidden] = Object.assign(options[defaultHidden], _options[hidden])
  }

  if (options[hide] === false) {
    options[hideJSON] = false
    options[hideObject] = false
  }

  return options
}
function prepOptions(options, defaults) {
  let _options = (options = options || {})

  // Set defaults from options and default
  let ensure = ensureOption(options)
  options = {
    hide: ensure(hide, defaults.autoHide),
    hideJSON: ensure(hideJSON, defaults.autoHideJSON),
    hideObject: ensure(hideObject, defaults.autoHideObject),
    defaultHidden: Object.assign({}, ensure(defaultHidden, defaults.defaultHidden)),
    virtuals: ensure(virtuals, defaults.virtuals),
  }

  // Add to list of default hidden
  if (typeof _options[hidden] === 'object') {
    options[defaultHidden] = Object.assign(options[defaultHidden], _options[hidden])
  }

  if (options[hide] === false) {
    options[hideJSON] = false
    options[hideObject] = false
  }

  return options
}
function prepOptions ( options , defaults ) { let _options = ( options = options || { } ) // Set defaults from options and default let ensure = ensureOption ( options ) options = { hide : ensure ( hide , defaults . autoHide ) , hideJSON : ensure ( hideJSON , defaults . autoHideJSON ) , hideObject : ensure ( hideObject , defaults . autoHideObject ) , defaultHidden : Object . assign ( { } , ensure ( defaultHidden , defaults . defaultHidden ) ) , virtuals : ensure ( virtuals , defaults . virtuals ) , } // Add to list of default hidden if ( typeof _options [ hidden ] === 'object' ) { options [ defaultHidden ] = Object . assign ( options [ defaultHidden ] , _options [ hidden ] ) } if ( options [ hide ] === false ) { options [ hideJSON ] = false options [ hideObject ] = false } return options }
Merges options from defaults and instantiation

@access private
@param {Object} options an optional set of options
@param {Object} defaults the default set of options
@returns {Object} a combined options set
Merges options from defaults and instantiation