metro-cache-key
Advanced tools
Comparing version 0.64.0 to 0.65.0
{ | ||
"name": "metro-cache-key", | ||
"version": "0.64.0", | ||
"version": "0.65.0", | ||
"description": "🚇 Cache key utility.", | ||
@@ -16,4 +16,4 @@ "main": "src/index.js", | ||
"devDependencies": { | ||
"ob1": "0.64.0" | ||
"ob1": "0.65.0" | ||
} | ||
} |
@@ -7,20 +7,20 @@ /** | ||
* | ||
* | ||
* @flow | ||
* @format | ||
*/ | ||
"use strict"; | ||
const crypto = require("crypto"); | ||
'use strict'; | ||
const fs = require("fs"); | ||
const crypto = require('crypto'); | ||
const fs = require('fs'); | ||
function getCacheKey(files) { | ||
function getCacheKey(files: Array<string>): string { | ||
return files | ||
.reduce( | ||
(hash, file) => hash.update("\0", "utf8").update(fs.readFileSync(file)), | ||
crypto.createHash("md5") | ||
(hash, file) => hash.update('\0', 'utf8').update(fs.readFileSync(file)), | ||
crypto.createHash('md5'), | ||
) | ||
.digest("hex"); | ||
.digest('hex'); | ||
} | ||
module.exports = getCacheKey; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2846
67