Building a Type Agnostic Cache Using Generics in TypeScript