Skip to content

Commit 65fc3f9

Browse files
committed
Add brief docs for rebase, needs pictures. Bump version
1 parent d716542 commit 65fc3f9

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,20 @@ var b = jiff.clone(a);
101101

102102
Creates a deep copy of `a`, which must be a valid JSON object/array/value.
103103

104-
## Experimental API
104+
## Experimental APIs
105+
106+
### jiff/lib/rebase
107+
108+
```js
109+
var rebase = require('jiff/lib/rebase');
110+
var patchRebased = rebase(patchHistory, patch);
111+
```
112+
113+
Yes, this is `git rebase` for JSON Patch.
114+
115+
Given a patchHistory (Array of patches), and a single patch rooted at the same starting document context, rebase patch onto patchHistory, so that it may be applied after patchHistory.
116+
117+
Rebasing is dependent on [commutation](#jifflibcommute), and so is also *highly experimental*. If the rebase cannot be performed, it will throw a `TypeError`.
105118

106119
### jiff/lib/commute
107120

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jiff",
33
"main": "jiff.js",
4-
"version": "0.5.2",
4+
"version": "0.5.3",
55
"authors": [
66
"Brian Cavalier <brian@hovercraftstudios.com>"
77
],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jiff",
3-
"version": "0.5.2",
3+
"version": "0.5.3",
44
"description": "JSON diff and patch based on rfc6902",
55
"main": "jiff",
66
"scripts": {

0 commit comments

Comments
 (0)