Function: isContainer()
isContainer<
T>(value):value is Container<T>
Type guard for a Container - an iterable to be treated as a collection rather than a scalar.
Deliberately excludes values that are technically iterable but should be
treated as scalars here - strings, String/RegExp objects, and functions -
so a lone string is never spread character-by-character.
Type Parameters
Section titled “Type Parameters”T = unknown
Element type asserted for the iterable.
Parameters
Section titled “Parameters”unknown
Value to test.
Returns
Section titled “Returns”value is Container<T>
true (narrowing value to Container<T>) for a non-string
iterable.