TypeScript 5.4 beta gives generic APIs control over inference inputs
engineeringtypescripttypesinferencecompilerNoInfer lets a generic function distinguish the arguments that determine a type from arguments checked against it. The beta also preserves narrowing in closures created after a variable's final assignment.