@fluid-experimental/property-changeset 1.2.3-83900 → 2.0.0-internal.1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/changeset.d.ts +39 -45
- package/dist/changeset.d.ts.map +1 -1
- package/dist/changeset.js +39 -45
- package/dist/changeset.js.map +1 -1
- package/dist/changeset_operations/array.d.ts +3 -3
- package/dist/changeset_operations/array.d.ts.map +1 -1
- package/dist/changeset_operations/array.js +45 -47
- package/dist/changeset_operations/array.js.map +1 -1
- package/dist/changeset_operations/indexedCollection.d.ts +2 -2
- package/dist/changeset_operations/indexedCollection.js +2 -2
- package/dist/changeset_operations/indexedCollection.js.map +1 -1
- package/dist/helpers/typeidHelper.d.ts +9 -9
- package/dist/helpers/typeidHelper.js +9 -9
- package/dist/helpers/typeidHelper.js.map +1 -1
- package/dist/pathHelper.d.ts +4 -4
- package/dist/pathHelper.js +4 -4
- package/dist/pathHelper.js.map +1 -1
- package/dist/templateValidator.d.ts +6 -6
- package/dist/templateValidator.d.ts.map +1 -1
- package/dist/templateValidator.js +66 -58
- package/dist/templateValidator.js.map +1 -1
- package/dist/test/tsconfig.tsbuildinfo +1 -1
- package/dist/utils.d.ts +7 -7
- package/dist/utils.js +9 -9
- package/dist/utils.js.map +1 -1
- package/dist/validationResultBuilder.d.ts +4 -4
- package/dist/validationResultBuilder.js +4 -4
- package/dist/validationResultBuilder.js.map +1 -1
- package/lib/changeset.js +39 -45
- package/lib/changeset.js.map +1 -1
- package/lib/changeset_operations/array.js +45 -47
- package/lib/changeset_operations/array.js.map +1 -1
- package/lib/changeset_operations/indexedCollection.js +2 -2
- package/lib/changeset_operations/indexedCollection.js.map +1 -1
- package/lib/helpers/typeidHelper.js +9 -9
- package/lib/helpers/typeidHelper.js.map +1 -1
- package/lib/pathHelper.js +4 -4
- package/lib/pathHelper.js.map +1 -1
- package/lib/templateValidator.js +66 -58
- package/lib/templateValidator.js.map +1 -1
- package/lib/utils.js +9 -9
- package/lib/utils.js.map +1 -1
- package/lib/validationResultBuilder.js +4 -4
- package/lib/validationResultBuilder.js.map +1 -1
- package/package.json +3 -3
|
@@ -39,11 +39,10 @@ var ArrayChangeSetRangeType;
|
|
|
39
39
|
ArrayChangeSetRangeType[ArrayChangeSetRangeType["partOfApartOfB"] = 7] = "partOfApartOfB";
|
|
40
40
|
})(ArrayChangeSetRangeType || (ArrayChangeSetRangeType = {}));
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
* @param io_operation
|
|
44
|
-
* @param in_aOffset
|
|
45
|
-
* @param io_resultingRange
|
|
46
|
-
* the computed range
|
|
42
|
+
* Computes a range for an operation of the current change set
|
|
43
|
+
* @param io_operation - Input
|
|
44
|
+
* @param in_aOffset - The offset that needs to be added to transform the operation
|
|
45
|
+
* @param io_resultingRange - The computed range
|
|
47
46
|
*/
|
|
48
47
|
const getRangeForCurrentStateOperation = function (io_operation, in_aOffset, io_resultingRange) {
|
|
49
48
|
if (!io_operation) {
|
|
@@ -87,10 +86,10 @@ const getRangeForCurrentStateOperation = function (io_operation, in_aOffset, io_
|
|
|
87
86
|
};
|
|
88
87
|
const getOpLength = (op) => (0, isNumber_1.default)(op[1]) ? op[1] : op[1].length;
|
|
89
88
|
/**
|
|
90
|
-
*
|
|
91
|
-
* @param in_operation
|
|
92
|
-
* @param io_resultingRange
|
|
93
|
-
* @param in_flag
|
|
89
|
+
* Computes the impact range for a given operation of the applied change set
|
|
90
|
+
* @param in_operation - The op
|
|
91
|
+
* @param io_resultingRange - The computed range
|
|
92
|
+
* @param in_flag - The flag for the resulting range, default is 'complete B'
|
|
94
93
|
* @param in_options - Optional additional parameters
|
|
95
94
|
*/
|
|
96
95
|
const getRangeForAppliedOperation = function (in_operation, io_resultingRange, in_flag, in_options) {
|
|
@@ -155,10 +154,10 @@ const getRangeForAppliedOperation = function (in_operation, io_resultingRange, i
|
|
|
155
154
|
* Splits the second and third parameter in an array remove or modify operation into two segments.
|
|
156
155
|
* This treats the three possible cases array, string and length that are allowed in a remove operation
|
|
157
156
|
*
|
|
158
|
-
* @param in_firstResult
|
|
157
|
+
* @param in_firstResult - Place where the first half is stored
|
|
159
158
|
* @param in_secondResult - Place where the second half is stored
|
|
160
|
-
* @param in_data
|
|
161
|
-
* @param in_start
|
|
159
|
+
* @param in_data - The original operation
|
|
160
|
+
* @param in_start - Index at which the operation is split
|
|
162
161
|
* @private
|
|
163
162
|
*/
|
|
164
163
|
const _splitArrayParameter = function (in_firstResult, in_secondResult, in_data, in_start) {
|
|
@@ -236,13 +235,13 @@ const _copyOperation = function (in_sourceOperation, in_targetOperation) {
|
|
|
236
235
|
/**
|
|
237
236
|
* cut overlapping ranges in non-overlapping and completely overlapping segments
|
|
238
237
|
* ranges of length 0 just cut lengthy ranges
|
|
239
|
-
* @param io_rangeA
|
|
240
|
-
* @param io_rangeB
|
|
241
|
-
* @param io_resultingSegment
|
|
242
|
-
* @param in_rebasing
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
238
|
+
* @param io_rangeA - Input A
|
|
239
|
+
* @param io_rangeB - Input B
|
|
240
|
+
* @param io_resultingSegment - The resulting overlapping segment
|
|
241
|
+
* @param in_rebasing - Is this function called for rebasing - we have to implement two different
|
|
242
|
+
* behaviors of this function: one for squashing and one for rebasing, because an insert-insert
|
|
243
|
+
* operation in squashing should be separte segments, while for rebasing, we need one segment
|
|
244
|
+
* for both inserts to be able to report a conflict.
|
|
246
245
|
* overlapping range or
|
|
247
246
|
* (partial) A or B
|
|
248
247
|
*/
|
|
@@ -556,9 +555,9 @@ const splitOverlapping = function (io_rangeA, io_rangeB, io_resultingSegment, in
|
|
|
556
555
|
/**
|
|
557
556
|
* merge in_op with the last op of that category in io_changeset (if possible)
|
|
558
557
|
* e.g. merge an delete [1,3] with delete [3,2] to delete [1,5]
|
|
559
|
-
* @param in_op -
|
|
560
|
-
* @param io_changeset -
|
|
561
|
-
* @param in_targetIndex
|
|
558
|
+
* @param in_op - The op to merge
|
|
559
|
+
* @param io_changeset - The changeset to merge the op to
|
|
560
|
+
* @param in_targetIndex - The transformed target index offset
|
|
562
561
|
* @returns true if the merge was possible and executed
|
|
563
562
|
*/
|
|
564
563
|
const mergeWithLastIfPossible = function (in_op, io_changeset, in_targetIndex, in_options) {
|
|
@@ -646,12 +645,12 @@ const mergeWithLastIfPossible = function (in_op, io_changeset, in_targetIndex, i
|
|
|
646
645
|
};
|
|
647
646
|
/**
|
|
648
647
|
* push an operation to a changeset, will try to merge the op if possible
|
|
649
|
-
* @param in_op
|
|
650
|
-
* @param io_changeset target
|
|
651
|
-
* @param the current offset
|
|
648
|
+
* @param in_op - The operation we want to push
|
|
649
|
+
* @param io_changeset - The target
|
|
650
|
+
* @param the - The current offset
|
|
652
651
|
* @param in_options - Optional additional parameters
|
|
653
|
-
* @param in_lastIteratorARemove -
|
|
654
|
-
* @param in_segment -
|
|
652
|
+
* @param in_lastIteratorARemove - The information about the last remove operation in iterator A
|
|
653
|
+
* @param in_segment - The segment this operation is part of
|
|
655
654
|
*/
|
|
656
655
|
const pushOp = function (in_op, io_changeset, in_indexOffset, in_options, in_lastIteratorARemove, in_segment) {
|
|
657
656
|
let writeTargetIndex;
|
|
@@ -729,8 +728,8 @@ const pushOp = function (in_op, io_changeset, in_indexOffset, in_options, in_las
|
|
|
729
728
|
/**
|
|
730
729
|
* handle combinations of range operations
|
|
731
730
|
* e.g. an insert and delete at the same place and same length nullify each other
|
|
732
|
-
* @param in_segment
|
|
733
|
-
* @param in_isPrimitiveType
|
|
731
|
+
* @param in_segment - The two ops to be combined
|
|
732
|
+
* @param in_isPrimitiveType - Is it an array of primitive types
|
|
734
733
|
* ATTENTION: We overwrite opB to save garbage (instead of creating a result OP)
|
|
735
734
|
*/
|
|
736
735
|
const handleCombinations = function (in_segment, in_isPrimitiveType) {
|
|
@@ -890,15 +889,14 @@ const arraysHaveSameValues = function (in_arr1, in_arr2) {
|
|
|
890
889
|
* | [rem orig. data]| (note the user) | [rem dupl. rem] |
|
|
891
890
|
* -------|-----------------+------------------+------------------|
|
|
892
891
|
*
|
|
893
|
-
* @param {{opA:{}, opB:{}}} in_segment
|
|
894
|
-
* @param {Array.<property-changeset.ChangeSet.ConflictInfo>} out_conflicts -
|
|
895
|
-
*
|
|
896
|
-
* @param {string} in_basePath -
|
|
897
|
-
*
|
|
898
|
-
* @param {boolean} in_isPrimitiveType is it an array of primitive types
|
|
892
|
+
* @param {{opA:{}, opB:{}}} in_segment - The two ops to be combined
|
|
893
|
+
* @param {Array.<property-changeset.ChangeSet.ConflictInfo>} out_conflicts - A list of paths that resulted in
|
|
894
|
+
* conflicts together with the type of the conflict
|
|
895
|
+
* @param {string} in_basePath - Base path to get to the property processed by this function
|
|
896
|
+
* @param {boolean} in_isPrimitiveType - is it an array of primitive types
|
|
899
897
|
* @param {Object} [in_options] - Optional additional parameters
|
|
900
898
|
* @param {Map} [in_options.applyAfterMetaInformation] - Additional meta information which help later to obtain
|
|
901
|
-
*
|
|
899
|
+
* more compact changeset during the apply operation
|
|
902
900
|
*/
|
|
903
901
|
const handleRebaseCombinations = function (in_segment, out_conflicts, in_basePath, in_isPrimitiveType, in_options) {
|
|
904
902
|
const opA = in_segment.opA;
|
|
@@ -1074,10 +1072,10 @@ const handleRebaseCombinations = function (in_segment, out_conflicts, in_basePat
|
|
|
1074
1072
|
};
|
|
1075
1073
|
/**
|
|
1076
1074
|
* apply a range's operation to the changeset
|
|
1077
|
-
* @param in_segment to be applied
|
|
1078
|
-
* @param io_changeset target
|
|
1079
|
-
* @param in_currentIndexOffset current offset
|
|
1080
|
-
* @param in_isPrimitiveType is it an array of primitive types
|
|
1075
|
+
* @param in_segment - to be applied
|
|
1076
|
+
* @param io_changeset - target
|
|
1077
|
+
* @param in_currentIndexOffset - current offset
|
|
1078
|
+
* @param in_isPrimitiveType - is it an array of primitive types
|
|
1081
1079
|
*/
|
|
1082
1080
|
const applySegment = function (in_segment, io_changeset, in_currentIndexOffset, lastIteratorARemove, in_isPrimitiveType, in_options) {
|
|
1083
1081
|
if (!in_segment) {
|
|
@@ -1103,12 +1101,12 @@ const applySegment = function (in_segment, io_changeset, in_currentIndexOffset,
|
|
|
1103
1101
|
};
|
|
1104
1102
|
/**
|
|
1105
1103
|
* apply a range's operation to the rebased changeset
|
|
1106
|
-
* @param in_segment to be applied
|
|
1107
|
-
* @param io_changeset target
|
|
1108
|
-
* @param in_currentIndexOffset current offset
|
|
1104
|
+
* @param in_segment - to be applied
|
|
1105
|
+
* @param io_changeset - target
|
|
1106
|
+
* @param in_currentIndexOffset - current offset
|
|
1109
1107
|
* @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict
|
|
1110
1108
|
* @param in_basePath - Base path to get to the property processed by this function
|
|
1111
|
-
* @param in_isPrimitiveType is it an array of primitive types
|
|
1109
|
+
* @param in_isPrimitiveType - is it an array of primitive types
|
|
1112
1110
|
*/
|
|
1113
1111
|
const applyRebaseSegment = function (in_segment, io_changeset, in_currentIndexOffset, out_conflicts, in_basePath, in_isPrimitiveType, in_options) {
|
|
1114
1112
|
if (!in_segment) {
|
|
@@ -1136,9 +1134,9 @@ var ChangeSetArrayFunctions;
|
|
|
1136
1134
|
* property root and it will be applied behind the base ChangeSet (assuming that the changes are relative to the
|
|
1137
1135
|
* state after the base ChangeSet has been applied. It will change the base ChangeSet.)
|
|
1138
1136
|
*
|
|
1139
|
-
* @param io_basePropertyChanges
|
|
1137
|
+
* @param io_basePropertyChanges - The ChangeSet describing the initial state
|
|
1140
1138
|
* @param in_appliedPropertyChanges - The ChangeSet to apply to this state
|
|
1141
|
-
* @param in_typeid
|
|
1139
|
+
* @param in_typeid - The typeid of the contents of the collection (without the collection type)
|
|
1142
1140
|
*/
|
|
1143
1141
|
function _performApplyAfterOnPropertyArray(io_basePropertyChanges, in_appliedPropertyChanges, in_typeid, in_options) {
|
|
1144
1142
|
property_common_1.ConsoleUtils.assert(in_typeid, "_performApplyAfterOnPropertyArray: typeid missing");
|
|
@@ -1430,7 +1428,7 @@ var ChangeSetArrayFunctions;
|
|
|
1430
1428
|
*
|
|
1431
1429
|
* @param in_ownPropertyChangeSet - The ChangeSet for the property stored in this object
|
|
1432
1430
|
* @param io_rebasePropertyChangeSetParent - The Array containing the ChangeSet for the property to be rebased
|
|
1433
|
-
* @param in_key
|
|
1431
|
+
* @param in_key - The key to the ChangeSet in io_rebasePropertyChangeSetParent we are rebasing on
|
|
1434
1432
|
* @param in_basePath - Base path to get to the property processed by this function
|
|
1435
1433
|
* @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict
|
|
1436
1434
|
*/
|