mirror of
https://github.com/sindresorhus/type-fest.git
synced 2025-12-08 19:25:05 +00:00
14 lines
375 B
TypeScript
14 lines
375 B
TypeScript
import {expectError, expectType} from 'tsd';
|
|
import type {IfAny} from '../index';
|
|
|
|
declare const _any: any;
|
|
|
|
// `IfAny` should return `true`/`false` if only `T` is specified
|
|
expectType<IfAny<any>>(true);
|
|
expectType<IfAny<string>>(false);
|
|
expectType<IfAny<any, 'T', 'F'>>('T');
|
|
expectType<IfAny<string, 'T', 'F'>>('F');
|
|
|
|
// Missing generic parameter
|
|
expectError<IfAny>(_any);
|