-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
117 additions
and
50 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
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,23 @@ | ||
/** | ||
* @file Testing types related to the use of `any`. | ||
*/ | ||
import type {IsAny} from "../types/any.js"; | ||
|
||
interface InterfaceWithContents { | ||
// type-coverage:ignore-next-line | ||
one: any; | ||
} | ||
|
||
interface EmptyInterface {} | ||
|
||
const any: IsAny<any> = true; | ||
const unknown: IsAny<unknown> = false; | ||
const primitive: IsAny<number> = false; | ||
const interfaceWithContents: IsAny<InterfaceWithContents> = false; | ||
const emptyInterface: IsAny<EmptyInterface> = false; | ||
const objectA: IsAny<object> = false; | ||
/* eslint-disable @typescript-eslint/ban-types */ | ||
// type-coverage:ignore-next-line | ||
const objectB: IsAny<Object> = false; | ||
/* eslint-enable @typescript-eslint/ban-types */ | ||
const literal: IsAny<1> = false; |
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
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 @@ | ||
/** | ||
* @file Types related to the use of `any`. | ||
*/ | ||
|
||
/** | ||
* Check if a type is `any`. | ||
* @param Type The type to check. | ||
* @returns {boolean} True if a type is `any` and otherwise false. | ||
* @see https://stackoverflow.com/a/55541672 | ||
*/ | ||
export type IsAny<Type> = 0 extends Type & 1 ? true : false; |
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