Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 547 Bytes

pick-by-type.md

File metadata and controls

27 lines (20 loc) · 547 Bytes
category alias
Generate Object
PickByValue

PickByType

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

Usage

import type { PickByType } from '@utype/core'

type Props = {
  foo: number;
  bar: number | undefined;
  faz: boolean;
}

// Expect: { foo: number; }
type PickByTypeProps1 = PickByType<Props, number>
// Expect: { foo: number; bar: number | undefined; }
type PickByTypeProps2 = PickByType<Props, number | undefined>