-
Notifications
You must be signed in to change notification settings - Fork 0
/
3.ts
executable file
·13 lines (11 loc) · 1.1 KB
/
3.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
// TS playground link: https://tsplay.dev/advent-of-typescript-2023-3
// The Gift Wrapper
// Did you know that there's also monetary inflation at the North Pole? You betcha, there is. And after 200+ years without a pay raise, Santa's elves are beginning to discuss a general strike.
// December 3rd is just about the worst time imaginable for such a strike, and Santa's desperate to calm the elves down. If he can just wrap a few presents, maybe the elves will forget that they're being paid well below market rate (don't worry: the North Pole's actually still a Deleware-based startup so therefore it's ok).
// There's a GiftWrapper type to help keep the wrapping process organized, but it needs something... it needs some way to be parameterized. What we have so far is nice as a generic (*wink wink*) starting point... but it needs some way to provide specific values for Present, From, and To at the type layer..
// Please help! Otherwise the reindeer might catch wind of this and start a strike of their own in solidarity with the elves!
type GiftWrapper<Present, From, To> = {
present: Present;
from: From;
to: To;
}