首页 > 其他分享 >[Typescript] 134. Easy - Identity Helper

[Typescript] 134. Easy - Identity Helper

时间:2022-12-11 22:12:48浏览次数:49  
标签:Typescript Helper Expect Easy type Identity

import { Equal, Expect } from "../helpers/type-utils";

type Identity<T> = T;

type tests = [
  Expect<Equal<Identity<1>, 1>>,
  Expect<Equal<Identity<"1">, "1">>,
  Expect<Equal<Identity<true>, true>>,
  Expect<Equal<Identity<false>, false>>,
  Expect<Equal<Identity<null>, null>>
];

 

标签:Typescript,Helper,Expect,Easy,type,Identity
From: https://www.cnblogs.com/Answer1215/p/16974646.html

相关文章