79109726

Date: 2024-10-21 11:06:16
Score: 0.5
Natty:
Report link

Another solution that is especially useful for getting the types of multiple properties is using Pick:

type A = Pick<T, 'prop1' | 'prop2'>

The above is equivalent to:

type A = {
  prop1: T['prop1'], 
  prop2: T['prop2']
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: GlabbichRulz