File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1- // Exclude<T1,T2 > : Exclude는 Omit과 Pick과는 달리 속성이 아닌 특정 타입(num,string)을 지정해서 제외하면 사용할 수 있다 .
1+ // NonNullable<T > : NonNullable은 Null과 undefined를 제외한 타입을 생성한다 .
22// -- data.interface 참조
33import {
44 GradeType , ScoreType , User
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ export interface ScoreTemp {
9393export type GradeType = '1' | '2' | '3' | '4' ;
9494export type ScoreType = 'A' | 'B' | 'C' | 'D' ;
9595
96- //Exclude
97- type T1 = string | number ;
98- //T1은 Exclude이다. 따라 T1의 유니온으로 지정된 number를 제외하고 string만 사용하는 것이다 .
99- type T2 = Exclude < T1 , number > ;
96+ //NonNullable
97+ export type T1 = string | null | undefined | void ;
98+ //T2는 NonNullable의 따라 T1의 유니온으로 지정된 null과 undefined를 제외하고 string과 void만 남게 된다 .
99+ export type T2 = NonNullable < T1 > ;
You can’t perform that action at this time.
0 commit comments