Skip to main content

Type undef

Information

  • Used to represent the undefined value.
  • Primarily used in combination with the t.or() function, making the field optional.
  • Use undefined when encoding.

Example Usage

index.ts
import { Serializer, t } from "encodexx"
const serializer = new Serializer({
n: t.undef,
title: t.or(t.str, t.undef),
message: t.str,
})
serializer.encode({
message: "this is my message"
});