@mintlify/common 1.0.974 → 1.0.975
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,6 +7,15 @@ function getStringProperty(obj, key) {
|
|
|
7
7
|
const value = Reflect.get(obj, key);
|
|
8
8
|
return typeof value === 'string' ? value : '';
|
|
9
9
|
}
|
|
10
|
+
function getDivisionTitle(item, key) {
|
|
11
|
+
if (key === 'groups') {
|
|
12
|
+
return getStringProperty(item, 'group');
|
|
13
|
+
}
|
|
14
|
+
if (key === 'products') {
|
|
15
|
+
return getStringProperty(item, 'name') || getStringProperty(item, 'product');
|
|
16
|
+
}
|
|
17
|
+
return getStringProperty(item, divisionPropertyNameMap[key]);
|
|
18
|
+
}
|
|
10
19
|
const MAX_RECURSION_DEPTH = 100;
|
|
11
20
|
export function generatePathToBreadcrumbsMapForDocsConfig(navigation) {
|
|
12
21
|
const pathToBreadcrumbs = new Map();
|
|
@@ -23,12 +32,9 @@ function generatePathToBreadcrumbsMapForDocsConfigRecursive(nav, map, currentBre
|
|
|
23
32
|
if (!Array.isArray(items)) {
|
|
24
33
|
continue;
|
|
25
34
|
}
|
|
26
|
-
const propertyName = key === 'groups' ? 'group' : divisionPropertyNameMap[key];
|
|
27
35
|
const includeDivisionInBreadcrumbs = key === 'groups' || !excludedBreadcrumbDivisions.has(key);
|
|
28
36
|
for (const item of items) {
|
|
29
|
-
const divisionTitle = includeDivisionInBreadcrumbs
|
|
30
|
-
? getStringProperty(item, propertyName)
|
|
31
|
-
: '';
|
|
37
|
+
const divisionTitle = includeDivisionInBreadcrumbs ? getDivisionTitle(item, key) : '';
|
|
32
38
|
const newBreadcrumbs = divisionTitle
|
|
33
39
|
? [...currentBreadcrumbs, divisionTitle]
|
|
34
40
|
: currentBreadcrumbs;
|