@cccarv82/freya 3.8.4 → 3.8.5
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.
|
@@ -134,11 +134,12 @@ function extractFirstJsonObject(text) {
|
|
|
134
134
|
return null;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
function
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
137
|
+
function sanitizeJsonText(jsonText) {
|
|
138
|
+
// Copilot often returns pretty-printed JSON with literal newlines INSIDE
|
|
139
|
+
// string values (e.g. multi-line descriptions). These are invalid JSON.
|
|
140
|
+
// Replace ALL control chars (including \n, \r, \t) with spaces — JSON
|
|
141
|
+
// doesn't use newlines as syntax, they're just whitespace between tokens.
|
|
142
|
+
return jsonText.replace(/[\x00-\x1F\x7F]/g, ' ');
|
|
142
143
|
}
|
|
143
144
|
|
|
144
145
|
function readProjectSlugMap(wsDir) {
|
|
@@ -338,7 +339,7 @@ IMPORTANTE: Extraia APENAS informações explícitas do log. NÃO invente dados.
|
|
|
338
339
|
try {
|
|
339
340
|
plan = JSON.parse(jsonText);
|
|
340
341
|
} catch {
|
|
341
|
-
try { plan = JSON.parse(
|
|
342
|
+
try { plan = JSON.parse(sanitizeJsonText(jsonText)); } catch {
|
|
342
343
|
totalErrors++;
|
|
343
344
|
if (totalErrors <= 2) {
|
|
344
345
|
console.log(`\n ⚠ JSON parse diagnostic for ${date}:`);
|
package/package.json
CHANGED