Skip to content

Commit 744cbd7

Browse files
Brendan Abbottnfour
Brendan Abbott
authored andcommitted
Expand isIterable to beat the linter...
1 parent 822f2c8 commit 744cbd7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/utils.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,11 @@ import { Clone, IMerge, Merge } from 'lutils';
22

33
export const merge: IMerge = new Merge({ depth: 100 }).merge;
44
export const clone = new Clone({ depth: 100 }).clone;
5-
export const isIterable = (obj) => obj != null && typeof obj[Symbol.iterator] === 'function'
5+
6+
export function isIterable (obj) {
7+
if (obj === null || obj === undefined) {
8+
return false;
9+
}
10+
11+
return typeof obj[Symbol.iterator] === 'function';
12+
}

0 commit comments

Comments
 (0)