refactor(core): reuse shared record guard (#45643)

This commit is contained in:
Kit Langton
2026-08-27 19:06:52 -04:00
committed by GitHub
Unverified
parent 454ed81556
commit 0a7baaaed5
+1 -4
View File
@@ -1,6 +1,7 @@
export * as ConfigNormalize from "./normalize.js"
import { isDeepStrictEqual } from "node:util"
import { isRecord } from "@opencode-ai/ai/utils/record"
import { Option, Schema } from "effect"
import { Info } from "@opencode-ai/schema/config"
import { ConfigAgent } from "@opencode-ai/schema/config/agent"
@@ -782,10 +783,6 @@ function isEnabledOnlyMcp(value: unknown) {
return isRecord(value) && !own(value, "type") && typeof value.enabled === "boolean"
}
function isRecord(value: unknown): value is Record<string, unknown> {
return typeof value === "object" && value !== null && !Array.isArray(value)
}
function isPlainRecord(value: unknown): value is Record<string, unknown> {
if (!isRecord(value)) return false
const prototype = Object.getPrototypeOf(value)