import type {IsNever} from './is-never.d.ts'; import type {IsAny} from './is-any.d.ts'; /** A stricter, non-distributive version of `extends` for checking whether one type is assignable to another. Unlike the built-in `extends` keyword, `ExtendsStrict`: 1. Prevents distribution over union types by wrapping both types in tuples. For example, `ExtendsStrict` returns `false`, whereas `string | number extends number` would result in `boolean`. 2. Treats `never` as a special case: `never` doesn't extend every other type, it only extends itself (or `any`). For example, `ExtendsStrict` returns `false` whereas `never extends number` would result in `true`. @example ``` import type {ExtendsStrict} from 'type-fest'; type T1 = ExtendsStrict; //=> false type T2 = ExtendsStrict; //=> false type T3 = ExtendsStrict; //=> true type T4 = ExtendsStrict; //=> true type T5 = ExtendsStrict; //=> true ``` @category Improved Built-in */ export type ExtendsStrict = IsAny extends true ? true : IsNever extends true ? IsNever : [Left] extends [Right] ? true : false; export {};