@tapjs/processinfo
Advanced tools
Comparing version 2.3.0 to 2.4.0
@@ -40,3 +40,3 @@ import { exec, execFile, execFileSync, execSync, fork, spawn, spawnSync } from './child_process.js'; | ||
*/ | ||
externalIDsChanged(): Promise<Map<string, ProcessInfoNode>>; | ||
externalIDsChanged(filter?: (p: string, node: ProcessInfoNode) => boolean): Promise<Map<string, ProcessInfoNode>>; | ||
static get Node(): typeof ProcessInfoNode; | ||
@@ -43,0 +43,0 @@ static get ProcessInfo(): typeof ProcessInfo; |
@@ -184,7 +184,9 @@ "use strict"; | ||
*/ | ||
async externalIDsChanged() { | ||
async externalIDsChanged(filter = () => true) { | ||
const changed = new Map(); | ||
const promises = []; | ||
const stats = new Map(); | ||
for (const node of this.externalIDs.values()) { | ||
for (const [id, node] of this.externalIDs.entries()) { | ||
if (!filter(id, node)) | ||
continue; | ||
promises.push(...this.#statFiles(node, stats)); | ||
@@ -195,3 +197,3 @@ } | ||
for (const [id, node] of this.externalIDs.entries()) { | ||
if (this.#hasNewerFiles(node, stats)) { | ||
if (filter(id, node) && this.#hasNewerFiles(node, stats)) { | ||
changed.set(id, node); | ||
@@ -198,0 +200,0 @@ } |
@@ -40,3 +40,3 @@ import { exec, execFile, execFileSync, execSync, fork, spawn, spawnSync } from './child_process.js'; | ||
*/ | ||
externalIDsChanged(): Promise<Map<string, ProcessInfoNode>>; | ||
externalIDsChanged(filter?: (p: string, node: ProcessInfoNode) => boolean): Promise<Map<string, ProcessInfoNode>>; | ||
static get Node(): typeof ProcessInfoNode; | ||
@@ -43,0 +43,0 @@ static get ProcessInfo(): typeof ProcessInfo; |
@@ -167,7 +167,9 @@ import { exec, execFile, execFileSync, execSync, fork, spawn, spawnSync, } from './child_process.js'; | ||
*/ | ||
async externalIDsChanged() { | ||
async externalIDsChanged(filter = () => true) { | ||
const changed = new Map(); | ||
const promises = []; | ||
const stats = new Map(); | ||
for (const node of this.externalIDs.values()) { | ||
for (const [id, node] of this.externalIDs.entries()) { | ||
if (!filter(id, node)) | ||
continue; | ||
promises.push(...this.#statFiles(node, stats)); | ||
@@ -178,3 +180,3 @@ } | ||
for (const [id, node] of this.externalIDs.entries()) { | ||
if (this.#hasNewerFiles(node, stats)) { | ||
if (filter(id, node) && this.#hasNewerFiles(node, stats)) { | ||
changed.set(id, node); | ||
@@ -181,0 +183,0 @@ } |
{ | ||
"name": "@tapjs/processinfo", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"main": "./dist/cjs/index.js", | ||
@@ -5,0 +5,0 @@ "types": "./dist/cjs/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
339337
2676