@mintlify/common
Advanced tools
@@ -6,3 +6,6 @@ import { visit } from 'unist-util-visit'; | ||
| visit(tree, 'mdxJsxFlowElement', (node, index, parent) => { | ||
| if (node.name && codeGroupCompoenents.includes(node.name) && index && parent) { | ||
| if (node.name && | ||
| codeGroupCompoenents.includes(node.name) && | ||
| typeof index === 'number' && | ||
| parent) { | ||
| groupsToProcess.push({ node, index, parent }); | ||
@@ -13,3 +16,4 @@ } | ||
| // basically remove the CodeGroup component and replace it with the codeblocks | ||
| for (const { node, index, parent } of groupsToProcess) { | ||
| // process in reverse document order so splices don't shift saved sibling indices | ||
| for (const { node, index, parent } of groupsToProcess.reverse()) { | ||
| const numberOfCodeBlocks = node.children.length; | ||
@@ -16,0 +20,0 @@ if (numberOfCodeBlocks <= 1) |
@@ -5,7 +5,9 @@ import { visit } from 'unist-util-visit'; | ||
| visit(tree, 'mdxJsxFlowElement', (node, index, parent) => { | ||
| if (node.name === 'Tabs' && index && parent) { | ||
| if (node.name === 'Tabs' && typeof index === 'number' && parent) { | ||
| tabsToProcess.push({ node, index, parent }); | ||
| } | ||
| }); | ||
| for (const { node, index, parent } of tabsToProcess) { | ||
| // process in reverse document order so splices don't shift the saved | ||
| // indices of earlier siblings or clone-before-split nested Tabs | ||
| for (const { node, index, parent } of tabsToProcess.reverse()) { | ||
| const numberOfTabs = node.children.length; | ||
@@ -12,0 +14,0 @@ if (numberOfTabs <= 1) |
+2
-2
| { | ||
| "name": "@mintlify/common", | ||
| "version": "1.0.944", | ||
| "version": "1.0.945", | ||
| "description": "Commonly shared code within Mintlify", | ||
@@ -132,3 +132,3 @@ "main": "./dist/index.js", | ||
| }, | ||
| "gitHead": "06f6507cd8d0cb02493bbb5af1f6170362225957" | ||
| "gitHead": "6f27255508c0ac68b356b53bfd5b009ac83cf7d3" | ||
| } |
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
790214
0.04%11577
0.05%