getVariantKey
getVariantKey<
T>(variant):CandidVariantKey<T>
Defined in: utils/candid.ts:71
Extracts the key from a Candid variant type. Variants in Candid are represented as objects with a single key-value pair.
Type Parameters
Section titled “Type Parameters”T extends Record<string, any>
Parameters
Section titled “Parameters”variant
Section titled “variant”T
The variant object
Returns
Section titled “Returns”The key of the variant