@mintlify/prebuild 1.0.1340 → 1.0.1341

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.
@@ -314,7 +314,6 @@ export async function readContainedMarkdown(contentRoot, slug, pageScans) {
314
314
  path.isAbsolute(realRelative)) {
315
315
  continue;
316
316
  }
317
- // Reuse cached headers only after validating the file's real path containment.
318
317
  const frontmatter = pageScans?.get(`/${toPosixPath(relativePath)}`)?.frontmatter;
319
318
  return { content: frontmatter ?? (await fse.readFile(realFilePath, 'utf8')), extension };
320
319
  }
@@ -1,10 +1,7 @@
1
- import { parseFrontmatter } from '@mintlify/common';
1
+ import { isObject, parseFrontmatter } from '@mintlify/common';
2
2
  import fse from 'fs-extra';
3
3
  import { readContainedMarkdown } from '../docsConfig/generateSdkDivisions.js';
4
4
  const SDK_SCAN_CONCURRENCY = 16;
5
- function isPlainObject(value) {
6
- return typeof value === 'object' && value !== null && !Array.isArray(value);
7
- }
8
5
  function collectNavigationPageSlugs(value, slugs = new Set()) {
9
6
  if (typeof value === 'string') {
10
7
  slugs.add(value.replace(/^\//, '').replace(/\.mdx?$/, ''));
@@ -14,7 +11,7 @@ function collectNavigationPageSlugs(value, slugs = new Set()) {
14
11
  value.forEach((entry) => collectNavigationPageSlugs(entry, slugs));
15
12
  return slugs;
16
13
  }
17
- if (!isPlainObject(value))
14
+ if (!isObject(value))
18
15
  return slugs;
19
16
  if ('root' in value)
20
17
  collectNavigationPageSlugs(value.root, slugs);
@@ -32,7 +29,6 @@ export async function scanSdkFrontmatterMetadata(contentDirectoryPath, navigatio
32
29
  const contentRoot = await fse.realpath(contentDirectoryPath);
33
30
  const metadataBySlug = {};
34
31
  const slugs = collectNavigationPageSlugs(navigation);
35
- // Workers share an iterator so large navigation trees don't enqueue every file at once.
36
32
  const queue = slugs.values();
37
33
  await Promise.all(Array.from({ length: Math.min(SDK_SCAN_CONCURRENCY, slugs.size) }, async () => {
38
34
  for (const slug of queue) {