(context, type, items, depth = 2, markdownHeading = '')
| 58 | } |
| 59 | |
| 60 | export async function getMiniToc(context, type, items, depth = 2, markdownHeading = '') { |
| 61 | const { currentLanguage, currentVersion } = context |
| 62 | const graphqlVersion = getGraphqlVersion(currentVersion) |
| 63 | if (!miniTocs.get(currentLanguage).has(graphqlVersion)) { |
| 64 | miniTocs.get(currentLanguage).set(graphqlVersion, new Map()) |
| 65 | } |
| 66 | if (!miniTocs.get(currentLanguage).get(graphqlVersion).has(type)) { |
| 67 | const graphqlMiniTocItems = await getAutomatedPageMiniTocItems( |
| 68 | items, |
| 69 | context, |
| 70 | depth, |
| 71 | markdownHeading |
| 72 | ) |
| 73 | miniTocs.get(currentLanguage).get(graphqlVersion).set(type, graphqlMiniTocItems) |
| 74 | } |
| 75 | return miniTocs.get(currentLanguage).get(graphqlVersion).get(type) |
| 76 | } |
| 77 | |
| 78 | export async function getChangelogMiniTocs(items, context, depth = 2, markdownHeading = '') { |
| 79 | if (!changelog.has('toc')) { |
no test coverage detected