File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,16 @@ import type {
1111 SpawnOptions ,
1212} from '@socketsecurity/registry/lib/spawn'
1313
14+ export function extractTier1ReachabilityScanId (
15+ socketFactsFile : string ,
16+ ) : string | undefined {
17+ const json = readJsonSync ( socketFactsFile , { throws : false } )
18+ const tier1ReachabilityScanId = String ( json ?. [ 'tier1ReachabilityScanId' ] ?? '' ) . trim ( )
19+ return tier1ReachabilityScanId . length > 0
20+ ? tier1ReachabilityScanId
21+ : undefined
22+ }
23+
1424export async function spawnCoana (
1525 args : string [ ] | readonly string [ ] ,
1626 options ?: SpawnOptions | undefined ,
@@ -60,14 +70,3 @@ export async function spawnCoana(
6070 return { ok : false , data : e , message }
6171 }
6272}
63-
64- export function extractTier1ReachabilityScanId (
65- socketFactsFile : string ,
66- ) : string | undefined {
67- const json = readJsonSync ( socketFactsFile , { throws : false } )
68- const tier1ReachabilityScanId = json ?. [ 'tier1ReachabilityScanId' ]
69- return typeof tier1ReachabilityScanId === 'string' &&
70- tier1ReachabilityScanId . length > 0
71- ? tier1ReachabilityScanId
72- : undefined
73- }
You can’t perform that action at this time.
0 commit comments