mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 08:41:41 +00:00
refactor: centralize isPlainObject, isRecord, isErrno, isLoopbackHost utilities (#12926)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { isRecord } from "../utils.js";
|
||||
import { normalizeSecretInput } from "../utils/normalize-secret-input.js";
|
||||
|
||||
type MinimaxBaseResp = {
|
||||
@@ -30,10 +31,6 @@ function coerceApiHost(params: {
|
||||
}
|
||||
}
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
||||
}
|
||||
|
||||
function pickString(rec: Record<string, unknown>, key: string): string {
|
||||
const v = rec[key];
|
||||
return typeof v === "string" ? v : "";
|
||||
|
||||
Reference in New Issue
Block a user