()
| 53 | |
| 54 | // 解析package-lock.json |
| 55 | function parsePackageLock() { |
| 56 | try { |
| 57 | const packageLockPath = path.join(__dirname, '../package-lock.json'); |
| 58 | const packageLock = JSON.parse(fs.readFileSync(packageLockPath, 'utf8')); |
| 59 | return packageLock.dependencies || {}; |
| 60 | } catch (error) { |
| 61 | console.error('Error reading package-lock.json:', error.message); |
| 62 | return {}; |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | // 检查依赖包的安全状态 |
| 67 | function checkDependencies() { |
no test coverage detected