()
| 422 | } |
| 423 | |
| 424 | async makeChildren() { |
| 425 | let packages = await this.wrapper.rHelp.packageManager.getPackages(false); |
| 426 | |
| 427 | if(!packages){ |
| 428 | return []; |
| 429 | } |
| 430 | |
| 431 | if(this.filterText){ |
| 432 | const re = new RegExp(this.filterText); |
| 433 | packages = packages.filter(pkg => re.exec(pkg.name)); |
| 434 | } |
| 435 | |
| 436 | // favorites at the top |
| 437 | const children = packages.filter(pkg => pkg.isFavorite); |
| 438 | |
| 439 | // nonFavorites below (if shown) |
| 440 | if(!this.showOnlyFavorites){ |
| 441 | children.push(...packages.filter(pkg => !pkg.isFavorite)); |
| 442 | } |
| 443 | |
| 444 | // make packageNode for each child |
| 445 | return children.map( |
| 446 | pkg => new PackageNode(this, pkg) |
| 447 | ); |
| 448 | } |
| 449 | } |
| 450 | |
| 451 |
nothing calls this directly
no test coverage detected