Skip to content

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.

T extends object

T | null | undefined

The object to normalize.

T | null

The object, or null when it is absent or has no own enumerable property.