sindresorhus/type-fest

Remove redundant code for compatibility with older versions of typescript

Fermée

#1 142 ouverte le 16 mai 2025

 (7 commentaires) (0 réaction) (0 personne assignée)TypeScript (471 forks)batch import
enhancementgood first issue

Métriques du dépôt

Stars
 (12 328 étoiles)
Métriques de merge PR
 (Merge moyen 3j 5h) (11 PRs mergées en 30 j)

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>

Guide contributeur