nullIfEmpty
nullIfEmpty<
T>(value):T|null
Defined in: packages/core/src/object/null-if-empty.ts:11
Normalizes an object with no own enumerable property to null.
Useful against APIs that report “no value” as an empty object rather than as
null or undefined, so that callers only have one absent form to test.
Type Parameters
Section titled “Type Parameters”T extends object
Parameters
Section titled “Parameters”T | null | undefined
The object to normalize.
Returns
Section titled “Returns”T | null
The object, or null when it is absent or has no own enumerable
property.