css-query-selector
Advanced tools
Comparing version
@@ -81,2 +81,8 @@ "use strict"; | ||
el = queryEl(el); | ||
if (!el) { | ||
console.warn('Element is empty.'); | ||
return false; | ||
} | ||
return el.closest ? el.closest(ancestor) : _queryAncestorPolyfill(el, ancestor); | ||
@@ -83,0 +89,0 @@ }; |
@@ -69,2 +69,8 @@ import _typeof from "reshow-runtime/es/helpers/typeof"; | ||
el = queryEl(el); | ||
if (!el) { | ||
console.warn('Element is empty.'); | ||
return false; | ||
} | ||
return el.closest ? el.closest(ancestor) : _queryAncestorPolyfill(el, ancestor); | ||
@@ -71,0 +77,0 @@ }; |
{ | ||
"name": "css-query-selector", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"description": "CSS simple query alias function", | ||
@@ -29,3 +29,4 @@ "repository": "react-atomic/react-atomic-organism", | ||
"prepublishOnly": "npm run test", | ||
"test": "npm run build && mocha 'build/cjs/**/__tests__/*.js' -r jsdom-global/register" | ||
"mocha": "mocha -r jsdom-global/register 'build/cjs/**/__tests__/*.js'", | ||
"test": "npm run build && npm run mocha" | ||
}, | ||
@@ -32,0 +33,0 @@ "files": [ |
8870
2.28%222
3.74%