Asserts that a value is a non-null object, including arrays.
Unlike isNonNullObject, this function preserves the existing static type of the variable while removing
nullish, primitive, function, and class-constructor union members.
This assertion accepts arrays, ordinary objects, class instances, boxed primitives, and specialized built-in
objects such as Date, Map, and Set.
Use this function when:
- Youexpectanon-nullobjectatruntime, includinganarray, **and** - Youwanttokeepitscompile-timetypeintact after validation.
Asserts that a value is a non-null object, including arrays.
Unlike isNonNullObject, this function preserves the existing static type of the variable while removing nullish, primitive, function, and class-constructor union members.
This assertion accepts arrays, ordinary objects, class instances, boxed primitives, and specialized built-in objects such as
Date,Map, andSet.Use this function when: