API reference / @evolu/common / Object

Object

Type Aliases

Type AliasDescription
ReadonlyRecordA read-only Record<K, V> with K extends keyof any to preserve branded key types (e.g., in mapObject).

Functions

FunctionDescription
createRecordCreates a prototype-less object typed as Record<K, V>.
excludePropConditionally excludes a property from an object.
getPropertySafely gets a property from a record, returning undefined if the key doesn't exist.
isPlainObjectChecks if a value is a plain object (e.g., created with {} or Object).
mapObjectMaps a ReadonlyRecord<K, V> to a new ReadonlyRecord<K, U>, preserving branded key types (e.g., type Id = 'id' & string) lost by Object.entries. Uses K extends string for precision.
objectToEntriesLike Object.entries but preserves branded keys.

Was this page helpful?