refactor: dedupe extension record guards

This commit is contained in:
Peter Steinberger
2026-04-07 00:19:16 +01:00
parent 1566a5b3bc
commit d5801c03ed
2 changed files with 2 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
import { existsSync, readFileSync } from "node:fs";
import { homedir } from "node:os";
import { join } from "node:path";
import { isRecord } from "openclaw/plugin-sdk/text-runtime";
type OAuthSettingsFs = {
existsSync: (path: Parameters<typeof existsSync>[0]) => ReturnType<typeof existsSync>;
@@ -27,10 +28,6 @@ type GeminiCliAuthSettings = {
enforcedAuthType?: unknown;
};
function isRecord(value: unknown): value is Record<string, unknown> {
return typeof value === "object" && value !== null;
}
function readString(value: unknown): string | undefined {
return typeof value === "string" && value.trim() ? value.trim() : undefined;
}