Skip to main content
Version: Next 🚧

[F] assertType

function assertType<TKind>(
typeDescription,
t, ...
kinds): asserts t is Type & Object

Assert that the input type has one of the kinds provided

Type Parameters

Type Parameter
TKind extends ( | "Boolean" | "Decorator" | "Enum" | "EnumMember" | "FunctionParameter" | "Function" | "Interface" | "Intrinsic" | "Model" | "ModelProperty" | "Namespace" | "Number" | "Object" | "Operation" | "Projection" | "Scalar" | "ScalarConstructor" | "String" | "StringTemplate" | "StringTemplateSpan" | "TemplateParameter" | "Tuple" | "Union" | "UnionVariant")[]

Parameters

ParameterType
typeDescriptionstring
tType
...kindsTKind

Returns

asserts t is Type & Object