serializr
    Preparing search index...

    Function createSimpleSchema

    • Creates a model schema that (de)serializes from / to plain javascript objects. Its factory method is: () => ({})

      Type Parameters

      • T extends object

      Parameters

      • props: Props<T>

        property mapping,

      Returns ModelSchema<T>

      model schema

      const todoSchema = createSimpleSchema({
      title: true,
      done: true,
      })

      const json = serialize(todoSchema, { title: 'Test', done: false })
      const todo = deserialize(todoSchema, json)