Transform union type to intersection type

  • 0
  • Pump00:00

Is there a way to transform a union type into an intersection type :

type FunctionUnion = () => void | (p: string) => void
type FunctionIntersection = () => void & (p: string) => void

I would like to apply a transformation to FunctionUnion to get FunctionIntersection

Default Asked on December 28, 2019 in Programming.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.