import { union } from "https://deno.land/x/typeguardkit@0.33.0/mod.ts";
union
can be used to create a UnionAsserter
without specifying a
typeName
.
Example:
import { _null, _string, Asserted, union } from "typeguardkit";
export const _stringOrNull = union(_string, _null);
export type stringOrNull = Asserted<typeof _stringOrNull>;
Type Parameters
Asserters extends ReadonlyArray<Asserter<unknown>>
Parameters
...memberAsserters: Asserters