首页 > 其他分享 >[Typescript] 135. Easy - Maybe helper

[Typescript] 135. Easy - Maybe helper

时间:2022-12-11 22:11:58浏览次数:62  
标签:Typescript undefined Maybe Expect Easy null type

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

type Maybe<T> = T | null | undefined;

type tests = [
  Expect<Equal<Maybe<string>, string | null | undefined>>,
  Expect<Equal<Maybe<number>, number | null | undefined>>,
  Expect<Equal<Maybe<boolean>, boolean | null | undefined>>,
  Expect<Equal<Maybe<null>, null | undefined>>
];

 

标签:Typescript,undefined,Maybe,Expect,Easy,null,type
From: https://www.cnblogs.com/Answer1215/p/16974657.html

相关文章