sindresorhus/type-fest

Remove redundant code for compatibility with older versions of typescript

Open

#1.142 geöffnet am 16. Mai 2025

Auf GitHub ansehen
 (7 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (12.328 Stars) (471 Forks)batch import
enhancementgood first issue

Beschreibung

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