-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday3.ts
33 lines (26 loc) · 904 Bytes
/
day3.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*Solution*/
type GiftWrapper<T,K,U> = {
present: T;
from: K;
to: U;
}
/*Tests*/
import { Expect, Equal } from 'type-testing';
type test_SantaToTrash_actual = GiftWrapper<'Car', 'Santa', 'Trash'>;
type test_SantaToTrash_expected = { present: 'Car', from: 'Santa', to: 'Trash' };
type test_SantaToTrash = Expect<Equal<
test_SantaToTrash_actual,
test_SantaToTrash_expected
>>;
type test_TrashToPrime_actual = GiftWrapper<'vscode', 'Trash', 'Prime'>;
type test_TrashToPrime_expected = { present: 'vscode', from: 'Trash', to: 'Prime' };
type test_TrashToPrime = Expect<Equal<
test_TrashToPrime_actual,
test_TrashToPrime_expected
>>;
type test_DanToEvan_actual = GiftWrapper<'javascript', 'Dan', 'Evan'>;
type test_DanToEvan_expected = { present: 'javascript', from: 'Dan', to: 'Evan' };
type test_DanToEvan = Expect<Equal<
test_DanToEvan_actual,
test_DanToEvan_expected
>>;