File tree Expand file tree Collapse file tree 3 files changed +11
-16
lines changed Expand file tree Collapse file tree 3 files changed +11
-16
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @nodesecure/scanner " : minor
3
+ ---
4
+ refactor(scanner): remove useless try finally surrounding extractAndResolve in verify
Original file line number Diff line number Diff line change 1
1
// Import Node.js Dependencies
2
2
import path from "node:path" ;
3
3
import { readFileSync } from "node:fs" ;
4
- import timers from "node:timers/promises" ;
5
4
6
5
// Import Third-party Dependencies
7
6
import { Mutex , MutexRelease } from "@openally/mutex" ;
@@ -192,7 +191,6 @@ export async function depWalker(
192
191
193
192
logger . end ( ScannerLoggerEvents . analysis . tree ) ;
194
193
await Promise . allSettled ( operationsQueue ) ;
195
- await timers . setImmediate ( ) ;
196
194
197
195
logger
198
196
. end ( ScannerLoggerEvents . analysis . tarball )
@@ -283,8 +281,6 @@ export async function depWalker(
283
281
return payload as Payload ;
284
282
}
285
283
finally {
286
- await timers . setImmediate ( ) ;
287
-
288
284
logger . emit ( ScannerLoggerEvents . done ) ;
289
285
}
290
286
}
Original file line number Diff line number Diff line change 1
1
// Import Node.js Dependencies
2
2
import path from "node:path" ;
3
3
import fs from "node:fs/promises" ;
4
- import timers from "node:timers/promises" ;
5
4
import os from "node:os" ;
6
5
7
6
// Import Third-party Dependencies
@@ -90,18 +89,14 @@ export async function verify(
90
89
91
90
await using tempDir = await TempDirectory . create ( ) ;
92
91
93
- try {
94
- const mama = await tarball . extractAndResolve ( tempDir . location , {
95
- spec : packageName ,
96
- registry : getLocalRegistryURL ( )
97
- } ) ;
98
- const scanResult = await tarball . scanPackage ( mama ) ;
92
+ const mama = await tarball . extractAndResolve ( tempDir . location , {
93
+ spec : packageName ,
94
+ registry : getLocalRegistryURL ( )
95
+ } ) ;
99
96
100
- return scanResult ;
101
- }
102
- finally {
103
- await timers . setImmediate ( ) ;
104
- }
97
+ const scanResult = await tarball . scanPackage ( mama ) ;
98
+
99
+ return scanResult ;
105
100
}
106
101
107
102
export {
You can’t perform that action at this time.
0 commit comments