(path: string)
| 345 | // retrieve and parse an index file |
| 346 | // (either list of all packages, or documentation entries of a package) |
| 347 | private async getParsedIndexFile(path: string): Promise<IndexEntry[]|undefined> { |
| 348 | |
| 349 | let indexItems = this.getCachedIndexFile(path); |
| 350 | |
| 351 | // only read and parse file if not cached yet |
| 352 | if(!indexItems){ |
| 353 | const helpFile = await this.rHelp.getHelpFileForPath(path, false); |
| 354 | if(!helpFile?.html){ |
| 355 | // set missing files to null |
| 356 | indexItems = undefined; |
| 357 | } else{ |
| 358 | // parse and cache file |
| 359 | indexItems = parseIndexFile(helpFile.html); |
| 360 | } |
| 361 | void this.updateCachedIndexFile(path, indexItems); |
| 362 | } |
| 363 | |
| 364 | // return cache entry. make new array to avoid messing with the cache |
| 365 | let ret: IndexEntry[] | undefined = undefined; |
| 366 | if(indexItems){ |
| 367 | ret = []; |
| 368 | ret.push(...indexItems); |
| 369 | } |
| 370 | return ret; |
| 371 | } |
| 372 | } |
| 373 | |
| 374 |
no test coverage detected