json-joy
Version:
Collection of libraries for building collaborative editing apps.
13 lines (12 loc) • 517 B
TypeScript
import { type JsonNode } from '../nodes';
/**
* Performs type and metadata shallow check of two JSON CRDT nodes. Compares
* node type and their metadata (like timestamps). Does not compare the content
* of the nodes, however if the metadata matches the content is likely the same
* as well.
*
* @param a The first JSON CRDT node.
* @param b The second JSON CRDT node.
* @returns True if they are equal, false otherwise.
*/
export declare const cmpNode: <A extends JsonNode<any>>(a: A, b: unknown) => b is A;