(sub: string, parent: string)
| 42 | } |
| 43 | |
| 44 | export function isSelectorWithin(sub: string, parent: string): boolean { |
| 45 | const parentLength = parent.length; |
| 46 | const subLength = sub.length; |
| 47 | if (subLength < parentLength || !sub.startsWith(parent)) { |
| 48 | return false; |
| 49 | } |
| 50 | if (subLength === parentLength) { |
| 51 | return true; |
| 52 | } |
| 53 | let i = parentLength; |
| 54 | const c = sub[i]; |
| 55 | if (c === '.' || c === ':' || c === '#' || c === '[' || c === '>') { |
| 56 | return true; |
| 57 | } |
| 58 | if (c === '+' || c === '~' || c !== ' ') { |
| 59 | return false; |
| 60 | } |
| 61 | while (sub[i] === ' ') { |
| 62 | i++; |
| 63 | } |
| 64 | return sub[i] !== '+' && sub[i] !== '~'; |
| 65 | } |
| 66 | |
| 67 | export function cleanFilterSelectors() { |
| 68 | filterSelectors.invert.clear(); |
no outgoing calls
no test coverage detected
searching dependent graphs…