Function createSimpleSchema

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

    Example

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

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

    Returns

    model schema

    Type Parameters

    • T extends object

    Parameters

    • props: Props<T>

      property mapping,

    Returns ModelSchema<T>

Generated using TypeDoc