Use literal types and union types to build a small routing helper.
Implement solve(direction, speed) where:
direction is one of: "north" | "south" | "east" | "west"speed is one of: "slow" | "fast""{direction} at {speed} speed"Also implement isCardinal(direction) which returns true if the direction is one of the four cardinal directions, false otherwise.
Examples
solve("north", "fast") → "north at fast speed"isCardinal("north") → trueisCardinal("diagonal") → falseSample tests