Implement a type-safe Last-In-First-Out (LIFO) Stack data structure in TypeScript with full generic parameterization and peek/pop protections.
Implement a Least Recently Used (LRU) Cache in TypeScript using a Map data structure to achieve O(1) get and put operations with type safety.