MCPcopy
hub / github.com/aFarkas/lazysizes / hasClass

Function hasClass

lazysizes.js:106–111  ·  view source on GitHub ↗
(ele, cls)

Source from the content-addressed store, hash-verified

104 * @param cls {string}
105 */
106 var hasClass = function(ele, cls) {
107 if(!regClassCache[cls]){
108 regClassCache[cls] = new RegExp('(\\s|^)'+cls+'(\\s|$)');
109 }
110 return regClassCache[cls].test(ele[_getAttribute]('class') || '') && regClassCache[cls];
111 };
112
113 /**
114 * @param ele {Element}

Callers 3

addClassFunction · 0.70
removeClassFunction · 0.70
unveilElementFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…