sindresorhus/type-fest

Remove redundant code for compatibility with older versions of typescript

Open

#1142 aperta il 16 mag 2025

Vedi su GitHub
 (7 commenti) (0 reazioni) (0 assegnatari)TypeScript (471 fork)batch import
enhancementgood first issue

Metriche repository

Star
 (12.328 star)
Metriche merge PR
 (Merge medio 4g 18h) (9 PR mergiate in 30 g)

Descrizione

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>

Guida contributor