@capillarytech/cap-ui-utils 2.0.9 → 3.0.0

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/index.js CHANGED
@@ -9,4 +9,3 @@ export { default as loadable, FORCE_REFRESH_NOTIFIER, FORCE_REFRESH_SECONDS } fr
9
9
  export { default as GTMTracker } from './utils/gtmTracker';
10
10
  export { default as compileHandlebars } from './utils/compileHandlebars';
11
11
  export { default as sanitizeTemplateWithRegexp } from "./utils/contentSanitizationHelper";
12
- export { default as decompressJsonObject } from "./utils/zlibDataDecompress";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capillarytech/cap-ui-utils",
3
- "version": "2.0.9",
3
+ "version": "3.0.0",
4
4
  "description": "Utility functions shared accross all the modules",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,14 +8,12 @@
8
8
  },
9
9
  "author": "Rajshekar",
10
10
  "dependencies": {
11
- "base64-js": "1.5.1",
12
- "handlebars": "4.0.11",
13
- "lodash": "4.17.11",
11
+ "react": "^18.2.0",
12
+ "react-ga": "^3.3.1",
13
+ "tti-polyfill": "^0.2.2",
14
14
  "moment-timezone": "^0.5.25",
15
- "pako": "^2.1.0",
16
- "react": "^16.13.0",
17
- "react-ga": "^2.7.0",
18
- "react-intl": "2.7.2",
19
- "tti-polyfill": "^0.2.2"
15
+ "react-intl": "6.6.6",
16
+ "lodash": "4.17.11",
17
+ "handlebars": "4.0.11"
20
18
  }
21
19
  }
@@ -1,27 +0,0 @@
1
- import pako from "pako";
2
- import base64 from "base64-js";
3
-
4
- const decompressData = (data) => {
5
- return pako.ungzip(data, { to: "string" });
6
- };
7
-
8
- // Function to decode base64 to buffer
9
- function decodeBase64(base64String) {
10
- return Buffer.from(base64.toByteArray(base64String));
11
- }
12
-
13
- // Function to decompress base64-encoded compressed JSON string
14
- const decompressJsonObject = (base64Compressed) => {
15
- // Decode the base64 string to buffer
16
- if (base64Compressed && typeof base64Compressed === "string") {
17
- const compressedBuffer = decodeBase64(base64Compressed);
18
- // Decompress the buffer
19
- const decompressedBuffer = decompressData(compressedBuffer);
20
- // Parse decompressedBuffer to object
21
- const jsonObject = JSON.parse(decompressedBuffer);
22
- return jsonObject;
23
- }
24
- return base64Compressed;
25
- };
26
-
27
- export default decompressJsonObject;