-
카테고리
-
세부 분야
프로그래밍 언어
-
해결 여부
해결됨
오예 정답 입니다.
24.01.31 20:14 작성 조회수 65
1
type Fruit =
| {
name: "apple";
color: "red";
}
| {
name: "banana";
color: "yellow";
}
| {
name: "orange";
color: "orange";
};
type TransformedFruit = {
[key in Fruit as `${key["name"]}:${key['color']}`]: `${key["name"]}`;
};
type tests = [
Expect<
Equal<TransformedFruit, {
"apple:red": "apple";
"banana:yellow": "banana";
"orange:orange": "orange";
}>
>,
];
답변을 작성해보세요.
1
답변 1