@mintlify/prebuild 1.0.1241 → 1.0.1243

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.
@@ -1,3 +1,4 @@
1
+ import { isSdkFrontmatterValue } from '@mintlify/common';
1
2
  import { type DecoratedNavigationPage, type ResolvedSdkTarget, type SdkTarget } from '@mintlify/models';
2
3
  import { type SdkFormat, type SdkReference } from '@mintlify/scraping';
3
4
  import type { DocsConfig } from '@mintlify/validation';
@@ -46,7 +47,7 @@ export declare function composeSdkFrontmatterPage(args: {
46
47
  loadReference: SdkReferenceLoader;
47
48
  inherited?: SdkConfig;
48
49
  }): Promise<GeneratedSdkPage | undefined>;
49
- export declare function isSdkFrontmatterValue(value: unknown): boolean;
50
+ export { isSdkFrontmatterValue };
50
51
  export declare function readContainedMarkdown(contentRoot: string, slug: string): Promise<{
51
52
  content: string;
52
53
  extension: '.mdx' | '.md';
@@ -1,5 +1,4 @@
1
- import { parseFrontmatter, parseSdkTargetFromMetadata, potentiallyParseSdkString, } from '@mintlify/common';
2
- import { SDK_FORMATS, SDK_SYMBOL_KINDS, } from '@mintlify/models';
1
+ import { isSdkFrontmatterValue, parseFrontmatter, parseSdkTargetFromMetadata, } from '@mintlify/common';
3
2
  import { generateSdkReference, renderSdkTarget, } from '@mintlify/scraping';
4
3
  import { Unzip, UnzipInflate } from 'fflate';
5
4
  import fse from 'fs-extra';
@@ -296,43 +295,7 @@ function stripFrontmatter(content) {
296
295
  return content;
297
296
  return content.slice(end + 4).replace(/^\n+/, '');
298
297
  }
299
- function isSdkSymbolKind(value) {
300
- for (const kind of SDK_SYMBOL_KINDS) {
301
- if (kind === value)
302
- return true;
303
- }
304
- return false;
305
- }
306
- function isSdkFormatName(value) {
307
- for (const format of SDK_FORMATS) {
308
- if (format === value)
309
- return true;
310
- }
311
- return false;
312
- }
313
- export function isSdkFrontmatterValue(value) {
314
- if (typeof value === 'string')
315
- return potentiallyParseSdkString(value) !== undefined;
316
- if (typeof value !== 'object' || value === null || Array.isArray(value))
317
- return false;
318
- if (!('kind' in value) || !('name' in value))
319
- return false;
320
- if (typeof value.kind !== 'string' || !isSdkSymbolKind(value.kind))
321
- return false;
322
- if (typeof value.name !== 'string' || value.name.length === 0)
323
- return false;
324
- if ('format' in value &&
325
- value.format !== undefined &&
326
- (typeof value.format !== 'string' || !isSdkFormatName(value.format))) {
327
- return false;
328
- }
329
- if ('source' in value &&
330
- value.source !== undefined &&
331
- (typeof value.source !== 'string' || value.source.length === 0)) {
332
- return false;
333
- }
334
- return true;
335
- }
298
+ export { isSdkFrontmatterValue };
336
299
  export async function readContainedMarkdown(contentRoot, slug) {
337
300
  for (const extension of ['.mdx', '.md']) {
338
301
  const filePath = path.resolve(contentRoot, `${slug}${extension}`);