Add check against a plain object

This commit is contained in:
Melvin Philips 2017-10-04 23:43:49 -07:00
parent 6a787261fe
commit 2e58d40c7d
2 changed files with 3 additions and 2 deletions

View file

@ -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;