import { LiteralUnionAsserter } from "https://deno.land/x/typeguardkit@0.33.0/mod.ts";
A LiteralUnionAsserter
is an Asserter
for the union of its values
.
The provided values
are made accessible as a property of the created
LiteralUnionAsserter
.
The values
array should be asserted as const
if defined outside the
constructor call.
Example:
import { Asserted, LiteralUnionAsserter } from "typeguardkit";
export const _Direction = new LiteralUnionAsserter(
"Direction",
["up", "right", "down", "left"],
);
export type Direction = Asserted<typeof _Direction>;