mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 03:03:24 -04:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -38,8 +38,12 @@ function isInsideCode(pos: number, regions: CodeRegion[]): boolean {
|
||||
}
|
||||
|
||||
function applyTrim(value: string, mode: ReasoningTagTrim): string {
|
||||
if (mode === "none") return value;
|
||||
if (mode === "start") return value.trimStart();
|
||||
if (mode === "none") {
|
||||
return value;
|
||||
}
|
||||
if (mode === "start") {
|
||||
return value.trimStart();
|
||||
}
|
||||
return value.trim();
|
||||
}
|
||||
|
||||
@@ -50,8 +54,12 @@ export function stripReasoningTagsFromText(
|
||||
trim?: ReasoningTagTrim;
|
||||
},
|
||||
): string {
|
||||
if (!text) return text;
|
||||
if (!QUICK_TAG_RE.test(text)) return text;
|
||||
if (!text) {
|
||||
return text;
|
||||
}
|
||||
if (!QUICK_TAG_RE.test(text)) {
|
||||
return text;
|
||||
}
|
||||
|
||||
const mode = options?.mode ?? "strict";
|
||||
const trimMode = options?.trim ?? "both";
|
||||
|
||||
Reference in New Issue
Block a user