Skip to content

Commit 1a87855

Browse files
authored
Merge branch 'master' into dataplt_935
2 parents f2b5456 + 4549381 commit 1a87855

7 files changed

Lines changed: 273 additions & 236 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
node-version: [22.x, 24.x]
1616

1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v6
1919

2020
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@v6
2222
with:
2323
node-version: ${{ matrix.node-version }}
2424

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Check File Dependencies Changelog
22

3+
## 6.0.1
4+
5+
- Change an internal hash used to make comparisons from md5 to sha256 (because of a Prisma complaint)
6+
37
## 6.0.0
48
- Dropping support for Node 18 and 20
59
- Add support for node 22+

lib/find-used-modules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function parseFile(file, dirname) {
2222
var displayPath = file.replace(dirname, '').slice(1);
2323
var dir = parents(file)[1];
2424
return new Promise(function(resolve, reject) {
25-
var addJs = file.slice(-3) !== '.js';
25+
var addJs = !['.js', '.cjs', '.mjs'].includes(path.extname(file));
2626
fs.readFile(file + (addJs ? '.js' : ''), function(err, str) {
2727
if (err && addJs) return parseFile(path.join(file, 'index.js')).then(resolve).catch(reject);
2828
if (err) return reject(err);

lib/vet/tarball.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = function(module, dir, url, json) {
99
var moduleDir = path.join(dir, 'node_modules', module);
1010
return new Promise(function(resolve, reject) {
1111
var children = [];
12-
var stream = got.stream(url).pipe(zlib.Unzip()).pipe(new tar.Parse());
12+
var stream = got.stream(url).pipe(zlib.Unzip()).pipe(new tar.Parser());
1313
stream.on('entry', function(arg) {
1414
if (arg.type !== 'File') { arg.resume(); return; }
1515
var parts = arg.path.split('/');
@@ -54,12 +54,12 @@ function vetPackageJSON(dir, fileStream) {
5454

5555
function vetFile(dir, fileStream) {
5656
return getContentFromStream(fileStream).then(function(inTarball) {
57-
var md5InTarball = crypto.createHash('md5').update(inTarball).digest("hex");
57+
var sha256InTarball = crypto.createHash('sha256').update(inTarball).digest("hex");
5858
var filePath = path.join(dir, fileStream.path.split('/').slice(1).join('/'));
5959
return getLocalFile(filePath).then(function(localFile) {
6060
localFile = transform(fileStream.path.split('/')[1], localFile);
61-
var md5Local = crypto.createHash('md5').update(localFile).digest("hex");
62-
if (md5Local !== md5InTarball) throw new Error('Files dont match');
61+
var sha256Local = crypto.createHash('sha256').update(localFile).digest("hex");
62+
if (sha256Local !== sha256InTarball) throw new Error('Files dont match');
6363
});
6464
});
6565
};

0 commit comments

Comments
 (0)