@webpod/ps 0.0.0-beta.2 → 0.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/target/cjs/index.cjs +4 -1
- package/target/dts/index.d.ts +1 -1
- package/target/dts/ps.d.ts +1 -1
- package/target/esm/index.mjs +4 -1
package/package.json
CHANGED
package/target/cjs/index.cjs
CHANGED
|
@@ -139,8 +139,11 @@ var tree = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (opts, cb = noo
|
|
|
139
139
|
return tree({ pid: opts }, cb);
|
|
140
140
|
}
|
|
141
141
|
try {
|
|
142
|
+
const all = yield lookup();
|
|
143
|
+
if (opts === void 0)
|
|
144
|
+
return all;
|
|
142
145
|
const { pid, recursive = false } = opts;
|
|
143
|
-
const list = pickTree(
|
|
146
|
+
const list = pickTree(all, pid, recursive);
|
|
144
147
|
cb(null, list);
|
|
145
148
|
return list;
|
|
146
149
|
} catch (err) {
|
package/target/dts/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export { kill, lookup, tree } from './ps.js';
|
|
|
3
3
|
declare const _default: {
|
|
4
4
|
lookup: (query?: import("./ps.js").TPsLookupQuery, cb?: import("./ps.js").TPsLookupCallback) => Promise<import("./ps.js").TPsLookupEntry[]>;
|
|
5
5
|
kill: (pid: string | number, opts?: string | number | import("./ps.js").TPsKillOptions | import("./ps.js").TPsNext | undefined, next?: import("./ps.js").TPsNext | undefined) => Promise<void>;
|
|
6
|
-
tree: (opts
|
|
6
|
+
tree: (opts?: string | number | import("./ps.js").TPsTreeOpts | undefined, cb?: import("./ps.js").TPsLookupCallback) => Promise<import("./ps.js").TPsLookupEntry[]>;
|
|
7
7
|
};
|
|
8
8
|
export default _default;
|
package/target/dts/ps.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type TPsTreeOpts = {
|
|
|
39
39
|
recursive?: boolean;
|
|
40
40
|
};
|
|
41
41
|
export declare const pickTree: (list: TPsLookupEntry[], pid: string | number, recursive?: boolean) => TPsLookupEntry[];
|
|
42
|
-
export declare const tree: (opts
|
|
42
|
+
export declare const tree: (opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback) => Promise<TPsLookupEntry[]>;
|
|
43
43
|
/**
|
|
44
44
|
* Kill process
|
|
45
45
|
* @param pid
|
package/target/esm/index.mjs
CHANGED
|
@@ -80,8 +80,11 @@ var tree = async (opts, cb = noop) => {
|
|
|
80
80
|
return tree({ pid: opts }, cb);
|
|
81
81
|
}
|
|
82
82
|
try {
|
|
83
|
+
const all = await lookup();
|
|
84
|
+
if (opts === void 0)
|
|
85
|
+
return all;
|
|
83
86
|
const { pid, recursive = false } = opts;
|
|
84
|
-
const list = pickTree(
|
|
87
|
+
const list = pickTree(all, pid, recursive);
|
|
85
88
|
cb(null, list);
|
|
86
89
|
return list;
|
|
87
90
|
} catch (err) {
|