API reference@evolu/common › Object

Object utilities.

Constants

VariableDescription
emptyRecordA shared frozen empty readonly Record.

Functions

FunctionDescription
createMutableRecordCreates a mutable Record.
createObjectURLCreates a disposable ObjectURL for the given blob.
excludePropConditionally excludes a property from an object.
getObjectKindClassifies Object representations supported by Evolu's structural data APIs.
getOwnPropGets an own property from a record, returning undefined if the key is missing or inherited.
isFunctionChecks if a value is a function.
isIterableChecks if a value is Iterable.
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.
objectFromCreates an object by mapping keys to values.
objectFromEntriesCreates an object from key-value pairs, preserving branded key types.
objectToEntriesLike Object.entries but preserves branded keys.

Interfaces

InterfaceDescription
ObjectURLA disposable wrapper around URL.createObjectURL that automatically revokes the URL when disposed. Use with the using declaration for automatic cleanup.

Type Aliases

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