[Typescript] 134. Easy - Identity Helper

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>>
];

 

posted @ 2022-12-11 22:01  Zhentiw  阅读(23)  评论(0编辑  收藏  举报