1 line
370 B
JavaScript
1 line
370 B
JavaScript
|
|
"use strict";function e(e,o){if(!e||!e.nodeType||"string"!=typeof o)return null;o=o.split("."),1===o.length?o.push(null):o[0]||(o[0]=null);do{if(!o[0]&&!o[1])break;var r=o[0]?o[0].toLowerCase()===e.nodeName.toLowerCase():!0,t=o[1]?-1!==e.className.toLowerCase().search(o[1].toLowerCase()):!0;if(r&&t)break;e=e.parentNode}while(e);return e}module.exports={getAncestor:e};
|