Get a numeric attribute value, or undefined if missing or not a number.
(name: string)
| 22 | |
| 23 | /** Get a numeric attribute value, or undefined if missing or not a number. */ |
| 24 | numAttr(name: string): number | undefined { |
| 25 | const raw = this.attr(name) |
| 26 | if (raw === undefined) return undefined |
| 27 | const n = Number(raw) |
| 28 | return Number.isNaN(n) ? undefined : n |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Find the first child element matching the given localName (namespace-agnostic). |
no test coverage detected