Add check against a plain object
This commit is contained in:
parent
6a787261fe
commit
2e58d40c7d
2 changed files with 3 additions and 2 deletions
2
index.js
2
index.js
|
|
@ -161,6 +161,6 @@ is.inRange = (x, range) => {
|
|||
throw new TypeError(`Invalid range: ${util.inspect(range)}`);
|
||||
};
|
||||
|
||||
is.domElement = x => is.object(x) && x.nodeType === 1;
|
||||
is.domElement = x => is.object(x) && x.nodeType === 1 && is.string(x.nodeName) && !is.plainObject(x);
|
||||
|
||||
module.exports = is;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue