Skip to content

Commit

Permalink
✨ Add support for invertWithDoc for subtypes
Browse files Browse the repository at this point in the history
This change adds support for the [optional, but recommended][1]
`invertWithDoc(op, doc) -> op'` method, which is already implemented as
[`Delta.invert()`][2]

[1]: https://github.com/ottypes/docs#optional-properties
[2]: https://github.com/quilljs/delta/#invert
  • Loading branch information
alecgibson committed Dec 16, 2021
1 parent b53cd97 commit f656fba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/type.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,10 @@ module.exports = {
length: end - start,
});
},

invertWithDoc: function(delta, doc) {
delta = new Delta(delta);
return delta.invert(doc);
}
}
};

0 comments on commit f656fba

Please sign in to comment.