json-joy
Version:
Collection of libraries for building collaborative editing apps.
14 lines (13 loc) • 658 B
TypeScript
import { type JsonNode } from '../nodes';
import type { NodeBuilder } from '../../json-crdt-patch';
/**
* Deeply checks if two JSON nodes have the same schema and values. Does not
* verify that the CRDT metadata (like timestamps) are the same, only that
* the structure and values are equal.
*
* @param a The first JSON CRDT node.
* @param b The second JSON CRDT node.
* @returns True if the schemas and values are equal, false otherwise.
*/
export declare const cmp: <A extends JsonNode<any>>(a: A, b: unknown, compareContent: boolean) => b is A;
export declare const cmpSchema: (a: NodeBuilder, b: NodeBuilder, compareContent: boolean) => boolean;