Coerce a possibly-missing collection to an array so callers can drop ?? [] and
Array.isArray(...) guards before iterating.
The runtime Array.isArray check matters for loosely-typed external payloads (EMR
responses, generated API types) where a field is declared as an array but arrives as
null, an object, or a scalar. Arrays are returned as-is, not copied.
Coerce a possibly-missing collection to an array so callers can drop
?? []andArray.isArray(...)guards before iterating.The runtime
Array.isArraycheck matters for loosely-typed external payloads (EMR responses, generated API types) where a field is declared as an array but arrives asnull, an object, or a scalar. Arrays are returned as-is, not copied.