@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
|
@@ -33,11 +33,10 @@ var ArrayChangeSetRangeType;
|
|
|
33
33
|
ArrayChangeSetRangeType[ArrayChangeSetRangeType["partOfApartOfB"] = 7] = "partOfApartOfB";
|
|
34
34
|
})(ArrayChangeSetRangeType || (ArrayChangeSetRangeType = {}));
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
* @param io_operation
|
|
38
|
-
* @param in_aOffset
|
|
39
|
-
* @param io_resultingRange
|
|
40
|
-
* the computed range
|
|
36
|
+
* Computes a range for an operation of the current change set
|
|
37
|
+
* @param io_operation - Input
|
|
38
|
+
* @param in_aOffset - The offset that needs to be added to transform the operation
|
|
39
|
+
* @param io_resultingRange - The computed range
|
|
41
40
|
*/
|
|
42
41
|
const getRangeForCurrentStateOperation = function (io_operation, in_aOffset, io_resultingRange) {
|
|
43
42
|
if (!io_operation) {
|
|
@@ -81,10 +80,10 @@ const getRangeForCurrentStateOperation = function (io_operation, in_aOffset, io_
|
|
|
81
80
|
};
|
|
82
81
|
const getOpLength = (op) => isNumber(op[1]) ? op[1] : op[1].length;
|
|
83
82
|
/**
|
|
84
|
-
*
|
|
85
|
-
* @param in_operation
|
|
86
|
-
* @param io_resultingRange
|
|
87
|
-
* @param in_flag
|
|
83
|
+
* Computes the impact range for a given operation of the applied change set
|
|
84
|
+
* @param in_operation - The op
|
|
85
|
+
* @param io_resultingRange - The computed range
|
|
86
|
+
* @param in_flag - The flag for the resulting range, default is 'complete B'
|
|
88
87
|
* @param in_options - Optional additional parameters
|
|
89
88
|
*/
|
|
90
89
|
const getRangeForAppliedOperation = function (in_operation, io_resultingRange, in_flag, in_options) {
|
|
@@ -149,10 +148,10 @@ const getRangeForAppliedOperation = function (in_operation, io_resultingRange, i
|
|
|
149
148
|
* Splits the second and third parameter in an array remove or modify operation into two segments.
|
|
150
149
|
* This treats the three possible cases array, string and length that are allowed in a remove operation
|
|
151
150
|
*
|
|
152
|
-
* @param in_firstResult
|
|
151
|
+
* @param in_firstResult - Place where the first half is stored
|
|
153
152
|
* @param in_secondResult - Place where the second half is stored
|
|
154
|
-
* @param in_data
|
|
155
|
-
* @param in_start
|
|
153
|
+
* @param in_data - The original operation
|
|
154
|
+
* @param in_start - Index at which the operation is split
|
|
156
155
|
* @private
|
|
157
156
|
*/
|
|
158
157
|
const _splitArrayParameter = function (in_firstResult, in_secondResult, in_data, in_start) {
|
|
@@ -230,13 +229,13 @@ const _copyOperation = function (in_sourceOperation, in_targetOperation) {
|
|
|
230
229
|
/**
|
|
231
230
|
* cut overlapping ranges in non-overlapping and completely overlapping segments
|
|
232
231
|
* ranges of length 0 just cut lengthy ranges
|
|
233
|
-
* @param io_rangeA
|
|
234
|
-
* @param io_rangeB
|
|
235
|
-
* @param io_resultingSegment
|
|
236
|
-
* @param in_rebasing
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
232
|
+
* @param io_rangeA - Input A
|
|
233
|
+
* @param io_rangeB - Input B
|
|
234
|
+
* @param io_resultingSegment - The resulting overlapping segment
|
|
235
|
+
* @param in_rebasing - Is this function called for rebasing - we have to implement two different
|
|
236
|
+
* behaviors of this function: one for squashing and one for rebasing, because an insert-insert
|
|
237
|
+
* operation in squashing should be separte segments, while for rebasing, we need one segment
|
|
238
|
+
* for both inserts to be able to report a conflict.
|
|
240
239
|
* overlapping range or
|
|
241
240
|
* (partial) A or B
|
|
242
241
|
*/
|
|
@@ -550,9 +549,9 @@ const splitOverlapping = function (io_rangeA, io_rangeB, io_resultingSegment, in
|
|
|
550
549
|
/**
|
|
551
550
|
* merge in_op with the last op of that category in io_changeset (if possible)
|
|
552
551
|
* e.g. merge an delete [1,3] with delete [3,2] to delete [1,5]
|
|
553
|
-
* @param in_op -
|
|
554
|
-
* @param io_changeset -
|
|
555
|
-
* @param in_targetIndex
|
|
552
|
+
* @param in_op - The op to merge
|
|
553
|
+
* @param io_changeset - The changeset to merge the op to
|
|
554
|
+
* @param in_targetIndex - The transformed target index offset
|
|
556
555
|
* @returns true if the merge was possible and executed
|
|
557
556
|
*/
|
|
558
557
|
const mergeWithLastIfPossible = function (in_op, io_changeset, in_targetIndex, in_options) {
|
|
@@ -640,12 +639,12 @@ const mergeWithLastIfPossible = function (in_op, io_changeset, in_targetIndex, i
|
|
|
640
639
|
};
|
|
641
640
|
/**
|
|
642
641
|
* push an operation to a changeset, will try to merge the op if possible
|
|
643
|
-
* @param in_op
|
|
644
|
-
* @param io_changeset target
|
|
645
|
-
* @param the current offset
|
|
642
|
+
* @param in_op - The operation we want to push
|
|
643
|
+
* @param io_changeset - The target
|
|
644
|
+
* @param the - The current offset
|
|
646
645
|
* @param in_options - Optional additional parameters
|
|
647
|
-
* @param in_lastIteratorARemove -
|
|
648
|
-
* @param in_segment -
|
|
646
|
+
* @param in_lastIteratorARemove - The information about the last remove operation in iterator A
|
|
647
|
+
* @param in_segment - The segment this operation is part of
|
|
649
648
|
*/
|
|
650
649
|
const pushOp = function (in_op, io_changeset, in_indexOffset, in_options, in_lastIteratorARemove, in_segment) {
|
|
651
650
|
let writeTargetIndex;
|
|
@@ -723,8 +722,8 @@ const pushOp = function (in_op, io_changeset, in_indexOffset, in_options, in_las
|
|
|
723
722
|
/**
|
|
724
723
|
* handle combinations of range operations
|
|
725
724
|
* e.g. an insert and delete at the same place and same length nullify each other
|
|
726
|
-
* @param in_segment
|
|
727
|
-
* @param in_isPrimitiveType
|
|
725
|
+
* @param in_segment - The two ops to be combined
|
|
726
|
+
* @param in_isPrimitiveType - Is it an array of primitive types
|
|
728
727
|
* ATTENTION: We overwrite opB to save garbage (instead of creating a result OP)
|
|
729
728
|
*/
|
|
730
729
|
const handleCombinations = function (in_segment, in_isPrimitiveType) {
|
|
@@ -884,15 +883,14 @@ const arraysHaveSameValues = function (in_arr1, in_arr2) {
|
|
|
884
883
|
* | [rem orig. data]| (note the user) | [rem dupl. rem] |
|
|
885
884
|
* -------|-----------------+------------------+------------------|
|
|
886
885
|
*
|
|
887
|
-
* @param {{opA:{}, opB:{}}} in_segment
|
|
888
|
-
* @param {Array.<property-changeset.ChangeSet.ConflictInfo>} out_conflicts -
|
|
889
|
-
*
|
|
890
|
-
* @param {string} in_basePath -
|
|
891
|
-
*
|
|
892
|
-
* @param {boolean} in_isPrimitiveType is it an array of primitive types
|
|
886
|
+
* @param {{opA:{}, opB:{}}} in_segment - The two ops to be combined
|
|
887
|
+
* @param {Array.<property-changeset.ChangeSet.ConflictInfo>} out_conflicts - A list of paths that resulted in
|
|
888
|
+
* conflicts together with the type of the conflict
|
|
889
|
+
* @param {string} in_basePath - Base path to get to the property processed by this function
|
|
890
|
+
* @param {boolean} in_isPrimitiveType - is it an array of primitive types
|
|
893
891
|
* @param {Object} [in_options] - Optional additional parameters
|
|
894
892
|
* @param {Map} [in_options.applyAfterMetaInformation] - Additional meta information which help later to obtain
|
|
895
|
-
*
|
|
893
|
+
* more compact changeset during the apply operation
|
|
896
894
|
*/
|
|
897
895
|
const handleRebaseCombinations = function (in_segment, out_conflicts, in_basePath, in_isPrimitiveType, in_options) {
|
|
898
896
|
const opA = in_segment.opA;
|
|
@@ -1068,10 +1066,10 @@ const handleRebaseCombinations = function (in_segment, out_conflicts, in_basePat
|
|
|
1068
1066
|
};
|
|
1069
1067
|
/**
|
|
1070
1068
|
* apply a range's operation to the changeset
|
|
1071
|
-
* @param in_segment to be applied
|
|
1072
|
-
* @param io_changeset target
|
|
1073
|
-
* @param in_currentIndexOffset current offset
|
|
1074
|
-
* @param in_isPrimitiveType is it an array of primitive types
|
|
1069
|
+
* @param in_segment - to be applied
|
|
1070
|
+
* @param io_changeset - target
|
|
1071
|
+
* @param in_currentIndexOffset - current offset
|
|
1072
|
+
* @param in_isPrimitiveType - is it an array of primitive types
|
|
1075
1073
|
*/
|
|
1076
1074
|
const applySegment = function (in_segment, io_changeset, in_currentIndexOffset, lastIteratorARemove, in_isPrimitiveType, in_options) {
|
|
1077
1075
|
if (!in_segment) {
|
|
@@ -1097,12 +1095,12 @@ const applySegment = function (in_segment, io_changeset, in_currentIndexOffset,
|
|
|
1097
1095
|
};
|
|
1098
1096
|
/**
|
|
1099
1097
|
* apply a range's operation to the rebased changeset
|
|
1100
|
-
* @param in_segment to be applied
|
|
1101
|
-
* @param io_changeset target
|
|
1102
|
-
* @param in_currentIndexOffset current offset
|
|
1098
|
+
* @param in_segment - to be applied
|
|
1099
|
+
* @param io_changeset - target
|
|
1100
|
+
* @param in_currentIndexOffset - current offset
|
|
1103
1101
|
* @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict
|
|
1104
1102
|
* @param in_basePath - Base path to get to the property processed by this function
|
|
1105
|
-
* @param in_isPrimitiveType is it an array of primitive types
|
|
1103
|
+
* @param in_isPrimitiveType - is it an array of primitive types
|
|
1106
1104
|
*/
|
|
1107
1105
|
const applyRebaseSegment = function (in_segment, io_changeset, in_currentIndexOffset, out_conflicts, in_basePath, in_isPrimitiveType, in_options) {
|
|
1108
1106
|
if (!in_segment) {
|
|
@@ -1130,9 +1128,9 @@ export var ChangeSetArrayFunctions;
|
|
|
1130
1128
|
* property root and it will be applied behind the base ChangeSet (assuming that the changes are relative to the
|
|
1131
1129
|
* state after the base ChangeSet has been applied. It will change the base ChangeSet.)
|
|
1132
1130
|
*
|
|
1133
|
-
* @param io_basePropertyChanges
|
|
1131
|
+
* @param io_basePropertyChanges - The ChangeSet describing the initial state
|
|
1134
1132
|
* @param in_appliedPropertyChanges - The ChangeSet to apply to this state
|
|
1135
|
-
* @param in_typeid
|
|
1133
|
+
* @param in_typeid - The typeid of the contents of the collection (without the collection type)
|
|
1136
1134
|
*/
|
|
1137
1135
|
function _performApplyAfterOnPropertyArray(io_basePropertyChanges, in_appliedPropertyChanges, in_typeid, in_options) {
|
|
1138
1136
|
ConsoleUtils.assert(in_typeid, "_performApplyAfterOnPropertyArray: typeid missing");
|
|
@@ -1424,7 +1422,7 @@ export var ChangeSetArrayFunctions;
|
|
|
1424
1422
|
*
|
|
1425
1423
|
* @param in_ownPropertyChangeSet - The ChangeSet for the property stored in this object
|
|
1426
1424
|
* @param io_rebasePropertyChangeSetParent - The Array containing the ChangeSet for the property to be rebased
|
|
1427
|
-
* @param in_key
|
|
1425
|
+
* @param in_key - The key to the ChangeSet in io_rebasePropertyChangeSetParent we are rebasing on
|
|
1428
1426
|
* @param in_basePath - Base path to get to the property processed by this function
|
|
1429
1427
|
* @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict
|
|
1430
1428
|
*/
|