type Equal = (() => T extends A ? 1 : 2) extends (() => T extends B ? 1 : 2) ? true : false; type Expect = T; import { route, tuple } from './src/main.js'; // const 类型参数保留字面量与只读元组 type Case1 = Expect>, readonly ['a', 'b']>>; type Case2 = Expect>, { path: '/home' }>>; const pair = tuple(['x', 'y']); const home = route('/home'); type Case3 = Expect>; type Case4 = Expect>; // 普通泛型(没有 const)会拓宽 function widened(items: T): T { return items; } const plain = widened(['x', 'y']); type Case5 = Expect>; export { pair, home, plain };