@fluidframework/merge-tree 0.58.1001 → 0.58.2000-58133
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/DEV.md +9 -0
- package/dist/base.js.map +1 -1
- package/dist/mergeTree.d.ts.map +1 -1
- package/dist/mergeTree.js +26 -23
- package/dist/mergeTree.js.map +1 -1
- package/dist/mergeTreeDeltaCallback.d.ts.map +1 -1
- package/dist/mergeTreeDeltaCallback.js.map +1 -1
- package/dist/partialLengths.d.ts.map +1 -1
- package/dist/partialLengths.js +2 -2
- package/dist/partialLengths.js.map +1 -1
- package/dist/properties.d.ts.map +1 -1
- package/dist/properties.js +9 -2
- package/dist/properties.js.map +1 -1
- package/dist/segmentPropertiesManager.d.ts.map +1 -1
- package/dist/segmentPropertiesManager.js +4 -0
- package/dist/segmentPropertiesManager.js.map +1 -1
- package/dist/textSegment.d.ts.map +1 -1
- package/dist/textSegment.js.map +1 -1
- package/lib/base.js.map +1 -1
- package/lib/mergeTree.d.ts.map +1 -1
- package/lib/mergeTree.js +26 -23
- package/lib/mergeTree.js.map +1 -1
- package/lib/mergeTreeDeltaCallback.d.ts.map +1 -1
- package/lib/mergeTreeDeltaCallback.js.map +1 -1
- package/lib/partialLengths.d.ts.map +1 -1
- package/lib/partialLengths.js +2 -2
- package/lib/partialLengths.js.map +1 -1
- package/lib/properties.d.ts.map +1 -1
- package/lib/properties.js +9 -2
- package/lib/properties.js.map +1 -1
- package/lib/segmentPropertiesManager.d.ts.map +1 -1
- package/lib/segmentPropertiesManager.js +4 -0
- package/lib/segmentPropertiesManager.js.map +1 -1
- package/lib/textSegment.d.ts.map +1 -1
- package/lib/textSegment.js.map +1 -1
- package/package.json +14 -10
- package/src/base.ts +2 -2
- package/src/mergeTree.ts +31 -34
- package/src/mergeTreeDeltaCallback.ts +1 -0
- package/src/partialLengths.ts +2 -4
- package/src/properties.ts +9 -3
- package/src/segmentPropertiesManager.ts +4 -3
- package/src/textSegment.ts +0 -1
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/merge-tree",
|
|
3
|
-
"version": "0.58.
|
|
3
|
+
"version": "0.58.2000-58133",
|
|
4
4
|
"description": "Merge tree",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
|
-
"repository":
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/microsoft/FluidFramework.git",
|
|
9
|
+
"directory": "packages/dds/merge-tree"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "Microsoft and contributors",
|
|
9
13
|
"sideEffects": false,
|
|
@@ -58,18 +62,18 @@
|
|
|
58
62
|
"@fluidframework/common-utils": "^0.32.1",
|
|
59
63
|
"@fluidframework/container-definitions": "^0.47.1000",
|
|
60
64
|
"@fluidframework/core-interfaces": "^0.42.0",
|
|
61
|
-
"@fluidframework/datastore-definitions": "
|
|
65
|
+
"@fluidframework/datastore-definitions": "0.58.2000-58133",
|
|
62
66
|
"@fluidframework/protocol-definitions": "^0.1027.1000",
|
|
63
|
-
"@fluidframework/runtime-definitions": "
|
|
64
|
-
"@fluidframework/runtime-utils": "
|
|
65
|
-
"@fluidframework/shared-object-base": "
|
|
66
|
-
"@fluidframework/telemetry-utils": "
|
|
67
|
+
"@fluidframework/runtime-definitions": "0.58.2000-58133",
|
|
68
|
+
"@fluidframework/runtime-utils": "0.58.2000-58133",
|
|
69
|
+
"@fluidframework/shared-object-base": "0.58.2000-58133",
|
|
70
|
+
"@fluidframework/telemetry-utils": "0.58.2000-58133"
|
|
67
71
|
},
|
|
68
72
|
"devDependencies": {
|
|
69
73
|
"@fluidframework/build-common": "^0.23.0",
|
|
70
|
-
"@fluidframework/eslint-config-fluid": "^0.
|
|
71
|
-
"@fluidframework/mocha-test-setup": "
|
|
72
|
-
"@fluidframework/test-runtime-utils": "
|
|
74
|
+
"@fluidframework/eslint-config-fluid": "^0.27.0",
|
|
75
|
+
"@fluidframework/mocha-test-setup": "0.58.2000-58133",
|
|
76
|
+
"@fluidframework/test-runtime-utils": "0.58.2000-58133",
|
|
73
77
|
"@microsoft/api-extractor": "^7.16.1",
|
|
74
78
|
"@rushstack/eslint-config": "^2.5.1",
|
|
75
79
|
"@types/diff": "^3.5.1",
|
package/src/base.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface QProperty<TKey, TData> {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export interface PropertyAction<TKey, TData> {
|
|
17
|
-
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/prefer-function-type
|
|
18
18
|
<TAccum>(p: Property<TKey, TData>, accum?: TAccum): boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -35,7 +35,7 @@ export interface SortedDictionary<TKey, TData> extends Dictionary<TKey, TData> {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export interface KeyComparer<TKey> {
|
|
38
|
-
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/prefer-function-type
|
|
39
39
|
(a: TKey, b: TKey): number;
|
|
40
40
|
}
|
|
41
41
|
/**
|
package/src/mergeTree.ts
CHANGED
|
@@ -149,12 +149,12 @@ export interface ISegment extends IMergeNodeCommon, IRemovalInfo {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
export interface IMarkerModifiedAction {
|
|
152
|
-
|
|
152
|
+
// eslint-disable-next-line @typescript-eslint/prefer-function-type
|
|
153
153
|
(marker: Marker): void;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
export interface ISegmentAction<TClientData> {
|
|
157
|
-
|
|
157
|
+
// eslint-disable-next-line @typescript-eslint/prefer-function-type
|
|
158
158
|
(segment: ISegment, pos: number, refSeq: number, clientId: number, start: number,
|
|
159
159
|
end: number, accum: TClientData): boolean;
|
|
160
160
|
}
|
|
@@ -165,7 +165,7 @@ export interface ISegmentChanges {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
export interface BlockAction<TClientData> {
|
|
168
|
-
|
|
168
|
+
// eslint-disable-next-line @typescript-eslint/prefer-function-type
|
|
169
169
|
(
|
|
170
170
|
block: IMergeBlock,
|
|
171
171
|
pos: number,
|
|
@@ -178,7 +178,7 @@ export interface BlockAction<TClientData> {
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
export interface NodeAction<TClientData> {
|
|
181
|
-
|
|
181
|
+
// eslint-disable-next-line @typescript-eslint/prefer-function-type
|
|
182
182
|
(
|
|
183
183
|
node: IMergeNode,
|
|
184
184
|
pos: number,
|
|
@@ -258,7 +258,6 @@ export class MergeNode implements IMergeNodeCommon {
|
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
|
|
262
261
|
function addTile(tile: ReferencePosition, tiles: object) {
|
|
263
262
|
const tileLabels = tile.getTileLabels();
|
|
264
263
|
if (tileLabels) {
|
|
@@ -268,7 +267,6 @@ function addTile(tile: ReferencePosition, tiles: object) {
|
|
|
268
267
|
}
|
|
269
268
|
}
|
|
270
269
|
|
|
271
|
-
|
|
272
270
|
function addTileIfNotPresent(tile: ReferencePosition, tiles: object) {
|
|
273
271
|
const tileLabels = tile.getTileLabels();
|
|
274
272
|
if (tileLabels) {
|
|
@@ -281,7 +279,7 @@ function addTileIfNotPresent(tile: ReferencePosition, tiles: object) {
|
|
|
281
279
|
}
|
|
282
280
|
|
|
283
281
|
function applyStackDelta(currentStackMap: RangeStackMap, deltaStackMap: RangeStackMap) {
|
|
284
|
-
// eslint-disable-next-line guard-for-in
|
|
282
|
+
// eslint-disable-next-line guard-for-in, no-restricted-syntax
|
|
285
283
|
for (const label in deltaStackMap) {
|
|
286
284
|
const deltaStack = deltaStackMap[label];
|
|
287
285
|
if (!deltaStack.empty()) {
|
|
@@ -459,7 +457,7 @@ class HierMergeBlock extends MergeBlock implements IMergeBlock {
|
|
|
459
457
|
|
|
460
458
|
public hierToString(indentCount: number) {
|
|
461
459
|
let strbuf = "";
|
|
462
|
-
// eslint-disable-next-line guard-for-in
|
|
460
|
+
// eslint-disable-next-line guard-for-in, no-restricted-syntax
|
|
463
461
|
for (const key in this.rangeStacks) {
|
|
464
462
|
const stack = this.rangeStacks[key];
|
|
465
463
|
strbuf += internedSpaces(indentCount);
|
|
@@ -557,7 +555,7 @@ export abstract class BaseSegment extends MergeNode implements ISegment {
|
|
|
557
555
|
return true;
|
|
558
556
|
|
|
559
557
|
case MergeTreeDeltaType.REMOVE:
|
|
560
|
-
|
|
558
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
561
559
|
const removalInfo: IRemovalInfo = this;
|
|
562
560
|
assert(!!removalInfo, 0x046 /* "On remove ack, missing removal info!" */);
|
|
563
561
|
assert(!!removalInfo.removedSeq, 0x047 /* "On remove ack, missing removed sequence number!" */);
|
|
@@ -812,6 +810,7 @@ export class Marker extends BaseSegment implements ReferencePosition {
|
|
|
812
810
|
// (Substitute a debug string instead.)
|
|
813
811
|
const handle = !!value && value.IFluidHandle;
|
|
814
812
|
|
|
813
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
815
814
|
return handle
|
|
816
815
|
? `#Handle(${handle.routeContext.path}/${handle.path})`
|
|
817
816
|
: value;
|
|
@@ -1155,6 +1154,7 @@ export class MergeTree {
|
|
|
1155
1154
|
this.blockUpdate(block);
|
|
1156
1155
|
}
|
|
1157
1156
|
|
|
1157
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
1158
1158
|
return blocks.length === 1 // If there is only one block at this layer...
|
|
1159
1159
|
? blocks[0] // ...then we're done. Return the root.
|
|
1160
1160
|
: buildMergeBlock(blocks); // ...otherwise recursively build the next layer above blocks.
|
|
@@ -1344,9 +1344,7 @@ export class MergeTree {
|
|
|
1344
1344
|
}
|
|
1345
1345
|
|
|
1346
1346
|
if (this.underflow(block) && block.parent) {
|
|
1347
|
-
|
|
1348
1347
|
this.packParent(block.parent);
|
|
1349
|
-
|
|
1350
1348
|
} else {
|
|
1351
1349
|
this.nodeUpdateOrdinals(block);
|
|
1352
1350
|
this.blockUpdatePathLengths(block, UnassignedSequenceNumber, -1, true);
|
|
@@ -1383,8 +1381,8 @@ export class MergeTree {
|
|
|
1383
1381
|
stats.leafCount += childStats.leafCount;
|
|
1384
1382
|
stats.removedLeafCount += childStats.removedLeafCount;
|
|
1385
1383
|
stats.liveCount += childStats.liveCount;
|
|
1386
|
-
for (let
|
|
1387
|
-
stats.histo[
|
|
1384
|
+
for (let j = 0; j < MaxNodesInBlock; j++) {
|
|
1385
|
+
stats.histo[j] += childStats.histo[j];
|
|
1388
1386
|
}
|
|
1389
1387
|
} else {
|
|
1390
1388
|
stats.leafCount++;
|
|
@@ -1438,7 +1436,7 @@ export class MergeTree {
|
|
|
1438
1436
|
let segment: T | undefined;
|
|
1439
1437
|
let offset: number | undefined;
|
|
1440
1438
|
|
|
1441
|
-
const leaf = (leafSeg: ISegment, segpos: number,
|
|
1439
|
+
const leaf = (leafSeg: ISegment, segpos: number, _refSeq: number, _clientId: number, start: number) => {
|
|
1442
1440
|
segment = leafSeg as T;
|
|
1443
1441
|
offset = start;
|
|
1444
1442
|
return false;
|
|
@@ -1954,8 +1952,7 @@ export class MergeTree {
|
|
|
1954
1952
|
remoteClientPosition: number,
|
|
1955
1953
|
remoteClientRefSeq: number,
|
|
1956
1954
|
remoteClientId: number): number | undefined {
|
|
1957
|
-
|
|
1958
|
-
if(remoteClientRefSeq < this.collabWindow.minSeq){
|
|
1955
|
+
if(remoteClientRefSeq < this.collabWindow.minSeq) {
|
|
1959
1956
|
return undefined;
|
|
1960
1957
|
}
|
|
1961
1958
|
|
|
@@ -1998,7 +1995,7 @@ export class MergeTree {
|
|
|
1998
1995
|
newSegments: T[],
|
|
1999
1996
|
) {
|
|
2000
1997
|
let segIsLocal = false;
|
|
2001
|
-
const checkSegmentIsLocal = (segment: ISegment,
|
|
1998
|
+
const checkSegmentIsLocal = (segment: ISegment, _pos: number, _refSeq: number, _clientId: number) => {
|
|
2002
1999
|
if (segment.seq === UnassignedSequenceNumber) {
|
|
2003
2000
|
segIsLocal = true;
|
|
2004
2001
|
}
|
|
@@ -2029,7 +2026,7 @@ export class MergeTree {
|
|
|
2029
2026
|
}
|
|
2030
2027
|
}
|
|
2031
2028
|
};
|
|
2032
|
-
const onLeaf = (segment: ISegment | undefined,
|
|
2029
|
+
const onLeaf = (segment: ISegment | undefined, _pos: number, context: InsertContext) => {
|
|
2033
2030
|
const segmentChanges: ISegmentChanges = {};
|
|
2034
2031
|
if (segment) {
|
|
2035
2032
|
// Insert before segment
|
|
@@ -2124,23 +2121,23 @@ export class MergeTree {
|
|
|
2124
2121
|
while (parent) {
|
|
2125
2122
|
const children = parent.children;
|
|
2126
2123
|
let childIndex: number;
|
|
2127
|
-
let
|
|
2124
|
+
let _node: IMergeNode;
|
|
2128
2125
|
let matchedStart = false;
|
|
2129
2126
|
for (childIndex = parent.childCount - 1; childIndex >= 0; childIndex--) {
|
|
2130
|
-
|
|
2127
|
+
_node = children[childIndex];
|
|
2131
2128
|
if (matchedStart) {
|
|
2132
|
-
if (!
|
|
2133
|
-
const childBlock =
|
|
2129
|
+
if (!_node.isLeaf()) {
|
|
2130
|
+
const childBlock = _node;
|
|
2134
2131
|
go = this.nodeMapReverse(childBlock, leafAction, 0, UniversalSequenceNumber,
|
|
2135
2132
|
this.collabWindow.clientId);
|
|
2136
2133
|
} else {
|
|
2137
|
-
go = leafAction(
|
|
2134
|
+
go = leafAction(_node, 0, UniversalSequenceNumber, this.collabWindow.clientId, 0, 0, undefined);
|
|
2138
2135
|
}
|
|
2139
2136
|
if (!go) {
|
|
2140
2137
|
return;
|
|
2141
2138
|
}
|
|
2142
2139
|
} else {
|
|
2143
|
-
matchedStart = (startNode ===
|
|
2140
|
+
matchedStart = (startNode === _node);
|
|
2144
2141
|
}
|
|
2145
2142
|
}
|
|
2146
2143
|
startNode = parent;
|
|
@@ -2157,23 +2154,23 @@ export class MergeTree {
|
|
|
2157
2154
|
while (parent) {
|
|
2158
2155
|
const children = parent.children;
|
|
2159
2156
|
let childIndex: number;
|
|
2160
|
-
let
|
|
2157
|
+
let _node: IMergeNode;
|
|
2161
2158
|
let matchedStart = false;
|
|
2162
2159
|
for (childIndex = 0; childIndex < parent.childCount; childIndex++) {
|
|
2163
|
-
|
|
2160
|
+
_node = children[childIndex];
|
|
2164
2161
|
if (matchedStart) {
|
|
2165
|
-
if (!
|
|
2166
|
-
const childBlock =
|
|
2162
|
+
if (!_node.isLeaf()) {
|
|
2163
|
+
const childBlock = _node;
|
|
2167
2164
|
go = this.nodeMap(childBlock, actions, 0, UniversalSequenceNumber, this.collabWindow.clientId,
|
|
2168
2165
|
undefined);
|
|
2169
2166
|
} else {
|
|
2170
|
-
go = leafAction(
|
|
2167
|
+
go = leafAction(_node, 0, UniversalSequenceNumber, this.collabWindow.clientId, 0, 0, undefined);
|
|
2171
2168
|
}
|
|
2172
2169
|
if (!go) {
|
|
2173
2170
|
return;
|
|
2174
2171
|
}
|
|
2175
2172
|
} else {
|
|
2176
|
-
matchedStart = (startNode ===
|
|
2173
|
+
matchedStart = (startNode === _node);
|
|
2177
2174
|
}
|
|
2178
2175
|
}
|
|
2179
2176
|
startNode = parent;
|
|
@@ -2384,7 +2381,7 @@ export class MergeTree {
|
|
|
2384
2381
|
const removedSegments: IMergeTreeSegmentDelta[] = [];
|
|
2385
2382
|
const savedLocalRefs: LocalReferenceCollection[] = [];
|
|
2386
2383
|
const localSeq = seq === UnassignedSequenceNumber ? ++this.collabWindow.localSeq : undefined;
|
|
2387
|
-
const markRemoved = (segment: ISegment, pos: number,
|
|
2384
|
+
const markRemoved = (segment: ISegment, pos: number, _start: number, _end: number) => {
|
|
2388
2385
|
const removalInfo: IRemovalInfo = segment;
|
|
2389
2386
|
if (removalInfo.removedSeq !== undefined) {
|
|
2390
2387
|
_overwrite = true;
|
|
@@ -2412,8 +2409,8 @@ export class MergeTree {
|
|
|
2412
2409
|
// Save segment so can assign removed sequence number when acked by server
|
|
2413
2410
|
if (this.collabWindow.collaborating) {
|
|
2414
2411
|
// Use removal information
|
|
2415
|
-
const
|
|
2416
|
-
if (
|
|
2412
|
+
const _removalInfo: IRemovalInfo = segment;
|
|
2413
|
+
if (_removalInfo.removedSeq === UnassignedSequenceNumber && clientId === this.collabWindow.clientId) {
|
|
2417
2414
|
segmentGroup = this.addToPendingList(segment, segmentGroup, localSeq);
|
|
2418
2415
|
} else {
|
|
2419
2416
|
if (MergeTree.options.zamboniSegments) {
|
|
@@ -2423,7 +2420,7 @@ export class MergeTree {
|
|
|
2423
2420
|
}
|
|
2424
2421
|
return true;
|
|
2425
2422
|
};
|
|
2426
|
-
const afterMarkRemoved = (node: IMergeBlock, pos: number,
|
|
2423
|
+
const afterMarkRemoved = (node: IMergeBlock, pos: number, _start: number, _end: number) => {
|
|
2427
2424
|
if (_overwrite) {
|
|
2428
2425
|
this.nodeUpdateLengthNewStructure(node);
|
|
2429
2426
|
} else {
|
|
@@ -75,6 +75,7 @@ export interface IMergeTreeClientSequenceArgs {
|
|
|
75
75
|
export type MergeTreeDeltaCallback =
|
|
76
76
|
(opArgs: IMergeTreeDeltaOpArgs, deltaArgs: IMergeTreeDeltaCallbackArgs) => void;
|
|
77
77
|
|
|
78
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
78
79
|
export interface IMergeTreeMaintenanceCallbackArgs extends IMergeTreeDeltaCallbackArgs<MergeTreeMaintenanceType> { }
|
|
79
80
|
|
|
80
81
|
export type MergeTreeMaintenanceCallback =
|
package/src/partialLengths.ts
CHANGED
|
@@ -186,7 +186,6 @@ export class PartialSequenceLengths {
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
if (outerIndexOfEarliest >= 0) {
|
|
189
|
-
|
|
190
189
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
191
190
|
addNext(earliestPartialLength!);
|
|
192
191
|
indices[outerIndexOfEarliest]++;
|
|
@@ -367,7 +366,6 @@ export class PartialSequenceLengths {
|
|
|
367
366
|
}
|
|
368
367
|
}
|
|
369
368
|
if (seqPartialLen === undefined) {
|
|
370
|
-
|
|
371
369
|
seqPartialLen = {
|
|
372
370
|
clientId,
|
|
373
371
|
seglen: seqSeglen,
|
|
@@ -488,7 +486,7 @@ export class PartialSequenceLengths {
|
|
|
488
486
|
buf += `(${partial.seq},${partial.len}) `;
|
|
489
487
|
}
|
|
490
488
|
|
|
491
|
-
// eslint-disable-next-line @typescript-eslint/no-for-in-array
|
|
489
|
+
// eslint-disable-next-line @typescript-eslint/no-for-in-array, no-restricted-syntax
|
|
492
490
|
for (const clientId in this.clientSeqNumbers) {
|
|
493
491
|
if (this.clientSeqNumbers[clientId].length > 0) {
|
|
494
492
|
buf += `Client `;
|
|
@@ -530,7 +528,7 @@ export class PartialSequenceLengths {
|
|
|
530
528
|
return minLength;
|
|
531
529
|
}
|
|
532
530
|
this.minLength += copyDown(this.partialLengths);
|
|
533
|
-
// eslint-disable-next-line @typescript-eslint/no-for-in-array, guard-for-in
|
|
531
|
+
// eslint-disable-next-line @typescript-eslint/no-for-in-array, guard-for-in, no-restricted-syntax
|
|
534
532
|
for (const clientId in this.clientSeqNumbers) {
|
|
535
533
|
const cliPartials = this.clientSeqNumbers[clientId];
|
|
536
534
|
if (cliPartials) {
|
package/src/properties.ts
CHANGED
|
@@ -55,8 +55,11 @@ export function combine(combiningInfo: ICombiningOp, currentValue: any, newValue
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
break;
|
|
58
|
+
default:
|
|
59
|
+
break;
|
|
58
60
|
}
|
|
59
61
|
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
60
63
|
return _currentValue;
|
|
61
64
|
}
|
|
62
65
|
|
|
@@ -67,6 +70,7 @@ export function matchProperties(a: PropertySet | undefined, b: PropertySet | und
|
|
|
67
70
|
} else {
|
|
68
71
|
// For now, straightforward; later use hashing
|
|
69
72
|
|
|
73
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
70
74
|
for (const key in a) {
|
|
71
75
|
if (b[key] === undefined) {
|
|
72
76
|
return false;
|
|
@@ -79,6 +83,7 @@ export function matchProperties(a: PropertySet | undefined, b: PropertySet | und
|
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
85
|
|
|
86
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
82
87
|
for (const key in b) {
|
|
83
88
|
if (a[key] === undefined) {
|
|
84
89
|
return false;
|
|
@@ -100,10 +105,11 @@ export function extend<T>(
|
|
|
100
105
|
seq?: number,
|
|
101
106
|
) {
|
|
102
107
|
if (extension !== undefined) {
|
|
103
|
-
// eslint-disable-next-line guard-for-in
|
|
108
|
+
// eslint-disable-next-line guard-for-in, no-restricted-syntax
|
|
104
109
|
for (const key in extension) {
|
|
105
110
|
const v = extension[key];
|
|
106
111
|
if (v === null) {
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
107
113
|
delete base[key];
|
|
108
114
|
} else {
|
|
109
115
|
if (combiningOp && (combiningOp.name !== "rewrite")) {
|
|
@@ -122,7 +128,7 @@ export function clone<T>(extension: MapLike<T> | undefined) {
|
|
|
122
128
|
return undefined;
|
|
123
129
|
}
|
|
124
130
|
const cloneMap = createMap<T>();
|
|
125
|
-
// eslint-disable-next-line guard-for-in
|
|
131
|
+
// eslint-disable-next-line guard-for-in, no-restricted-syntax
|
|
126
132
|
for (const key in extension) {
|
|
127
133
|
const v = extension[key];
|
|
128
134
|
if (v !== null) {
|
|
@@ -148,7 +154,7 @@ export function addProperties(
|
|
|
148
154
|
|
|
149
155
|
export function extendIfUndefined<T>(base: MapLike<T>, extension: MapLike<T> | undefined) {
|
|
150
156
|
if (extension !== undefined) {
|
|
151
|
-
|
|
157
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
152
158
|
for (const key in extension) {
|
|
153
159
|
if (base[key] === undefined) {
|
|
154
160
|
base[key] = extension[key];
|
|
@@ -33,7 +33,7 @@ export class PropertiesManager {
|
|
|
33
33
|
0x05c /* "Trying to update more annotate props than do exist!" */);
|
|
34
34
|
this.pendingKeyUpdateCount[key]--;
|
|
35
35
|
if (this.pendingKeyUpdateCount?.[key] === 0) {
|
|
36
|
-
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
37
37
|
delete this.pendingKeyUpdateCount[key];
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -78,6 +78,7 @@ export class PropertiesManager {
|
|
|
78
78
|
if (!newProps[key] && shouldModifyKey(key)) {
|
|
79
79
|
deltas[key] = oldProps[key];
|
|
80
80
|
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
81
82
|
delete oldProps[key];
|
|
82
83
|
}
|
|
83
84
|
}
|
|
@@ -105,7 +106,7 @@ export class PropertiesManager {
|
|
|
105
106
|
newValue = newProps[key];
|
|
106
107
|
}
|
|
107
108
|
if (newValue === null) {
|
|
108
|
-
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
109
110
|
delete oldProps[key];
|
|
110
111
|
} else {
|
|
111
112
|
oldProps[key] = newValue;
|
|
@@ -122,7 +123,7 @@ export class PropertiesManager {
|
|
|
122
123
|
): PropertySet | undefined {
|
|
123
124
|
if (oldProps) {
|
|
124
125
|
if (!newProps) {
|
|
125
|
-
|
|
126
|
+
// eslint-disable-next-line no-param-reassign
|
|
126
127
|
newProps = createMap<any>();
|
|
127
128
|
}
|
|
128
129
|
if (!newManager) {
|
package/src/textSegment.ts
CHANGED