(environment: Environment)
| 1327 | } |
| 1328 | |
| 1329 | function getLockfileHash(environment: Environment): string { |
| 1330 | const lockfilePath = lookupFile(environment.config.root, lockfilePaths) |
| 1331 | let content = lockfilePath ? fs.readFileSync(lockfilePath, 'utf-8') : '' |
| 1332 | if (lockfilePath) { |
| 1333 | const normalizedLockfilePath = lockfilePath.replaceAll('\\', '/') |
| 1334 | const lockfileFormat = lockfileFormats.find((f) => |
| 1335 | normalizedLockfilePath.endsWith(f.path), |
| 1336 | )! |
| 1337 | if (lockfileFormat.checkPatchesDir) { |
| 1338 | // Default of https://github.com/ds300/patch-package |
| 1339 | const baseDir = lockfilePath.slice(0, -lockfileFormat.path.length) |
| 1340 | const fullPath = path.join( |
| 1341 | baseDir, |
| 1342 | lockfileFormat.checkPatchesDir as string, |
| 1343 | ) |
| 1344 | const stat = tryStatSync(fullPath) |
| 1345 | if (stat?.isDirectory()) { |
| 1346 | content += stat.mtimeMs.toString() |
| 1347 | } |
| 1348 | } |
| 1349 | } |
| 1350 | return getHash(content) |
| 1351 | } |
| 1352 | |
| 1353 | function getDepHash(environment: Environment): { |
| 1354 | lockfileHash: string |
no test coverage detected