mirror of
https://github.com/sindresorhus/type-fest.git
synced 2025-12-08 19:25:05 +00:00
12 lines
419 B
TypeScript
12 lines
419 B
TypeScript
import {expectType} from 'tsd';
|
|
import type {IsNull} from '../source/is-null';
|
|
|
|
// https://www.typescriptlang.org/docs/handbook/type-compatibility.html
|
|
expectType<IsNull<null>>(true);
|
|
expectType<IsNull<any>>(true);
|
|
expectType<IsNull<never>>(true);
|
|
expectType<IsNull<undefined>>(false); // Depends on `strictNullChecks`
|
|
expectType<IsNull<unknown>>(false);
|
|
expectType<IsNull<void>>(false);
|
|
expectType<IsNull<{}>>(false);
|