Skip to content

Commit

Permalink
fix: fix find-process
Browse files Browse the repository at this point in the history
  • Loading branch information
yibn2008 committed Sep 21, 2021
1 parent 2e18620 commit 5ec7c30
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2,906 deletions.
7 changes: 1 addition & 6 deletions lib/find.js
Expand Up @@ -57,12 +57,7 @@ function find (by, value, strict) {
if (!(by in findBy)) {
reject(new Error(`do not support find by "${by}"`))
} else {
if (by === 'pid' && typeof value !== 'number')
reject(new Error(`pid must be a number`))
else if (by === 'port' && typeof value !== 'number')
reject(new Error(`port must be a number`))
else
findBy[by](value, strict).then(resolve, reject)
if (by === 'pid' && typeof value !== 'number') { reject(new Error('pid must be a number')) } else if (by === 'port' && typeof value !== 'number') { reject(new Error('port must be a number')) } else { findBy[by](value, strict).then(resolve, reject) }
}
})
}
Expand Down

0 comments on commit 5ec7c30

Please sign in to comment.