mongossee 1.0.26 → 1.0.27

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.
Files changed (2) hide show
  1. package/index.js +11 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -28,7 +28,7 @@ async function generateProject(prompt, directoryName) {
28
28
  - For DSA/Logic, choose Java, Python, or C++ based on context.
29
29
  3. TYPESCRIPT RULES: If using TypeScript, define proper Interfaces/Types for Props and State. No "any" type.
30
30
  4. ⛔ NO EXTRA BLOAT: In package.json, include ONLY strictly necessary dependencies (e.g., react, react-dom, react-scripts).
31
- 5. ❌ REMOVE FALTU STUFF: Do NOT include @testing-library, web-vitals, or eslintConfig. I want a clean, minimal package.json.
31
+ 5. ❌ REMOVE FALTU STUFF: Do NOT include @testing-library, web-vitals, or eslintConfig.
32
32
  6. ⛔ ZERO COMMENTS: Return strictly functional code. No // or /* */ comments, and no explanations.
33
33
  7. 📁 ARCHITECTURE: If the prompt mentions Parent/Child or Props, strictly follow React best practices (state in parent, props to child, arrow functions for events).
34
34
  8. 📄 FORMAT: Return ONLY a valid JSON array of objects: [{"filename": "string", "code": "string"}].
@@ -91,7 +91,16 @@ async function generateProject(prompt, directoryName) {
91
91
  fs.mkdirSync(fileDir, { recursive: true });
92
92
  }
93
93
 
94
- const formattedCode = file.code.replace(/\\n/g, '\n');
94
+ let formattedCode = file.code;
95
+
96
+ if (typeof formattedCode === 'string') {
97
+ formattedCode = formattedCode
98
+ .replace(/\\\\/g, '\\') // Double backslash ko single banaya
99
+ .replace(/\\r/g, '') // Carriage returns hatao
100
+ .replace(/\\n/g, '\n') // Double backslash ko newline banao
101
+ .replace(/\\t/g, ' ') // Tabs ko spaces banao
102
+ .replace(/\\"/g, '"'); // Escaped quotes ko sahi karo
103
+ }
95
104
 
96
105
  // Write the code to the file
97
106
  fs.writeFileSync(filePath, formattedCode);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mongossee",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {