genlayer 0.12.2 → 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.
@@ -6,7 +6,8 @@ export default {
6
6
  outfile: "dist/index.js",
7
7
  platform: "node",
8
8
  target: "es2020",
9
- define: { "import.meta.url": "_importMetaUrl" },
9
+ format: "esm",
10
+ define: { "import.meta.url": "import.meta.url" },
10
11
  banner: {
11
12
  js: `const _importMetaUrl = new URL(import.meta.url).pathname;`,
12
13
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genlayer",
3
- "version": "0.12.2",
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
  });