Type Alias ValueOfStrict<ObjectType, PropsOfObject>

ValueOfStrict<ObjectType, PropsOfObject>: IsAbsent<PropsOfObject> extends true
    ? never
    : ObjectType[PropsOfObject]

Like type-fest's ValueOf but:

  • 2nd param PropsOfObject (extends keyof ObjectType) is required,
  • if PropsOfObject IsAbsent (i.e never, undefined, null, void or unknown), then never is returned (i.e no prop Values are retrieved for non-existent props, and no defaults are used)

Type Parameters