genlayer 0.12.3 → 0.12.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.4 (2025-04-03)
4
+
5
+ ### Bug Fixes
6
+
7
+ * map objects ([#207](https://github.com/yeagerai/genlayer-cli/issues/207)) ([45956f6](https://github.com/yeagerai/genlayer-cli/commit/45956f64e02505262a3585b1349dbfbf0f195d73))
8
+
3
9
  ## 0.12.3 (2025-03-07)
4
10
 
5
11
  ### Bug Fixes
package/dist/index.js CHANGED
@@ -16853,7 +16853,7 @@ var init_call = __esm({
16853
16853
  import { program } from "commander";
16854
16854
 
16855
16855
  // package.json
16856
- var version = "0.12.3";
16856
+ var version = "0.12.4";
16857
16857
  var package_default = {
16858
16858
  name: "genlayer",
16859
16859
  version,
@@ -19798,6 +19798,9 @@ var BaseAction = class extends ConfigFileManager {
19798
19798
  };
19799
19799
  return JSON.stringify(errorDetails, null, 2);
19800
19800
  }
19801
+ if (data instanceof Map) {
19802
+ data = Object.fromEntries(data);
19803
+ }
19801
19804
  return typeof data === "object" ? JSON.stringify(data, null, 2) : String(data);
19802
19805
  }
19803
19806
  log(message, data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genlayer",
3
- "version": "0.12.3",
3
+ "version": "0.12.4",
4
4
  "description": "GenLayer Command Line Tool",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -37,6 +37,11 @@ export class BaseAction extends ConfigFileManager {
37
37
  };
38
38
  return JSON.stringify(errorDetails, null, 2);
39
39
  }
40
+
41
+ if (data instanceof Map) {
42
+ data = Object.fromEntries(data);
43
+ }
44
+
40
45
  return typeof data === "object" ? JSON.stringify(data, null, 2) : String(data);
41
46
  }
42
47
 
@@ -172,4 +172,21 @@ describe("BaseAction", () => {
172
172
  expect((baseAction as any).formatOutput(true)).toBe("true");
173
173
  });
174
174
 
175
+ test("should format a Map object correctly", () => {
176
+ const testMap = new Map<string, any>([
177
+ ["key1", "value1"],
178
+ ["key2", 42],
179
+ ["key3", { nested: "object" }]
180
+ ]);
181
+
182
+ const result = (baseAction as any).formatOutput(testMap);
183
+ const expected = JSON.stringify({
184
+ key1: "value1",
185
+ key2: 42,
186
+ key3: { nested: "object" }
187
+ }, null, 2);
188
+
189
+ expect(result).toBe(expected);
190
+ });
191
+
175
192
  });