A plain object is one created by the Object constructor (or object literal syntax),
with Object.prototype as its direct prototype. This excludes built-in objects like
Date, RegExp, Array, Buffer, DOM elements, and objects created with custom constructors.
This strict definition ensures safe operations like deep cloning, serialization,
and property enumeration that assume simple key-value structure without special
behavior or internal state.
The type parameters K and V are intentionally not restricted to JSON-compatible types, allowing this
function to serve as a general-purpose plain object guard beyond JSON validation.
Checks if a value is a plain object.
A plain object is one created by the Object constructor (or object literal syntax), with
Object.prototypeas its direct prototype. This excludes built-in objects like Date, RegExp, Array, Buffer, DOM elements, and objects created with custom constructors.This strict definition ensures safe operations like deep cloning, serialization, and property enumeration that assume simple key-value structure without special behavior or internal state.