mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
14 lines
326 B
JavaScript
14 lines
326 B
JavaScript
|
function Patch(patch) {
|
||
|
if (patch.delete != null) {
|
||
|
this.before = termFromJSON(patch.delete);
|
||
|
}
|
||
|
if (patch.insert != null) {
|
||
|
this.after = termFromJSON(patch.insert);
|
||
|
}
|
||
|
if (patch.replace != null) {
|
||
|
this.before = termFromJSON(patch.replace.before);
|
||
|
this.after = termFromJSON(patch.replace.after);
|
||
|
}
|
||
|
return this;
|
||
|
}
|