11// https://github.com/SocketDev/socket-python-cli/blob/6d4fc56faee68d3a4764f1f80f84710635bdaf05/socketsecurity/core/__init__.py
2- // eslint-disable no-await-in-loop
3- import { SocketSdk } from '@socketsecurity/sdk'
4- import { Diff , FullScan , Issue , Package , Purl } from './classes'
5- import type { components , operations } from '@socketsecurity/sdk/types/api.d.ts'
6- import ndjson from 'ndjson'
2+ /* eslint-disable no-await-in-loop */
73import { once } from 'node:events'
84import fs from 'node:fs'
95import path from 'node:path'
106
7+ import ndjson from 'ndjson'
8+
9+ import { SocketSdk } from '@socketsecurity/sdk'
10+
11+ import { Diff , FullScan , Issue , Package , Purl } from './classes'
12+
13+ import type { components , operations } from '@socketsecurity/sdk/types/api.d.ts'
14+
1115export class Core {
1216 socket : SocketSdk
1317 owner : string
@@ -19,9 +23,9 @@ export class Core {
1923 > = { }
2024
2125 constructor ( {
22- socket,
2326 owner,
24- repo
27+ repo,
28+ socket
2529 } : Pick < Core , 'socket' | 'owner' | 'repo' | 'files' > ) {
2630 this . socket = socket
2731 this . owner = owner
@@ -81,8 +85,8 @@ export class Core {
8185 }
8286
8387 getSourceData ( {
84- pkg ,
85- packages
88+ packages ,
89+ pkg
8690 } : {
8791 pkg : Package
8892 packages : Record < string , Package >
@@ -139,9 +143,9 @@ export class Core {
139143 }
140144
141145 async createIssueAlerts ( {
142- pkg,
143146 alerts,
144- packages
147+ packages,
148+ pkg
145149 } : {
146150 pkg : Package
147151 alerts : Record < string , Issue [ ] >
@@ -210,9 +214,9 @@ export class Core {
210214 }
211215
212216 compareIssueAlerts ( {
213- newScanAlerts ,
217+ alerts ,
214218 headScanAlerts,
215- alerts
219+ newScanAlerts
216220 } : {
217221 newScanAlerts : Record < string , Issue [ ] >
218222 headScanAlerts : Record < string , Issue [ ] >
@@ -257,10 +261,10 @@ export class Core {
257261 }
258262
259263 checkAlertCapabilities ( {
260- pkg,
261264 capabilities,
265+ headPackage,
262266 packageId,
263- headPackage
267+ pkg
264268 } : {
265269 pkg : Package
266270 capabilities : Record < string , string [ ] >
@@ -295,8 +299,8 @@ export class Core {
295299 }
296300
297301 compareCapabilities ( {
298- newPackages ,
299- headPackages
302+ headPackages ,
303+ newPackages
300304 } : {
301305 newPackages : Record < string , Package >
302306 headPackages : Record < string , Package >
@@ -351,8 +355,8 @@ export class Core {
351355 }
352356
353357 async compareSBOMs ( {
354- newScan ,
355- headScan
358+ headScan ,
359+ newScan
356360 } : {
357361 newScan : Awaited < ReturnType < Core [ 'getSbomData' ] > >
358362 headScan : Awaited < ReturnType < Core [ 'getSbomData' ] > >
@@ -366,7 +370,7 @@ export class Core {
366370 const consolidated = new Set ( )
367371
368372 for ( const packageId in newPackages ) {
369- const { purl , pkg } = this . createPurl ( {
373+ const { pkg , purl } = this . createPurl ( {
370374 packageId,
371375 packages : newPackages
372376 } )
@@ -389,7 +393,7 @@ export class Core {
389393 }
390394
391395 for ( const packageId in headPackages ) {
392- const { purl , pkg } = this . createPurl ( {
396+ const { pkg , purl } = this . createPurl ( {
393397 packageId,
394398 packages : headPackages
395399 } )
0 commit comments