@fern-api/fdr-sdk 1.2.51-403b2eae4f → 1.2.51-c32b5f74fd
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.
- package/dist/js/navigation/ledger-root-builder.js +2 -22
- package/dist/js/navigation/ledger-root-builder.js.map +1 -1
- package/dist/js/navigation/ledger-root-builder.mjs +2 -22
- package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
- package/dist/navigation/__test__/ledger-canonical-bugs.repro.test.js +12 -399
- package/dist/navigation/__test__/ledger-canonical-bugs.repro.test.js.map +1 -1
- package/dist/navigation/ledger-root-builder.js +10 -52
- package/dist/navigation/ledger-root-builder.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -2449,27 +2449,8 @@ function buildLandingPage(ctx, scopeSegs) {
|
|
|
2449
2449
|
landingSegment?.nav.find((route) => route.type === "markdown")
|
|
2450
2450
|
);
|
|
2451
2451
|
}
|
|
2452
|
-
function buildSlugOwnerContentKeys(roots) {
|
|
2453
|
-
const slugOwnerKeys = /* @__PURE__ */ new Map();
|
|
2454
|
-
for (const root of roots) {
|
|
2455
|
-
traverseDF(root, (child, parents) => {
|
|
2456
|
-
if (hasMetadata(child) && isPage(child) && !slugOwnerKeys.has(child.slug)) {
|
|
2457
|
-
slugOwnerKeys.set(child.slug, new Set(crossVersionDedupKeys(child, parents)));
|
|
2458
|
-
}
|
|
2459
|
-
});
|
|
2460
|
-
}
|
|
2461
|
-
return slugOwnerKeys;
|
|
2462
|
-
}
|
|
2463
|
-
function canonicalOwnerSharesContent(slugOwnerKeys, canonical, keys) {
|
|
2464
|
-
const ownerKeys = slugOwnerKeys.get(canonical);
|
|
2465
|
-
if (ownerKeys == null) {
|
|
2466
|
-
return false;
|
|
2467
|
-
}
|
|
2468
|
-
return keys.some((key) => key.startsWith("pid:") && ownerKeys.has(key));
|
|
2469
|
-
}
|
|
2470
2452
|
function markWithinScopeCanonicalSlugs(scopeNode) {
|
|
2471
2453
|
const keyToCanonical = /* @__PURE__ */ new Map();
|
|
2472
|
-
const slugOwnerKeys = buildSlugOwnerContentKeys([scopeNode]);
|
|
2473
2454
|
traverseDF(scopeNode, (child, parents) => {
|
|
2474
2455
|
if (hasMetadata(child) && isPage(child)) {
|
|
2475
2456
|
const keys = crossVersionDedupKeys(child, parents);
|
|
@@ -2477,7 +2458,7 @@ function markWithinScopeCanonicalSlugs(scopeNode) {
|
|
|
2477
2458
|
for (const key of keys) {
|
|
2478
2459
|
const canonical = keyToCanonical.get(key);
|
|
2479
2460
|
if (canonical != null && canonical !== child.slug) {
|
|
2480
|
-
if (child.slug.startsWith(canonical + "/") && getChildren(child).length > 0
|
|
2461
|
+
if (child.slug.startsWith(canonical + "/") && getChildren(child).length > 0) {
|
|
2481
2462
|
continue;
|
|
2482
2463
|
}
|
|
2483
2464
|
child.canonicalSlug = canonical;
|
|
@@ -2504,7 +2485,6 @@ function markCrossVersionCanonicalSlugs(versionNodes) {
|
|
|
2504
2485
|
}
|
|
2505
2486
|
return 0;
|
|
2506
2487
|
});
|
|
2507
|
-
const slugOwnerKeys = buildSlugOwnerContentKeys(sorted);
|
|
2508
2488
|
for (const version of sorted) {
|
|
2509
2489
|
traverseDF(version, (child, parents) => {
|
|
2510
2490
|
if (hasMetadata(child) && isPage(child)) {
|
|
@@ -2513,7 +2493,7 @@ function markCrossVersionCanonicalSlugs(versionNodes) {
|
|
|
2513
2493
|
for (const key of keys) {
|
|
2514
2494
|
const canonical = keyToCanonical.get(key);
|
|
2515
2495
|
if (canonical != null && !version.default) {
|
|
2516
|
-
if (child.slug.startsWith(canonical + "/") && getChildren(child).length > 0
|
|
2496
|
+
if (child.slug.startsWith(canonical + "/") && getChildren(child).length > 0) {
|
|
2517
2497
|
continue;
|
|
2518
2498
|
}
|
|
2519
2499
|
child.canonicalSlug = canonical;
|