Skip to content

PickByTypeExact

Category
Generate Object
Alias
PickByValueExact

From T pick a set of properties by value matching exact ValueType.

Usage

ts
import type { PickByTypeExact } from '@utype/core'

type Prop = {
  foo: number;
  bar: number | undefined;
  faz: string;
}

// Expect: { foo: number; }
type PickByTypeExactProp1 = PickByTypeExact<Prop, number>
// Expect: { bar: number | undefined; }
type PickByTypeExactProp2 = PickByTypeExact<Prop, number | undefined>