Creating a Helper Function for Type Matching in TypeScript - Effect Community