(el, className)
| 23 | } |
| 24 | |
| 25 | function _removeClass(el, className){ |
| 26 | const clist = getClassList(el); |
| 27 | const length = clist.length; |
| 28 | let str = '', changed = false; |
| 29 | for (let i = 0; i < length; i++) { |
| 30 | if (!clist[i]) continue; |
| 31 | if (clist[i] === className) { |
| 32 | changed = true; |
| 33 | } else { |
| 34 | if (str) str += ' '; |
| 35 | str += clist[i]; |
| 36 | } |
| 37 | } |
| 38 | if (changed) el.className = str; |
| 39 | } |
| 40 | |
| 41 | export function hasClass(el, className){ |
| 42 | if (el && className && el instanceof Node) { |
no test coverage detected
searching dependent graphs…