lib/model.js
function compilePlainObject (schema, options) {
  class PlainModelInstance extends PlainBaseModel {
    constructor (data, options = {}) {
      super(data, options, schema)
    }
  }

  PlainModelInstance.schema = schema

  // if the user wants to allow modifications
  if (options.freeze !== false) {
    Object.freeze(PlainModelInstance)
  }

  return PlainModelInstance
}
function compilePlainObject (schema, options) {
  class PlainModelInstance extends PlainBaseModel {
    constructor (data, options = {}) {
      super(data, options, schema)
    }
  }

  PlainModelInstance.schema = schema

  // if the user wants to allow modifications
  if (options.freeze !== false) {
    Object.freeze(PlainModelInstance)
  }

  return PlainModelInstance
}
function compilePlainObject ( schema , options ) { class PlainModelInstance extends PlainBaseModel { constructor ( data , options = { } ) { super ( data , options , schema ) } } PlainModelInstance . schema = schema // if the user wants to allow modifications if ( options . freeze !== false ) { Object . freeze ( PlainModelInstance ) } return PlainModelInstance }
Compiles a schema into a Model
@param schema
@param options
@returns {ObjectInstance}
@private
Compiles a schema into a Model