(command, args, cwd, timeoutMs = 60_000)
| 549 | if (args === undefined || args === null) return "" |
| 550 | if (typeof args === "string") return args.trim().replace(/\s+/g, " ") |
| 551 | if (Array.isArray(args)) return args.map(normalizeArgsForKey).join(" ").trim().replace(/\s+/g, " ") |
| 552 | try { return JSON.stringify(args) } catch { return String(args) } |
| 553 | } |
| 554 | |
| 555 | function commandArgsText(args) { |
| 556 | if (args === undefined || args === null) return "" |
| 557 | if (typeof args === "string") return args |
| 558 | if (Array.isArray(args)) return args.map(commandArgsText).join(" ") |
| 559 | if (typeof args === "object") { |
| 560 | for (const key of ["arguments", "args", "message", "text", "value"]) { |
| 561 | if (args[key] !== undefined) return commandArgsText(args[key]) |
| 562 | } |
| 563 | } |
| 564 | return String(args) |
| 565 | } |
no outgoing calls
no test coverage detected