refactor: dedupe secrets record helper

This commit is contained in:
Peter Steinberger
2026-04-06 23:18:15 +01:00
parent d8e7017326
commit 31d05bb3a4

View File

@@ -8,6 +8,8 @@ import type {
} from "./runtime-shared.js";
import { pushInactiveSurfaceWarning, pushWarning } from "./runtime-shared.js";
import type { RuntimeWebDiagnostic, RuntimeWebDiagnosticCode } from "./runtime-web-tools.types.js";
export { isRecord } from "./shared.js";
import { isRecord } from "./shared.js";
type RuntimeWebWarningCode = Extract<RuntimeWebDiagnosticCode, SecretResolverWarningCode>;
export type SecretResolutionResult<TSource extends string> = {
@@ -76,10 +78,6 @@ export type RuntimeWebProviderSelectionParams<
}) => Promise<void>;
};
export function isRecord(value: unknown): value is Record<string, unknown> {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
export function ensureObject(
target: Record<string, unknown>,
key: string,