mongossee 1.0.28 → 1.0.29
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/index.js +12 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -115,6 +115,18 @@ async function generateProject(prompt, directoryName) {
|
|
|
115
115
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
// 2. ✨ JSON Pretty-Print Fix:
|
|
119
|
+
// Agar file .json hai, toh usey dubara parse karke sundar format mein badlo
|
|
120
|
+
if (file.filename.endsWith('.json')) {
|
|
121
|
+
try {
|
|
122
|
+
const jsonObject = JSON.parse(formattedCode);
|
|
123
|
+
formattedCode = JSON.stringify(jsonObject, null, 2);
|
|
124
|
+
} catch (e) {
|
|
125
|
+
// Agar parse fail ho jaye toh purana formatted code hi rehne do
|
|
126
|
+
//console.log(` ${file.filename}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
118
130
|
// Write the code to the file
|
|
119
131
|
fs.writeFileSync(filePath, formattedCode);
|
|
120
132
|
//console.log(`Created file: ${filePath}`);
|