Logo
Explore Help
Register Sign In
Ayuriel/openclaw
1
0
Fork 0
You've already forked openclaw
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
openclaw/test/helpers/normalize-text.ts

10 lines
296 B
TypeScript
Raw Permalink Normal View History

refactor: consolidate duplicate utility functions (#12439) * refactor: consolidate duplicate utility functions - Add escapeRegExp to src/utils.ts and remove 10 local duplicates - Rename bash-tools clampNumber to clampWithDefault (different signature) - Centralize formatError calls to use formatErrorMessage from infra/errors.ts - Re-export formatErrorMessage from cli/cli-utils.ts to preserve API * refactor: consolidate remaining escapeRegExp duplicates * refactor: consolidate sleep, stripAnsi, and clamp duplicates
2026-02-08 23:59:43 -08:00
import { stripAnsi } from "../../src/terminal/ansi.js";
refactor(test): temp home env + normalize status
2026-01-09 16:49:01 +01:00
export function normalizeTestText(input: string): string {
return stripAnsi(input)
.replaceAll("\r\n", "\n")
.replaceAll("…", "...")
.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "?")
.replace(/[\uD800-\uDFFF]/g, "?");
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.1 Page: 288ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API