44 * This source code is licensed under the MIT license found in the
55 * LICENSE file in the root directory of this source tree.
66 *
7- * @flow
87 */
98
109// This diff-sequences package implements the linear space variation in
@@ -66,10 +65,10 @@ type FoundSubsequence = (
6665) => void ;
6766
6867// Either original functions or wrapped to swap indexes if graph is transposed.
69- type Callbacks = { |
70- foundSubsequence : FoundSubsequence ,
71- isCommon : IsCommon ,
72- | } ;
68+ type Callbacks = {
69+ foundSubsequence : FoundSubsequence ;
70+ isCommon : IsCommon ;
71+ } ;
7372
7473// Indexes in sequence a of last point of forward or reverse paths in graph.
7574// Myers algorithm indexes by diagonal k which for negative is bad deopt in V8.
@@ -81,25 +80,25 @@ type Indexes = Array<number>;
8180
8281// Division of index intervals in sequences a and b at the middle change.
8382// Invariant: intervals do not have common items at the start or end.
84- type Division = { |
83+ type Division = {
8584 // The end of interval preceding division is open like array slice method.
86- nChangePreceding : number , // number of change items
87- aEndPreceding : number ,
88- bEndPreceding : number ,
85+ nChangePreceding : number ; // number of change items
86+ aEndPreceding : number ;
87+ bEndPreceding : number ;
8988
90- nCommonPreceding : number , // 0 if no common items preceding middle change
91- aCommonPreceding : number , // ignore prop value if nCommonPreceding === 0
92- bCommonPreceding : number , // ignore prop value if nCommonPreceding === 0
89+ nCommonPreceding : number ; // 0 if no common items preceding middle change
90+ aCommonPreceding : number ; // ignore prop value if nCommonPreceding === 0
91+ bCommonPreceding : number ; // ignore prop value if nCommonPreceding === 0
9392
94- nCommonFollowing : number , // 0 if no common items following middle change
95- aCommonFollowing : number , // ignore prop value if nCommonFollowing === 0
96- bCommonFollowing : number , // ignore prop value if nCommonFollowing === 0
93+ nCommonFollowing : number ; // 0 if no common items following middle change
94+ aCommonFollowing : number ; // ignore prop value if nCommonFollowing === 0
95+ bCommonFollowing : number ; // ignore prop value if nCommonFollowing === 0
9796
9897 // The start of interval following division is closed like array slice method.
99- nChangeFollowing : number , // number of change items
100- aStartFollowing : number ,
101- bStartFollowing : number ,
102- | } ;
98+ nChangeFollowing : number ; // number of change items
99+ aStartFollowing : number ;
100+ bStartFollowing : number ;
101+ } ;
103102
104103const pkg = 'diff-sequences' ; // for error messages
105104const NOT_YET_SET = 0 ; // small int instead of undefined to avoid deopt in V8
0 commit comments