File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
src/browser-installer/ubuntu-packages Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 1+ import _ from "lodash" ;
12import os from "os" ;
23import path from "path" ;
34import fs from "fs-extra" ;
@@ -35,11 +36,9 @@ const resolveTransitiveDependencies = async (directDependencies: string[]): Prom
3536
3637 const fullDependencies = await Promise . all ( directDependencies . map ( listDependencies ) ) ;
3738
38- const dependenciesSet = new Set < string > ( ) ;
39+ const rawDependencies = _ . flatten ( fullDependencies ) ;
3940
40- fullDependencies . forEach ( depsArray => depsArray . forEach ( dependency => dependenciesSet . add ( dependency ) ) ) ;
41-
42- return Array . from ( dependenciesSet ) ;
41+ return _ . uniq ( rawDependencies ) ;
4342} ;
4443
4544/** @link https://manpages.org/apt/8 */
@@ -73,11 +72,7 @@ const filterNotExistingDependencies = async (dependencies: string[]): Promise<st
7372 } ) ;
7473 } ) ;
7574
76- const dependenciesSet = new Set ( dependencies ) ;
77-
78- existingDependencies . forEach ( existingDependency => dependenciesSet . delete ( existingDependency ) ) ;
79-
80- return Array . from ( dependenciesSet ) ;
75+ return _ . difference ( dependencies , existingDependencies ) ;
8176} ;
8277
8378/** @link https://manpages.org/apt-get/8 */
You can’t perform that action at this time.
0 commit comments