File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -112,11 +112,15 @@ export const extractWmic = (stdout: string): string => {
112
112
* @param next
113
113
*/
114
114
// eslint-disable-next-line sonarjs/cognitive-complexity
115
- export const kill = ( pid : string | number , opts ?: TPsNext | TPsKillOptions , next ?: TPsNext ) => {
115
+ export const kill = ( pid : string | number , opts ?: TPsNext | TPsKillOptions | TPsKillOptions [ 'signal' ] , next ?: TPsNext ) => {
116
116
if ( typeof opts == 'function' ) {
117
117
kill ( pid , undefined , opts )
118
118
return
119
119
}
120
+ if ( typeof opts == 'string' || typeof opts == 'number' ) {
121
+ kill ( pid , { signal : opts } , next )
122
+ return
123
+ }
120
124
const {
121
125
timeout = 30 ,
122
126
signal = 'SIGTERM'
@@ -192,3 +196,5 @@ export const formatOutput = (data: TIngridResponse): TPsLookupEntry[] =>
192
196
193
197
return m
194
198
} , [ ] )
199
+
200
+ export default { lookup, kill }
You can’t perform that action at this time.
0 commit comments