Commit 811bcc0
fix(ascii-stroke): narrow SVG root via instanceof, drop unsafe cast
`doc.documentElement` is typed HTMLElement, so `as SVGSVGElement` tripped
ts(2352) and was blocking the pre-push astro-check gate (pre-existing,
unrelated to README). Replace the tagName string guard with
`instanceof SVGSVGElement` — it narrows root properly (and rejects
<parsererror>/non-SVG roots), so importNode now returns SVGSVGElement and
no cast is needed. No runtime behavior lost; the gate goes green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 5b2117c commit 811bcc0
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
61 | 63 | | |
62 | | - | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
95 | | - | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
0 commit comments