(node, cls)
| 3 | export function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") } |
| 4 | |
| 5 | export let rmClass = function(node, cls) { |
| 6 | let current = node.className |
| 7 | let match = classTest(cls).exec(current) |
| 8 | if (match) { |
| 9 | let after = current.slice(match.index + match[0].length) |
| 10 | node.className = current.slice(0, match.index) + (after ? match[1] + after : "") |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | export function removeChildren(e) { |
| 15 | for (let count = e.childNodes.length; count > 0; --count) |
no test coverage detected