Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jarpoole committed Nov 27, 2024
1 parent 1d44863 commit b7796c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/is-any.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ const anyA = get(anyObject, 'a');
@category Type Guard
@category Utilities
*/
export type IsAny<T> = 0 extends 1 & T ? true : false;
export type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
7 changes: 7 additions & 0 deletions test-d/is-any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,10 @@ expectType<IsAny<void>>(false);
// Missing generic parameter
// @ts-expect-error
type A = IsAny;

// Verify that are no circular reference issues
// https://github.com/sindresorhus/type-fest/issues/846
type OnlyAny<T extends IsAny<T> extends true ? any : never> = T;
type B = OnlyAny<any>
// @ts-expect-error
type C = OnlyAny<string>

0 comments on commit b7796c7

Please sign in to comment.