mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 20:51:10 +00:00
refactor: dedupe secret ref record helper
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { isRecord } from "../utils.js";
|
||||
|
||||
export type SecretRefSource = "env" | "file" | "exec"; // pragma: allowlist secret
|
||||
|
||||
/**
|
||||
@@ -27,10 +29,6 @@ export function isValidEnvSecretRefId(value: string): boolean {
|
||||
return ENV_SECRET_REF_ID_RE.test(value);
|
||||
}
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return typeof value === "object" && value !== null && !Array.isArray(value);
|
||||
}
|
||||
|
||||
export function isSecretRef(value: unknown): value is SecretRef {
|
||||
if (!isRecord(value)) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user