UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

18 lines (17 loc) 563 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MvalApi = void 0; const nodes_1 = require("../../json-crdt/model/api/nodes"); class MvalApi extends nodes_1.NodeApi { set(json) { const { api, node } = this; const builder = api.builder; const rgaApi = new nodes_1.ArrApi(node.data, api); const length = rgaApi.length(); rgaApi.del(0, length); rgaApi.ins(0, [builder.json(json)]); rgaApi.node.removeTombstones(); return this; } } exports.MvalApi = MvalApi;