From 1d5bf2922a697b6c6f23aeb4fcb86c405ecf9425 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Fri, 6 Oct 2017 14:54:16 +0700 Subject: [PATCH] Update index.js --- index.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 0707709..a24021c 100644 --- a/index.js +++ b/index.js @@ -161,13 +161,17 @@ is.inRange = (x, range) => { throw new TypeError(`Invalid range: ${util.inspect(range)}`); }; -const NODE_TYPE_ELEMENT_NODE = 1; -const DOM_PROPERTIES_TO_CHECK = ['innerHTML', 'ownerDocument', 'style', 'attributes', 'nodeValue']; +const NODE_TYPE_ELEMENT = 1; +const DOM_PROPERTIES_TO_CHECK = [ + 'innerHTML', + 'ownerDocument', + 'style', + 'attributes', + 'nodeValue' +]; -is.domElement = x => { - return is.object(x) && x.nodeType === NODE_TYPE_ELEMENT_NODE && is.string(x.nodeName) && - !is.plainObject(x) && DOM_PROPERTIES_TO_CHECK.every(property => property in x); -}; +is.domElement = x => is.object(x) && x.nodeType === NODE_TYPE_ELEMENT && is.string(x.nodeName) && + !is.plainObject(x) && DOM_PROPERTIES_TO_CHECK.every(property => property in x); is.infinite = x => x === Infinity || x === -Infinity;