Instruction: Provide an example of a function implementation that uses conditional types based on its inputs.
Context: Assesses the candidate's ability to use TypeScript's advanced types, specifically conditional types, to create highly dynamic and type-safe functions.