MCPcopy Create free account
hub / github.com/TanStack/query / findPropertiesTable

Function findPropertiesTable

scripts/generate-docs.ts:430–451  ·  view source on GitHub ↗
(
  outputDir: string,
  typeLines: Array<string>,
)

Source from the content-addressed store, hash-verified

428
429// The property table for the first type line that has one.
430async function findPropertiesTable(
431 outputDir: string,
432 typeLines: Array<string>,
433) {
434 for (const typeLine of typeLines) {
435 const link = await linkedTypePage(outputDir, typeLine)
436 const from = link && (await propertiesPage(outputDir, link))
437 const table = from && (await readPropertiesTable(outputDir, from))
438 if (table) {
439 return table
440 }
441 }
442 const bases = await findBasePages(outputDir, typeLines)
443 if (bases.length) {
444 return `Built from ${bases
445 .map(
446 (base) => `[\`${base.split('/').at(-1)}\`](../${base}.md#properties)`,
447 )
448 .join(', ')}. See the type above for what it changes.`
449 }
450 return undefined
451}
452
453// Splits a type expression at a top-level separator, outside `<>`, `()`, `{}`, and `[]`.
454function splitTopLevel(type: string, separator: string) {

Callers 1

addReferenceDetailsFunction · 0.85

Calls 4

linkedTypePageFunction · 0.85
propertiesPageFunction · 0.85
readPropertiesTableFunction · 0.85
findBasePagesFunction · 0.85

Tested by

no test coverage detected