chore: initialize my-pi extension bundle

This commit is contained in:
云服务部-叶林立
2026-08-18 12:30:48 +08:00
parent 7b7b332912
commit 0637139a16
62 changed files with 11055 additions and 1 deletions
+13
View File
@@ -0,0 +1,13 @@
export function stripAnsi(text: string): string {
return text
.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "")
.replace(/\x1b\][0-9;]*(?:\x07|\x1b\\)/g, "")
.replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g, "");
}
export function stripAnsiFast(text: string): string {
if (!text.includes("\x1b")) {
return text;
}
return stripAnsi(text);
}