API reference@evolu/common › Object

Object utilities.

Constants

VariableDescription
emptyRecordAn empty readonly record.

Functions

FunctionDescription
createObjectURLCreates a disposable ObjectURL for the given blob.
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.
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
ReadonlyRecordA read-only Record<K, V> with K extends keyof any to preserve branded key types (e.g., in mapObject).