Skip to content

Commit

Permalink
Add brief docs for rebase, needs pictures. Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
briancavalier committed May 20, 2014
1 parent d716542 commit 65fc3f9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,20 @@ var b = jiff.clone(a);

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

## Experimental API
## Experimental APIs

### jiff/lib/rebase

```js
var rebase = require('jiff/lib/rebase');
var patchRebased = rebase(patchHistory, patch);
```

Yes, this is `git rebase` for JSON Patch.

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.

Rebasing is dependent on [commutation](#jifflibcommute), and so is also *highly experimental*. If the rebase cannot be performed, it will throw a `TypeError`.

### jiff/lib/commute

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jiff",
"main": "jiff.js",
"version": "0.5.2",
"version": "0.5.3",
"authors": [
"Brian Cavalier <[email protected]>"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jiff",
"version": "0.5.2",
"version": "0.5.3",
"description": "JSON diff and patch based on rfc6902",
"main": "jiff",
"scripts": {
Expand Down

0 comments on commit 65fc3f9

Please sign in to comment.