35 lines
1.4 KiB
JavaScript
35 lines
1.4 KiB
JavaScript
|
/*---------------------------------------------------------------------------------------------
|
||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||
|
*--------------------------------------------------------------------------------------------*/
|
||
|
/**
|
||
|
* Represents information about a specific difference between two sequences.
|
||
|
*/
|
||
|
var DiffChange = /** @class */ (function () {
|
||
|
/**
|
||
|
* Constructs a new DiffChange with the given sequence information
|
||
|
* and content.
|
||
|
*/
|
||
|
function DiffChange(originalStart, originalLength, modifiedStart, modifiedLength) {
|
||
|
//Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0");
|
||
|
this.originalStart = originalStart;
|
||
|
this.originalLength = originalLength;
|
||
|
this.modifiedStart = modifiedStart;
|
||
|
this.modifiedLength = modifiedLength;
|
||
|
}
|
||
|
/**
|
||
|
* The end point (exclusive) of the change in the original sequence.
|
||
|
*/
|
||
|
DiffChange.prototype.getOriginalEnd = function () {
|
||
|
return this.originalStart + this.originalLength;
|
||
|
};
|
||
|
/**
|
||
|
* The end point (exclusive) of the change in the modified sequence.
|
||
|
*/
|
||
|
DiffChange.prototype.getModifiedEnd = function () {
|
||
|
return this.modifiedStart + this.modifiedLength;
|
||
|
};
|
||
|
return DiffChange;
|
||
|
}());
|
||
|
export { DiffChange };
|