mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 16:59:43 +02:00
format
This commit is contained in:
@@ -18,7 +18,8 @@
|
|||||||
* Note: Has global flag - reset lastIndex before exec() if reusing.
|
* Note: Has global flag - reset lastIndex before exec() if reusing.
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line no-control-regex
|
// eslint-disable-next-line no-control-regex
|
||||||
export const ANSI_ESCAPE_PATTERN_FULL = /\x1b(?:\[[0-9;?]*[A-Za-z]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[=>])/g;
|
export const ANSI_ESCAPE_PATTERN_FULL =
|
||||||
|
/\x1b(?:\[[0-9;?]*[A-Za-z]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[=>])/g;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple ANSI CSI-only pattern for basic escape code stripping.
|
* Simple ANSI CSI-only pattern for basic escape code stripping.
|
||||||
|
|||||||
+9
-11
@@ -4036,17 +4036,15 @@ NOW: Generate the implementation plan for the task above. Think step by step.`;
|
|||||||
repaired = repaired.replace(/,(\s*[\]}])/g, '$1');
|
repaired = repaired.replace(/,(\s*[\]}])/g, '$1');
|
||||||
// Fix unescaped control characters within JSON strings
|
// Fix unescaped control characters within JSON strings
|
||||||
repaired = repaired.replace(/"([^"\\]|\\.)*"/g, (match) => {
|
repaired = repaired.replace(/"([^"\\]|\\.)*"/g, (match) => {
|
||||||
return (
|
return match
|
||||||
match
|
.replace(/\n/g, '\\n')
|
||||||
.replace(/\n/g, '\\n')
|
.replace(/\r/g, '\\r')
|
||||||
.replace(/\r/g, '\\r')
|
.replace(/\t/g, '\\t')
|
||||||
.replace(/\t/g, '\\t')
|
.replace(
|
||||||
.replace(
|
// eslint-disable-next-line no-control-regex
|
||||||
// eslint-disable-next-line no-control-regex
|
/[\x00-\x1f]/g,
|
||||||
/[\x00-\x1f]/g,
|
(c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, '0')}`
|
||||||
(c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, '0')}`
|
);
|
||||||
)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
parsed = JSON.parse(repaired);
|
parsed = JSON.parse(repaired);
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user