@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.
Files changed (2) hide show
  1. package/dist/index.js +7 -3
  2. 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 hashFile(filePath) {
67895
- const fileBuffer = fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(filePath);
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(fileBuffer);
67901
+ hashBuffer.update(clearedCRLF);
67898
67902
  const a = hashBuffer.digest("hex");
67899
67903
  console.log(filePath, a);
67900
67904
  return a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "5.54.1-crlfhash.1",
3
+ "version": "5.54.1-crlfhash.2",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,