File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -180,11 +180,11 @@ async function getDocsFrontMatterUncached(): Promise<FrontMatter[]> {
180180 return frontMatter ;
181181}
182182
183- export async function getDevDocsFrontMatter ( ) : Promise < FrontMatter [ ] > {
183+ export async function getDevDocsFrontMatterUncached ( ) : Promise < FrontMatter [ ] > {
184184 const folder = 'develop-docs' ;
185185 const docsPath = path . join ( root , folder ) ;
186186 const files = await getAllFilesRecursively ( docsPath ) ;
187- const fmts = (
187+ const frontMatters = (
188188 await Promise . all (
189189 files . map (
190190 limitFunction (
@@ -207,7 +207,16 @@ export async function getDevDocsFrontMatter(): Promise<FrontMatter[]> {
207207 )
208208 )
209209 ) . filter ( isNotNil ) ;
210- return fmts ;
210+ return frontMatters ;
211+ }
212+
213+ let getDevDocsFrontMatterCache : Promise < FrontMatter [ ] > | undefined ;
214+
215+ export function getDevDocsFrontMatter ( ) : Promise < FrontMatter [ ] > {
216+ if ( ! getDevDocsFrontMatterCache ) {
217+ getDevDocsFrontMatterCache = getDevDocsFrontMatterUncached ( ) ;
218+ }
219+ return getDevDocsFrontMatterCache ;
211220}
212221
213222async function getAllFilesFrontMatter ( ) : Promise < FrontMatter [ ] > {
You can’t perform that action at this time.
0 commit comments