@1e0zj/dsh-plugin-mall 0.4.12 → 0.4.15
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.
- package/README.md +72 -0
- package/package.json +1 -1
- package/src/cli.js +4 -3
- package/src/client.js +33 -6
- package/src/guard.js +174 -6
- package/src/index.js +104 -14
- package/src/installer.js +577 -31
- package/src/terminal.js +11 -0
package/src/terminal.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Job logs are rendered as plain text in the browser. Child processes such as
|
|
2
|
+
// pnpm may still emit terminal colour controls when their stdio is piped (for
|
|
3
|
+
// example when FORCE_COLOR is inherited), which the browser shows as `[96m`.
|
|
4
|
+
// Keep the sanitizer dependency-free and limited to CSI sequences: those cover
|
|
5
|
+
// pnpm's colours/progress controls without deleting ordinary user text.
|
|
6
|
+
|
|
7
|
+
const ANSI_CSI_RE = new RegExp("\\u001b\\[[0-?]*[ -/]*[@-~]", "g");
|
|
8
|
+
|
|
9
|
+
export function stripTerminalControlSequences(value) {
|
|
10
|
+
return String(value ?? "").replace(ANSI_CSI_RE, "");
|
|
11
|
+
}
|