category | alias |
---|---|
Generate Object |
GetRequired |
From T pick all required properties to generate a new object type.
import type { PickByRequired } from '@utype/core'
type Props = {
foo: number;
bar?: string;
}
// Expect: { foo: number; } // [!code highlight]
type PickByRequiredProps = PickByRequired<Props>