@@ -6,7 +6,7 @@ import { ManagerReport, PackageVersion } from '../types/Package.js';
66import { RegistryInterface , RegistryPackages , RegistryType } from '../types/Registry.js' ;
77import { Base } from './Base.js' ;
88import { packageCompatibleFiles } from '../helpers/package.js' ;
9- import { getArchitecture , getSystem } from '../helpers/utilsLocal .js' ;
9+ import { Architecture , SystemType } from '../index-browser .js' ;
1010
1111export class Manager extends Base {
1212 protected config : Config ;
@@ -64,7 +64,7 @@ export class Manager extends Base {
6464 }
6565 }
6666
67- listPackages ( installed ?: boolean , showAll = false ) {
67+ listPackages ( installed ?: boolean , architecture ?: Architecture , system ?: SystemType ) {
6868 let packages = Array . from ( this . packages . values ( ) ) ;
6969
7070 if ( installed !== undefined ) {
@@ -75,11 +75,13 @@ export class Manager extends Base {
7575 ) ;
7676 }
7777
78- if ( ! showAll ) {
78+ if ( architecture || system ) {
7979 packages = packages . filter ( pkg => {
8080 const pkgVersion = pkg . getVersionLatest ( ) ;
8181 if ( ! pkgVersion ) return false ;
82- const files = packageCompatibleFiles ( pkgVersion , [ getArchitecture ( ) ] , [ getSystem ( ) ] , [ ] ) ;
82+ const archArr = architecture ? [ architecture ] : [ ] ;
83+ const sysArr = system ? [ system ] : [ ] ;
84+ const files = packageCompatibleFiles ( pkgVersion , archArr , sysArr , [ ] ) ;
8385 return files . length > 0 ;
8486 } ) ;
8587 }
0 commit comments