category | alias |
---|---|
Generate Object |
PickByValue |
From T pick a set of properties by value matching ValueType.
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>