@kontur.candy/generator 5.54.1-crlfhash.1 → 5.54.1-crlfhash.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -67891,10 +67891,14 @@ async function getAllDependenciesHash(formSourcesPath, farmDirectory) {
|
|
|
67891
67891
|
console.log("md5(hashes.join())", md5__WEBPACK_IMPORTED_MODULE_5___default()(hashes.join()));
|
|
67892
67892
|
return md5__WEBPACK_IMPORTED_MODULE_5___default()(hashes.join());
|
|
67893
67893
|
}
|
|
67894
|
-
function
|
|
67895
|
-
|
|
67894
|
+
function normalizeLineEndings(content) {
|
|
67895
|
+
return content.replace(/\r/gi, "");
|
|
67896
|
+
}
|
|
67897
|
+
async function hashFile(filePath) {
|
|
67898
|
+
const fileBuffer = await readFileAsync(filePath, "utf-8");
|
|
67899
|
+
const clearedCRLF = normalizeLineEndings(fileBuffer);
|
|
67896
67900
|
const hashBuffer = (0,crypto__WEBPACK_IMPORTED_MODULE_3__.createHash)("sha256");
|
|
67897
|
-
hashBuffer.update(
|
|
67901
|
+
hashBuffer.update(clearedCRLF);
|
|
67898
67902
|
const a = hashBuffer.digest("hex");
|
|
67899
67903
|
console.log(filePath, a);
|
|
67900
67904
|
return a;
|