diff --git a/src/types/utils/EmptyObject.ts b/src/types/utils/EmptyObject.ts index 8cb1ff6db2a2..aa8b538499cd 100644 --- a/src/types/utils/EmptyObject.ts +++ b/src/types/utils/EmptyObject.ts @@ -2,12 +2,14 @@ import Falsy from './Falsy'; type EmptyObject = Record; +type EmptyValue = EmptyObject | null | undefined; + // eslint-disable-next-line rulesdir/no-negated-variables function isNotEmptyObject | Falsy>(arg: T | EmptyObject): arg is NonNullable { return Object.keys(arg ?? {}).length > 0; } -function isEmptyObject(obj: T | EmptyObject | null | undefined): obj is EmptyObject { +function isEmptyObject(obj: T | EmptyValue): obj is EmptyValue { return Object.keys(obj ?? {}).length === 0; }