sindresorhus/type-fest

Remove redundant code for compatibility with older versions of typescript

Closed

#1,142 opened on May 16, 2025

 (7 comments) (0 reactions) (0 assignees)TypeScript (471 forks)batch import
enhancementgood first issue

Repository metrics

Stars
 (12,328 stars)
PR merge metrics
 (Avg merge 3d 5h) (11 merged PRs in 30d)

Description

In some previously supported but now unsupported versions of typescript, there would be some incorrect circular check, and in order to bypass the circular check, we have to add some non-essential code, for example:

type A<T> = 
 SomeToolType<T> extends infer B 
  ? B
  : never // Never happen

The above code can be simplified now:

type A<T> = SomeToolType<T>

Contributor guide