You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require ot-json1 and use these methods: type, removeOp, insertOp, replaceOp, editOp
const{ type, removeOp, insertOp, replaceOp, editOp }=require('ot-json1');
...
...
functionjson0to1(json0Op){// JSON0 ops are a list of {p: path, operation}.// See https://github.com/ottypes/json0#summary-of-operationsreturnjson0Op.map(c=>{
...
elseif(c.t)returnc.t==='text0' ? editOp(c.p,'text-unicode',text0ToText(c.o)) : editOp(c.p,c.t,c.o)// Note: Using the old text type here because thats what json0 uses.// You will have to register it if you want to use it.elseif(c.si!=null)returneditOp(c.p.slice(0,-1),'text-unicode',textOpAt(c.p[c.p.length-1],c.si))elseif(c.sd!=null)returneditOp(c.p.slice(0,-1),'text-unicode',textOpAt(c.p[c.p.length-1],{d: c.sd.length}))...}).reduce(type.compose,null)...
A function that does this conversion would be great.
Has it been done somewhere already? Or is a completely new implementation required?
The text was updated successfully, but these errors were encountered: