mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
refactor: get system process map
This commit is contained in:
parent
fee1a92715
commit
1ffb9828f7
1 changed files with 4 additions and 2 deletions
|
@ -88,11 +88,13 @@ const getSystemProcessMap = async () => {
|
||||||
const map = new Map<string, Set<string>>();
|
const map = new Map<string, Set<string>>();
|
||||||
|
|
||||||
processes.forEach((process) => {
|
processes.forEach((process) => {
|
||||||
const [key, value] = [process.name?.toLowerCase(), process.exe];
|
const key = process.name.toLowerCase();
|
||||||
|
const value = process.exe;
|
||||||
|
|
||||||
if (!key || !value) return;
|
if (!key || !value) return;
|
||||||
|
|
||||||
map.set(key, (map.get(key) ?? new Set()).add(value));
|
const currentSet = map.get(key) ?? new Set();
|
||||||
|
map.set(key, currentSet.add(value));
|
||||||
});
|
});
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue