Skip to main content

$const

Callable

  • $const<T>(value: T, options?: SchemaOptions<object>): ConstType<T>

  • Create a new EnumType instance with the given options.

    Example

    $const(1)

    $const("foobar")

    Type parameters

    • T: undefined | JsonValue

    Parameters

    • value: T
    • options: SchemaOptions<object> = {}

      Additional options to pass to the constant.

    Returns ConstType<T>