You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/utils.ts
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,9 @@ type ReadonlyEquivalent<X, Y> = Extends<
118
118
>;
119
119
120
120
/**
121
-
* Checks if one type extends another.
121
+
* Checks if one type extends another. Note: this is not quite the same as `Left extends Right` because:
122
+
* 1. If either type is `never`, the result is `true` iff the other type is also `never`.
123
+
* 2. Types are wrapped in a 1-tuple so that union types are not distributed - instead we consider `string | number` to _not_ extend `number`. If we used `Left extends Right` directly you would get `Extends<string | number, number>` => `false | true` => `boolean`.
0 commit comments