Extract Array Element type in Typescript


type ArrayElementType<ArrType> = ArrType extends readonly (infer ElementType)[] ? ElementType : never;