cartographer-ai 1.0.12 → 1.0.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cartographer-ai",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "main": "src/commands.js",
5
5
  "type": "module",
6
6
  "bin": {
@@ -90,18 +90,22 @@ export class Cartographer {
90
90
  },
91
91
  });
92
92
  } catch (error) {
93
- const errorMessage = `\x1b[31m${
94
- error?.response?.data?.error ?? "Unexpected error occured"
95
- }\x1b[0m`;
93
+ if (error?.response?.data?.error) {
94
+ const errorMessage = `\x1b[31m${
95
+ error?.response?.data?.error ?? "Unexpected error occured"
96
+ }\x1b[0m`;
96
97
 
97
- const err = new Error(errorMessage);
98
- err.stack = "";
98
+ const err = new Error(errorMessage);
99
+ err.stack = "";
99
100
 
100
- throw err;
101
+ throw err;
102
+ }
101
103
  }
102
104
  }
103
105
 
104
106
  #parseFile(content, modifiedFiles, filePath, gitRoot) {
107
+ if (!content || typeof content !== "string") return;
108
+
105
109
  const match = content.match(regex);
106
110
  if (!match) return;
107
111