@mroc/ottype-basic-string

1.0.5 • Public • Published

ottype-basic-string

This proof-of-concept implementation of a operational transformation (OT) type text is not meant to be used in production and just serves the authors desire to gain domain knowledge.

The API supports two operations: Insert and delete a single char in a text.

const type = require("@mroc/ottype-basic-string");

const state0 = "ABC";

const op0 = type.opInsert(1, "x");
const state1 = type.apply(state0, op0);
console.log(state1); // "AxBC";

const op1 = type.opDelete(1);
const state2 = type.apply(state1, op1);
console.log(state1); // "ABC";

/@mroc/ottype-basic-string/

    Package Sidebar

    Install

    npm i @mroc/ottype-basic-string

    Weekly Downloads

    0

    Version

    1.0.5

    License

    MIT

    Unpacked Size

    8.48 kB

    Total Files

    7

    Last publish

    Collaborators

    • mroc