@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webpod/ps",
3
- "version": "0.0.0-beta.2",
3
+ "version": "0.0.0-beta.3",
4
4
  "description": "A process lookup utility",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -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(yield lookup(), pid, recursive);
146
+ const list = pickTree(all, pid, recursive);
144
147
  cb(null, list);
145
148
  return list;
146
149
  } catch (err) {
@@ -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: string | number | import("./ps.js").TPsTreeOpts, cb?: import("./ps.js").TPsLookupCallback) => Promise<import("./ps.js").TPsLookupEntry[]>;
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;
@@ -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: string | number | TPsTreeOpts, cb?: TPsLookupCallback) => Promise<TPsLookupEntry[]>;
42
+ export declare const tree: (opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback) => Promise<TPsLookupEntry[]>;
43
43
  /**
44
44
  * Kill process
45
45
  * @param pid
@@ -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(await lookup(), pid, recursive);
87
+ const list = pickTree(all, pid, recursive);
85
88
  cb(null, list);
86
89
  return list;
87
90
  } catch (err) {