A UserSimulatorAgent narrowed to one that has a concrete voice set.
The public UserSimulatorAgent.voice getter is typed string | undefined
(optional voice). This intersection narrows it to string (non-optional),
so the executor can use the return value of findVoiceUserSim without
additional null-guards on the voice field.
Usage: callers that need the narrowed type should use
isVoiceUserSim as a type guard — it already enforces voice.length > 0.
A
UserSimulatorAgentnarrowed to one that has a concrete voice set.The public
UserSimulatorAgent.voicegetter is typedstring | undefined(optional voice). This intersection narrows it tostring(non-optional), so the executor can use the return value offindVoiceUserSimwithout additional null-guards on thevoicefield.Usage: callers that need the narrowed type should use isVoiceUserSim as a type guard — it already enforces
voice.length > 0.