(target: string, root: Root)
| 36 | } |
| 37 | |
| 38 | function classNameMany(target: string, root: Root): Element[] { |
| 39 | if (!target) { |
| 40 | throw botError(INVALID_SELECTOR, 'No class name specified') |
| 41 | } |
| 42 | target = target.trim() |
| 43 | if (target.indexOf(' ') !== -1) { |
| 44 | throw botError(INVALID_SELECTOR, 'Compound class names not permitted') |
| 45 | } |
| 46 | try { |
| 47 | return Array.from(root.querySelectorAll('.' + target.replace(/\\/g, '\\\\').replace(/\./g, '\\.'))) |
| 48 | } catch (_e) { |
| 49 | throw botError(INVALID_SELECTOR, 'An invalid or illegal class name was specified') |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | function cssMany(target: string, root: Root): Element[] { |
| 54 | try { |
no test coverage detected