getVariantKey
getVariantKey<
T>(variant):CandidVariantKey<T>
Defined in: utils/candid.ts:108
Extracts the key from a Candid variant type. Supports both raw Candid variants ({ Ok: value }) and display variants ({ _type: “Ok”, Ok: value }).
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