Solve the TypeScript problem: there is a Response type with mutually exclusive fields payload and error, and their types may differ. You need to type the functions payloadFrom(response), which returns payload or undefined, and errorFrom(response), which returns error or undefined, so that the return types are automatically inferred from the input Response.