stack

Home > @infiniteobjects/type-utils > ConditionalExcept

ConditionalExcept type

Exclude keys from a shape that matches the given Condition.

Signature:

export type ConditionalExcept<Base, Condition> = Except<Base, ConditionalKeys<Base, Condition>>;

References: Except, ConditionalKeys

Remarks

This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.