Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioramos committed Nov 6, 2014
1 parent a9bbb92 commit 9f95848
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion component.json
@@ -1,6 +1,6 @@
{
"name": "isElement",
"version": "0.0.2",
"version": "0.0.3",
"description": "check if a value is an element",
"repo": "ramitos/isElement",
"keywords": ["documet", "isElement"],
Expand Down
15 changes: 6 additions & 9 deletions src/isElement.js
@@ -1,10 +1,7 @@
var type = require('type')
var type = require('type');

module.exports = function (el) {
var element = HTMLElement
? HTMLElement
: Element

if(type(element) === 'function') return (el instanceof element)
return type(el) === 'element' && type(el.nodeName) === 'string'
}
module.exports = function(el) {
var element = HTMLElement ? HTMLElement : Element;
if (type(element) === 'function') return (el instanceof element);
return type(el) === 'element' && type(el.nodeName) === 'string';
};

0 comments on commit 9f95848

Please sign in to comment.