@sap-ux/project-integrity 0.1.11 → 0.1.13

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.
@@ -36,22 +36,23 @@ async function readIntegrityData(integrityFilePath) {
36
36
  * @param content - content to write to the integrity file
37
37
  */
38
38
  async function writeIntegrityData(integrityFilePath, content) {
39
+ const clonedContent = structuredClone(content); // clone to ensure integrity data has no getters
39
40
  const integrityDir = (0, path_1.dirname)(integrityFilePath);
40
41
  if (!(0, fs_1.existsSync)(integrityDir)) {
41
42
  await (0, promises_1.mkdir)(integrityDir, { recursive: true });
42
43
  }
43
- for (const fileIntegrity of content.fileIntegrity) {
44
+ for (const fileIntegrity of clonedContent.fileIntegrity) {
44
45
  fileIntegrity.filePath = (0, path_1.relative)(integrityDir, fileIntegrity.filePath);
45
46
  if (typeof fileIntegrity.content === 'string') {
46
47
  fileIntegrity.content = (0, lz_string_1.compressToBase64)(fileIntegrity.content);
47
48
  }
48
49
  }
49
- for (const contentIntegrity of content.contentIntegrity) {
50
+ for (const contentIntegrity of clonedContent.contentIntegrity) {
50
51
  if (typeof contentIntegrity.content === 'string') {
51
52
  contentIntegrity.content = (0, lz_string_1.compressToBase64)(contentIntegrity.content);
52
53
  }
53
54
  }
54
- await (0, promises_1.writeFile)(integrityFilePath, JSON.stringify(content), { encoding: 'utf-8' });
55
+ await (0, promises_1.writeFile)(integrityFilePath, JSON.stringify(clonedContent), { encoding: 'utf-8' });
55
56
  }
56
57
  /**
57
58
  * Wrap content with getter to decompress on first access. Do nothing if the content does not exist.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/project-integrity",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Library to check the integrity of projects",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "lz-string": "1.5.0",
27
- "@sap-ux/project-access": "1.29.14"
27
+ "@sap-ux/project-access": "1.29.15"
28
28
  },
29
29
  "scripts": {
30
30
  "build": "tsc --build",