Home > @infiniteobjects/type-utils > ConditionalKeys
Extract the keys from a type where the value type of the key extends the given Condition
.
Signature:
export type ConditionalKeys<Base, Condition> = NonNullable<{
[Key in keyof Base]: Base[Key] extends Condition ? Key : never;
}[keyof Base]>;
To support partial types, make sure your Condition
is a union of undefined (for example, string | undefined
)