UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

25 lines (24 loc) 694 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RootNode = void 0; const constants_1 = require("../../../json-crdt-patch/constants"); const ValNode_1 = require("../val/ValNode"); /** * The root of a JSON CRDT document. {@link RootNode} is a {@link ValNode} with * a special `0.0` ID, which is always the same. It is used to represent the * root of a document. * * @category CRDT Node */ class RootNode extends ValNode_1.ValNode { /** * @param val Latest value of the document root. */ constructor(doc, val) { super(doc, constants_1.ORIGIN, val); } name() { return 'root'; } } exports.RootNode = RootNode;