| 2565 | const newNodes = []; |
| 2566 | |
| 2567 | const extractLabel = itemNode => { |
| 2568 | const labelAttr = itemNode.attributes?.find(a => a.name === 'label'); |
| 2569 | if (!labelAttr) { |
| 2570 | return null; |
| 2571 | } |
| 2572 | |
| 2573 | if (labelAttr.value?.type === 'mdxJsxAttributeValueExpression') { |
| 2574 | return labelAttr.value.value.replace(/['"`]/g, '').trim(); |
| 2575 | } |
| 2576 | |
| 2577 | if (typeof labelAttr.value === 'string') { |
| 2578 | return labelAttr.value.trim(); |
| 2579 | } |
| 2580 | |
| 2581 | return null; |
| 2582 | }; |
| 2583 | |
| 2584 | bundlerItems.forEach(itemNode => { |
| 2585 | const label = extractLabel(itemNode) || 'Configuration'; |
no outgoing calls
no test coverage detected