| 2553 | const newNodes = []; |
| 2554 | |
| 2555 | const extractLabel = itemNode => { |
| 2556 | const labelAttr = itemNode.attributes?.find(a => a.name === 'label'); |
| 2557 | if (!labelAttr) { |
| 2558 | return null; |
| 2559 | } |
| 2560 | |
| 2561 | if (labelAttr.value?.type === 'mdxJsxAttributeValueExpression') { |
| 2562 | return labelAttr.value.value.replace(/['"`]/g, '').trim(); |
| 2563 | } |
| 2564 | |
| 2565 | if (typeof labelAttr.value === 'string') { |
| 2566 | return labelAttr.value.trim(); |
| 2567 | } |
| 2568 | |
| 2569 | return null; |
| 2570 | }; |
| 2571 | |
| 2572 | bundlerItems.forEach(itemNode => { |
| 2573 | const label = extractLabel(itemNode) || 'Configuration'; |
no outgoing calls
no test coverage detected