(opening: t.JSXOpeningElement, name: string)
| 57 | } |
| 58 | |
| 59 | function readJsxNumberAttr(opening: t.JSXOpeningElement, name: string): number | null { |
| 60 | const attr = findJsxAttr(opening, name); |
| 61 | const v = attr?.value; |
| 62 | if (!v || !t.isJSXExpressionContainer(v)) return null; |
| 63 | if (!t.isNumericLiteral(v.expression)) return null; |
| 64 | const n = v.expression.value; |
| 65 | return Number.isFinite(n) ? n : null; |
| 66 | } |
| 67 | |
| 68 | export type ImportInfo = { |
| 69 | node: t.ImportDeclaration; |
no test coverage detected