(root: Path)
| 255 | |
| 256 | |
| 257 | def cases_b(root: Path) -> list[Case]: |
| 258 | out: list[Case] = [] |
| 259 | assets = root / "assets" |
| 260 | if not assets.is_dir(): |
| 261 | return out |
| 262 | for p in sorted(assets.glob("*.css.liquid")): |
| 263 | rel = _rel(root, p) |
| 264 | out.extend((rel, line, key) for line, key in css_selectors(_read(p))) |
| 265 | for p in sorted(assets.glob("*.js.liquid")): |
| 266 | rel = _rel(root, p) |
| 267 | text = mask_inactive(_read(p)) |
| 268 | ln = _Lines(text) |
| 269 | for m in re.finditer(r"\b(?:function|class)\s+(?!extends\b)([A-Za-z_$][\w$]*)", text): |
| 270 | out.append((rel, ln.of(m.start()), m.group(1))) |
| 271 | return out |
| 272 | |
| 273 | |
| 274 | _DEFINE = re.compile(r"""customElements\s*\.\s*define\s*\(\s*(['"])([\w-]+)\1""") |
no test coverage detected