vike
Version:
The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.
20 lines (19 loc) • 531 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPlainObject = isPlainObject;
function isPlainObject(value) {
// Is object?
if (typeof value !== 'object' || value === null) {
return false;
}
// Support `Object.create(null)`
if (Object.getPrototypeOf(value) === null) {
return true;
}
// Is plain object?
return (
/* Doesn't work in Cloudflare Pages workers
value.constructor === Object
*/
value.constructor.name === 'Object');
}