Skip to content

Commit c586ed6

Browse files
committed
fix(object): object check with array is not invalid
1 parent 7896123 commit c586ed6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/is-object-empty.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { isObject } from '@codevor/js-is-type';
1+
import { isObject, isArray } from '@codevor/js-is-type';
22

33
import isArrayEmpty from './is-array-empty';
44

5-
const isObjectEmpty = value => isObject(value) && isArrayEmpty(Object.keys(value));
5+
const isObjectEmpty = value =>
6+
isObject(value) && !isArray(value) && isArrayEmpty(Object.keys(value));
67

78
export default isObjectEmpty;

0 commit comments

Comments
 (0)