Skip to main content

Schema Creation

The t Object

All built-in types are stored in a single t object. They can be used to type specific data in schemas.

import { t } from "encodexx";
console.log(t)

Usage

To describe a schema using types, pass them to the Serializer class constructor. You can also use arrays and objects to describe more complex structures.

Info

Functions like t.or(), t.optional(), and others return a regular type and can be used just like the rest.

What’s Next?

Read about the types you are interested in in the following chapters.