type-fest
Advanced tools
Comparing version 4.18.2 to 4.18.3
{ | ||
"name": "type-fest", | ||
"version": "4.18.2", | ||
"version": "4.18.3", | ||
"description": "A collection of essential TypeScript types", | ||
@@ -5,0 +5,0 @@ "license": "(MIT OR CC0-1.0)", |
@@ -0,1 +1,3 @@ | ||
import type {IfNever} from './if-never'; | ||
/** | ||
@@ -39,8 +41,8 @@ Extract the keys from a type where the value type of the key extends the given `Condition`. | ||
Base[Key] extends Condition | ||
// Retain this key since the condition passes. | ||
? Key | ||
// Retain this key | ||
// If the value for the key extends never, only include it if `Condition` also extends never | ||
? IfNever<Base[Key], IfNever<Condition, Key, never>, Key> | ||
// Discard this key since the condition fails. | ||
: never; | ||
// Convert the produced object into a union type of the keys which passed the conditional test. | ||
}[keyof Base]; |
364503
8794