-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40017 from software-mansion-labs/typescript/route…
…s-validation [TS Migration][No QA] Improve routes validation
- Loading branch information
Showing
3 changed files
with
23 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type {IsEqual} from 'type-fest'; | ||
|
||
type MatchError = 'Error: Types do match'; | ||
|
||
/** | ||
* The 'AssertTypesNotEqual' type here enforces that `T1` and `T2` do not match. | ||
* If `T1` or `T2` are the same this type will cause a compile-time error. | ||
*/ | ||
type AssertTypesNotEqual<T1, T2 extends IsEqual<T1, T2> extends false ? T1 : TMatchError, TMatchError = MatchError> = T1 & T2; | ||
|
||
export default AssertTypesNotEqual; |