mirror of
https://github.com/flynx/diff.js.git
synced 2025-10-29 19:10:11 +00:00
started work on patch(..)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
bd61727b12
commit
f4f174de81
4
diff.js
4
diff.js
@ -1074,8 +1074,7 @@ var _patch = function(diff, obj){
|
|||||||
var NONE = diff.options.placeholders.NONE
|
var NONE = diff.options.placeholders.NONE
|
||||||
var EMPTY = diff.options.placeholders.EMPTY
|
var EMPTY = diff.options.placeholders.EMPTY
|
||||||
|
|
||||||
diff.diff
|
Types.walk(diff, function(change){
|
||||||
.forEach(function(change){
|
|
||||||
// replace the object itself...
|
// replace the object itself...
|
||||||
if(path.length == 0){
|
if(path.length == 0){
|
||||||
return change.B
|
return change.B
|
||||||
@ -1096,6 +1095,7 @@ var _patch = function(diff, obj){
|
|||||||
delete target[key]
|
delete target[key]
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
// XXX also check what is overwritten...
|
||||||
target[key] = change.B
|
target[key] = change.B
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user