API reference › @evolu/common › Object › emptyPrototype

const emptyPrototype: object;

Defined in: packages/common/src/Object.ts:76

A frozen, empty object without a prototype, the prototype of objects that inherit nothing, as an object without a prototype does, but whose properties V8 keeps as fast as an ordinary object's, which it doesn't for one without a prototype. Rows of Evolu's SQLite on Node.js and the web have it, and isPlainObject accepts objects that have it.

Example

import { assertTrue, emptyPrototype, isPlainObject } from "@evolu/common";

const row = Object.create(emptyPrototype) as Record<string, unknown>;
row["__proto__"] = 1;

assertTrue(isPlainObject(row));
assertTrue(Object.hasOwn(row, "__proto__"));