serializr
    Preparing search index...

    Function primitive

    • Indicates that this field contains a primitive value (or Date) which should be serialized literally to json.

      Parameters

      • OptionaladditionalArgs: AdditionalPropArgs

        optional object that contains beforeDeserialize and/or afterDeserialize handlers

      Returns PropSchema

      createModelSchema(Todo, {
      title: primitive(),
      })

      serialize(new Todo('test')) // { "title": "test" }