(html: string)
| 102 | } |
| 103 | |
| 104 | function inlineStyleText(html: string): string { |
| 105 | const doc = new DOMParser().parseFromString(html, "text/html"); |
| 106 | return Array.from(doc.querySelectorAll("style")) |
| 107 | .map((s) => s.textContent ?? "") |
| 108 | .join("\n"); |
| 109 | } |
| 110 | |
| 111 | function num(v: number | string | undefined): number | null { |
| 112 | if (typeof v === "number") return v; |
no test coverage detected