code: function writeValue (value, fieldSchema) {
    // onBeforeValueSet allows you to cancel the operation.
    // It doesn't work like transform and others that allow you to modify the value because all typecast has already happened.
    // For use-cases where you need to modify the value, you can set a new value in the handler and return false.
    if (this.schema.options.onBeforeValueSet) {
      if (this.schema.options.onBeforeValueSet.call(this, fieldSchema.name, value) === false) {
        return
      }
    }
  
    // Alias simply copies the value without actually writing it to alias target.
    // Because the value isn't actually set on the alias target, onValueSet isn't fired.
    if (fieldSchema.type === 'alias') {
      this[fieldSchema.target] = value
      return
    }
  
    // if virtual and set specified call it
    if (fieldSchema.virtual === true) {
      if (fieldSchema.set) {
        value = fieldSchema.set.call(this, value)
      } else {
        return
      }
    }
  
    // Write the value to the inner object.
    this[_privateKey]._obj[fieldSchema.name] = value
  
    // onValueSet notifies you after a value has been written.
    if (this.schema.options.onValueSet) {
      this.schema.options.onValueSet.call(this, fieldSchema.name, value)
    }
  }
docs: Used to write value to object.