// Type guards for values read from JSON, which arrive as `unknown`. export type JsonObject = Record; // Any non-null object, arrays included: reading a missing key yields undefined. export function isObject(value: unknown): value is JsonObject { return typeof value === "object" && value !== null; } // A plain mapping, which an array is not. export function isMapping(value: unknown): value is JsonObject { return isObject(value) && !Array.isArray(value); }