@konplit-services/common 1.0.80 → 1.0.81

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.
@@ -8,13 +8,22 @@ exports.getAllKeys = void 0;
8
8
  */
9
9
  const getAllKeys = (obj) => {
10
10
  let keys = [];
11
- if (typeof obj !== 'object' || obj === null) {
11
+ if (typeof obj !== "object" || obj === null) {
12
12
  return keys;
13
13
  }
14
14
  for (let key in obj) {
15
- keys.push(key);
16
- if (typeof obj[key] === 'object') {
17
- keys = keys.concat(getAllKeys(obj[key]));
15
+ if (Array.isArray(obj[key])) {
16
+ // Add the array key itself
17
+ //TODO: UPDATE THE IMPLEMENTATION
18
+ // keys.push(key);
19
+ // Optionally, add keys of elements within the array
20
+ // keys = keys.concat(obj[key].flatMap((item: any) => getAllKeys(item)));
21
+ }
22
+ else {
23
+ keys.push(key);
24
+ if (typeof obj[key] === "object") {
25
+ keys = keys.concat(getAllKeys(obj[key]));
26
+ }
18
27
  }
19
28
  }
20
29
  return keys;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konplit-services/common",
3
- "version": "1.0.80",
3
+ "version": "1.0.81",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",