From 6346556c3b37b8a85aaf130e47a48f01009a027f Mon Sep 17 00:00:00 2001 From: Chris Gibb Date: Fri, 1 Sep 2017 10:45:35 -0400 Subject: [PATCH] split up module --- src/req/PIDInfo.ts | 11 +++++++++++ src/req/{pidInfo.ts => getPIDInfo.ts} | 19 +++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 src/req/PIDInfo.ts rename src/req/{pidInfo.ts => getPIDInfo.ts} (72%) diff --git a/src/req/PIDInfo.ts b/src/req/PIDInfo.ts new file mode 100644 index 000000000..e44d1e9d1 --- /dev/null +++ b/src/req/PIDInfo.ts @@ -0,0 +1,11 @@ +export interface PIDInfo +{ + pid : number; + ppid : number; + command : string; + arguments : Array; + isPHAT : boolean; + isPHATRenderer : boolean; + isPHATMain : boolean; + url : string; +} \ No newline at end of file diff --git a/src/req/pidInfo.ts b/src/req/getPIDInfo.ts similarity index 72% rename from src/req/pidInfo.ts rename to src/req/getPIDInfo.ts index 4b764f20f..89f6c70f9 100644 --- a/src/req/pidInfo.ts +++ b/src/req/getPIDInfo.ts @@ -1,18 +1,11 @@ import * as electron from "electron"; -const BrowserWindow = electron.remote.BrowserView; +const BrowserWindow = electron.remote.BrowserWindow; const psNode = require("ps-node"); -export interface PIDInfo -{ - pid : number; - ppid : number; - command : string; - arguments : Array; - isPHAT : boolean; - url : string; -} +import {PIDInfo} from "./PIDInfo"; + export async function getPIDInfo(pid : number) : Promise> { @@ -23,12 +16,14 @@ export async function getPIDInfo(pid : number) : Promise> reject(err); for(let i = 0; i != resultList.length; ++i) { - res.push({ + let info = { pid : resultList[i].pid, ppid : resultList[i].ppid, command : resultList[i].command, arguments : resultList[i].arguments - }); + }; + + res.push(info); } resolve(res); });