mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 09:17:38 +00:00
refactor: centralize isPlainObject, isRecord, isErrno, isLoopbackHost utilities (#12926)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { spawn } from "node:child_process";
|
||||
import net from "node:net";
|
||||
import { isErrno } from "./errors.js";
|
||||
import { ensurePortAvailable } from "./ports.js";
|
||||
|
||||
export type SshParsedTarget = {
|
||||
@@ -17,10 +18,6 @@ export type SshTunnel = {
|
||||
stop: () => Promise<void>;
|
||||
};
|
||||
|
||||
function isErrno(err: unknown): err is NodeJS.ErrnoException {
|
||||
return Boolean(err && typeof err === "object" && "code" in err);
|
||||
}
|
||||
|
||||
export function parseSshTarget(raw: string): SshParsedTarget | null {
|
||||
const trimmed = raw.trim().replace(/^ssh\s+/, "");
|
||||
if (!trimmed) {
|
||||
|
||||
Reference in New Issue
Block a user