@electric-sql/d2mini
Version:
D2Mini is a minimal implementation of Differential Dataflow for performing in-memory incremental view maintenance.
18 lines (17 loc) • 572 B
TypeScript
/**
* A map that returns a default value for keys that are not present.
*/
export declare class DefaultMap<K, V> extends Map<K, V> {
private defaultValue;
constructor(defaultValue: () => V, entries?: Iterable<[K, V]>);
get(key: K): V;
/**
* Update the value for a key using a function.
*/
update(key: K, updater: (value: V) => V): V;
}
export declare function chunkedArrayPush(array: unknown[], other: unknown[]): void;
/**
* A hash method that caches the hash of a value in a week map
*/
export declare function hash(data: any): string;