@mintlify/prebuild 1.0.850 → 1.0.852

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.
@@ -66,7 +66,9 @@ export const generateAsyncApiFromDocsConfig = async (navigation, asyncApiFiles,
66
66
  ...divisionNav.nav,
67
67
  ...(divisionNav.division === 'group'
68
68
  ? {
69
- pages: 'pages' in nav ? [...nav.pages, ...allGeneratedNav] : allGeneratedNav,
69
+ pages: 'pages' in nav && Array.isArray(nav.pages)
70
+ ? [...nav.pages, ...allGeneratedNav]
71
+ : allGeneratedNav,
70
72
  }
71
73
  : {
72
74
  groups: 'groups' in nav ? [...nav.groups, ...allGeneratedNav] : allGeneratedNav,
@@ -64,7 +64,7 @@ export const generateOpenApiFromDocsConfig = async (navigation, openApiFiles, pa
64
64
  ...divisionNav.nav,
65
65
  ...(divisionNav.division === 'group'
66
66
  ? {
67
- pages: 'pages' in nav
67
+ pages: 'pages' in nav && Array.isArray(nav.pages)
68
68
  ? [...nav.pages, ...navFromGeneratedOpenApiPages]
69
69
  : navFromGeneratedOpenApiPages,
70
70
  }
@@ -114,7 +114,8 @@ export const generateOpenApiFromDocsConfig = async (navigation, openApiFiles, pa
114
114
  const currentOpenApiOwner = extracted.source ? nodeId : openApiOwner;
115
115
  let newNav = nav;
116
116
  if ('pages' in newNav) {
117
- newNav.pages = await Promise.all(newNav.pages.map(async (page) => {
117
+ const processedPages = await Promise.all(newNav.pages.map(async (page) => {
118
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
118
119
  if (typeof page === 'object' && page !== null && 'group' in page) {
119
120
  return processNav(page, currentOpenApi, currentDirectory, currentOpenApiOwner);
120
121
  }
@@ -213,6 +214,8 @@ export const generateOpenApiFromDocsConfig = async (navigation, openApiFiles, pa
213
214
  }
214
215
  return page;
215
216
  }));
217
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
218
+ newNav.pages = processedPages;
216
219
  }
217
220
  for (const division of ['groups', ...divisions]) {
218
221
  if (division in newNav) {
@@ -237,12 +240,15 @@ export const generateOpenApiFromDocsConfig = async (navigation, openApiFiles, pa
237
240
  updated = processed;
238
241
  }
239
242
  if ('pages' in updated) {
240
- updated.pages = await Promise.all(updated.pages.map(async (p) => {
243
+ const updatedPages = await Promise.all(updated.pages.map(async (p) => {
244
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
241
245
  if (typeof p === 'object' && p !== null && 'group' in p) {
242
246
  return generateBulkNav(p);
243
247
  }
244
248
  return p;
245
249
  }));
250
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
251
+ updated.pages = updatedPages;
246
252
  }
247
253
  for (const division of ['groups', ...divisions]) {
248
254
  if (division in updated) {