RemoveNeverValues<T>: {
    [K in keyof T as T[K] extends never
        ? never
        : K]: T[K]
}

Removes keys whose value is never.

Type Parameters

  • T