code: function requireValidModelView (view, views, resolve, resolved) {
      // validate model view name
      if (typeof view === 'string') {
          // view name is defined on model
          if (views[view]) {
              // resolve to object if option set
              if (resolve) {
                  view = resolveModelViewName(views, view, resolved)
              }
          }
          // name is not defined locally for model
          else {
              // require name to be defined globally
              assert.ok(ImmutableCoreModelView.hasModelView(view), 'model view not found '+view)
              // get model view instance object
              if (resolve) {
                  // get model view constructor
                  var ModelView = ImmutableCoreModelView.modelView(view)
                  // get instance from constructor
                  view = ModelView()
              }
          }
      }
      // validate model view instance object
      else if (typeof view === 'object') {
          // require ImmutableCoreModelViewInstance
          assert.ok(view.ImmutableCoreModelViewInstance, 'invalid model view instance')
      }
      // validate model view constructor function
      else if (typeof view === 'function') {
          // require ImmutableCoreModelView constructor
          assert.ok(view.ImmutableCoreModelView, 'invalid model view instance')
          // get instance from constructor
          if (resolve) {
              view = view()
          }
      }
      // invalid type
      else {
          throw new Error('name or object required for view')
      }
  
      // return validated model view
      return view
  }
docs: @function requireValidModelView
  
  validate argument which can be either model view name or object. throws
  error on invalid argument.
  
  when the resolve argument is true then string model view names will be
  resolved into model view object(s) and constructors will be resolved into
  instances.
  
  if name is an alias for a list of model view objects then an array will be
  returned. otherwise model view object will be returned.
  
  @param {function|string|object} view
  @param {object} views
  @param {boolean} resolve
  @param {object} resolved
  
  @returns {array|object|string}
  
  @throws {Error}