@breakside/jskit 2025.14.0 → 2025.20.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/Frameworks/DOM.jsframework/Info.json +2 -2
- package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
- package/Frameworks/FontKit.jsframework/Info.json +2 -2
- package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
- package/Frameworks/Foundation.jsframework/Info.json +2 -2
- package/Frameworks/Foundation.jsframework/JS/JSDiff.js +148 -53
- package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
- package/Frameworks/Foundation.jsframework/sources.json +1 -0
- package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
- package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
- package/Info.json +2 -2
- package/Node/io.breakside.jskit-bundle.js +2 -2
- package/Root/Frameworks/APIKit/Info.yaml +1 -1
- package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/AuthKit/Info.yaml +1 -1
- package/Root/Frameworks/CSSOM/Info.yaml +1 -1
- package/Root/Frameworks/ChartKit/Info.yaml +1 -1
- package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
- package/Root/Frameworks/DBKit/Info.yaml +1 -1
- package/Root/Frameworks/DOM/Info.yaml +1 -1
- package/Root/Frameworks/Dispatch/Info.yaml +1 -1
- package/Root/Frameworks/FontKit/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/JSDiff.js +148 -53
- package/Root/Frameworks/ImageKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
- package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
- package/Root/Frameworks/PDFKit/Info.yaml +1 -1
- package/Root/Frameworks/QRKit/Info.yaml +1 -1
- package/Root/Frameworks/SearchKit/Info.yaml +1 -1
- package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/TestKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.DOM",
|
|
4
|
-
"JSBundleVersion": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.20.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "DOM+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "39a7679e215d45ade564b5d488c67e099c0ba599"
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.DOM",
|
|
6
|
-
"JSBundleVersion": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.20.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
|
|
|
11
11
|
"node": "DOM+Node.js"
|
|
12
12
|
},
|
|
13
13
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
14
|
-
"GitRevision": "
|
|
14
|
+
"GitRevision": "39a7679e215d45ade564b5d488c67e099c0ba599"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [],
|
|
17
17
|
"ResourceLookup": {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.FontKit",
|
|
4
|
-
"JSBundleVersion": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.20.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
8
8
|
"html": "FontKit+HTML.js"
|
|
9
9
|
},
|
|
10
10
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
11
|
-
"GitRevision": "
|
|
11
|
+
"GitRevision": "39a7679e215d45ade564b5d488c67e099c0ba599"
|
|
12
12
|
}
|
|
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.JSKit.FontKit'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.FontKit",
|
|
6
|
-
"JSBundleVersion": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.20.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
10
10
|
"html": "FontKit+HTML.js"
|
|
11
11
|
},
|
|
12
12
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
13
|
-
"GitRevision": "
|
|
13
|
+
"GitRevision": "39a7679e215d45ade564b5d488c67e099c0ba599"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [],
|
|
16
16
|
"ResourceLookup": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.Foundation",
|
|
4
|
-
"JSBundleVersion": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.20.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "Foundation+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "39a7679e215d45ade564b5d488c67e099c0ba599"
|
|
13
13
|
}
|
|
@@ -20,80 +20,175 @@ JSClass("JSDiff", JSObject, {
|
|
|
20
20
|
this.initWithArrays(a, b);
|
|
21
21
|
},
|
|
22
22
|
|
|
23
|
+
operations: JSLazyInitProperty(function(){
|
|
24
|
+
return this.shortestOperationList();
|
|
25
|
+
}),
|
|
26
|
+
|
|
23
27
|
commonIndexes: JSLazyInitProperty(function(){
|
|
28
|
+
var operations = this.operations;
|
|
29
|
+
var operationIndex = 0;
|
|
30
|
+
var operationCount = operations.length;
|
|
31
|
+
var m = this.a.length;
|
|
32
|
+
var n = this.b.length;
|
|
33
|
+
var commonIndexes = [];
|
|
34
|
+
var i = 0;
|
|
35
|
+
var j = 0;
|
|
36
|
+
while (i < m && j < n){
|
|
37
|
+
if (operationIndex < operationCount && operations[operationIndex].originalIndex === i){
|
|
38
|
+
if (operations[operationIndex].operator === JSDiff.Operator.delete){
|
|
39
|
+
++i;
|
|
40
|
+
}else{
|
|
41
|
+
++j;
|
|
42
|
+
}
|
|
43
|
+
++operationIndex;
|
|
44
|
+
}else{
|
|
45
|
+
commonIndexes.push([i, j]);
|
|
46
|
+
++i;
|
|
47
|
+
++j;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return commonIndexes;
|
|
51
|
+
}),
|
|
52
|
+
|
|
53
|
+
shortestOperationList: function(){
|
|
54
|
+
var operations = [];
|
|
24
55
|
var a = this.a;
|
|
25
56
|
var b = this.b;
|
|
26
57
|
if (this.mapFunction !== null){
|
|
27
58
|
a = a.map(this.mapFunction);
|
|
28
59
|
b = b.map(this.mapFunction);
|
|
29
60
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
comparisonCount: 0,
|
|
61
|
+
var m = a.length;
|
|
62
|
+
var n = b.length;
|
|
63
|
+
var i = 0;
|
|
64
|
+
var j = 0;
|
|
35
65
|
|
|
36
|
-
|
|
37
|
-
++
|
|
38
|
-
if (i1 >= i0 && j1 >= j0){
|
|
66
|
+
// common prefix
|
|
67
|
+
for (; i < m && j < n; ++i, ++j){
|
|
39
68
|
++this.comparisonCount;
|
|
40
|
-
if (a[
|
|
41
|
-
|
|
42
|
-
++this.comparisonCount;
|
|
43
|
-
while (i1 >= i0 && j1 >= j0 && a[i0] === b[i0]){
|
|
44
|
-
head.push([i0, j0]);
|
|
45
|
-
++i0;
|
|
46
|
-
++j0;
|
|
47
|
-
++this.comparisonCount;
|
|
48
|
-
}
|
|
49
|
-
return head.concat(this.indexesOfLongestCommonSubsequence(a, i0, i1, b, j0, j1));
|
|
69
|
+
if (a[i] !== b[j]){
|
|
70
|
+
break;
|
|
50
71
|
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// common suffix
|
|
75
|
+
for (; m > i && n > j; --m, --n){
|
|
51
76
|
++this.comparisonCount;
|
|
52
|
-
if (a[
|
|
53
|
-
|
|
77
|
+
if (a[m - 1] !== b[n - 1]){
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// special case, a and b are equal
|
|
83
|
+
if (i === m && j === n){
|
|
84
|
+
return operations;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// special case, b contains all of a plus extra at the end
|
|
88
|
+
if (i === m){
|
|
89
|
+
for (; j < n; ++j){
|
|
90
|
+
operations.push(JSDiffOperation(JSDiff.Operator.insert, i, j));
|
|
91
|
+
}
|
|
92
|
+
return operations;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// special case, b contains only the start of a
|
|
96
|
+
if (j === n){
|
|
97
|
+
for (; i < m; ++i){
|
|
98
|
+
operations.push(JSDiffOperation(JSDiff.Operator.delete, i, j));
|
|
99
|
+
}
|
|
100
|
+
return operations;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
var operationCount = 1;
|
|
104
|
+
var maximumOperationCount = Math.min(m + n, this.maximumOperationCount);
|
|
105
|
+
var diagonalNumber;
|
|
106
|
+
var minimumDiagonalNumber = -1;
|
|
107
|
+
var maximumDiagonalNumber = 1;
|
|
108
|
+
var diagonals = {};
|
|
109
|
+
var diagonal;
|
|
110
|
+
var referenceDiagonal;
|
|
111
|
+
var operation;
|
|
112
|
+
var operator;
|
|
113
|
+
diagonals[0] = {
|
|
114
|
+
i: i,
|
|
115
|
+
operation: null
|
|
116
|
+
};
|
|
117
|
+
for (; operationCount <= maximumOperationCount; ++operationCount){
|
|
118
|
+
for (diagonalNumber = minimumDiagonalNumber; diagonalNumber <= maximumDiagonalNumber; diagonalNumber += 2){
|
|
54
119
|
++this.comparisonCount;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
120
|
+
if (diagonalNumber === -operationCount || (diagonalNumber !== operationCount && diagonals[diagonalNumber + 1].i >= diagonals[diagonalNumber - 1].i)){
|
|
121
|
+
referenceDiagonal = diagonals[diagonalNumber + 1];
|
|
122
|
+
i = referenceDiagonal.i + 1;
|
|
123
|
+
j = i + diagonalNumber;
|
|
124
|
+
operation = JSDiffOperation(JSDiff.Operator.delete, i - 1, j);
|
|
125
|
+
}else{
|
|
126
|
+
referenceDiagonal = diagonals[diagonalNumber - 1];
|
|
127
|
+
i = referenceDiagonal.i;
|
|
128
|
+
j = i + diagonalNumber;
|
|
129
|
+
operation = JSDiffOperation(JSDiff.Operator.insert, i, j - 1);
|
|
130
|
+
}
|
|
131
|
+
operation.previous = referenceDiagonal.operation;
|
|
132
|
+
for (; i < m && j < n; ++i, ++j){
|
|
59
133
|
++this.comparisonCount;
|
|
134
|
+
if (a[i] !== b[j]){
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
diagonal = diagonals[diagonalNumber];
|
|
139
|
+
if (diagonal === undefined){
|
|
140
|
+
diagonal = {
|
|
141
|
+
i: i,
|
|
142
|
+
operation: operation,
|
|
143
|
+
};
|
|
144
|
+
diagonals[diagonalNumber] = diagonal;
|
|
145
|
+
}else{
|
|
146
|
+
diagonal.i = i;
|
|
147
|
+
diagonal.operation = operation;
|
|
148
|
+
}
|
|
149
|
+
if (i === m && j === n){
|
|
150
|
+
while (operation !== null){
|
|
151
|
+
operations.unshift(operation);
|
|
152
|
+
operation = operation.previous;
|
|
153
|
+
}
|
|
154
|
+
return operations;
|
|
155
|
+
}
|
|
156
|
+
if (i === m){
|
|
157
|
+
minimumDiagonalNumber = diagonalNumber + 2;
|
|
158
|
+
}
|
|
159
|
+
if (j === n){
|
|
160
|
+
maximumDiagonalNumber = diagonalNumber - 2;
|
|
60
161
|
}
|
|
61
|
-
return this.indexesOfLongestCommonSubsequence(a, i0, i1, b, j0, j1).concat(tail);
|
|
62
|
-
}
|
|
63
|
-
var sequence1 = this.indexesOfLongestCommonSubsequence(a, i0, i1, b, j0, j1 - 1);
|
|
64
|
-
var sequence2 = this.indexesOfLongestCommonSubsequence(a, i0, i1 - 1, b, j0, j1);
|
|
65
|
-
if (sequence1.length >= sequence2.length){
|
|
66
|
-
return sequence1;
|
|
67
162
|
}
|
|
68
|
-
|
|
163
|
+
--minimumDiagonalNumber;
|
|
164
|
+
++maximumDiagonalNumber;
|
|
69
165
|
}
|
|
70
|
-
return [];
|
|
71
|
-
},
|
|
72
166
|
|
|
73
|
-
|
|
74
|
-
var a = [];
|
|
75
|
-
var b = [];
|
|
76
|
-
var i, l;
|
|
77
|
-
var j, k;
|
|
78
|
-
var commonIndexes = this.commonIndexes;
|
|
79
|
-
for (i = 0, l = a.length; i < l; ++i){
|
|
80
|
-
}
|
|
81
|
-
return [a, b];
|
|
167
|
+
return null;
|
|
82
168
|
},
|
|
83
169
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
var sequence = [];
|
|
87
|
-
var i, l;
|
|
88
|
-
for (i = 0, l = commonIndexes.length; i < l; ++i){
|
|
89
|
-
sequence.push(this.a[commonIndexes[i][0]]);
|
|
90
|
-
}
|
|
91
|
-
return sequence;
|
|
92
|
-
}
|
|
170
|
+
maximumOperationCount: Infinity,
|
|
171
|
+
comparisonCount: 0,
|
|
93
172
|
|
|
94
173
|
});
|
|
95
174
|
|
|
96
|
-
|
|
175
|
+
JSGlobalObject.JSDiffOperation = function(operator, originalIndex, modifiedIndex){
|
|
176
|
+
if (this === undefined){
|
|
177
|
+
return new JSDiffOperation(operator, originalIndex, modifiedIndex);
|
|
178
|
+
}
|
|
179
|
+
if (operator instanceof JSDiffOperation){
|
|
180
|
+
this.operator = operator.operator;
|
|
181
|
+
this.originalIndex = operator.originalIndex;
|
|
182
|
+
this.modifiedIndex = operator.modifiedIndex;
|
|
183
|
+
}else{
|
|
184
|
+
this.operator = operator;
|
|
185
|
+
this.originalIndex = originalIndex;
|
|
186
|
+
this.modifiedIndex = modifiedIndex;
|
|
187
|
+
}
|
|
188
|
+
this.previous = null;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
JSDiff.Operator = {
|
|
97
192
|
insert: 1,
|
|
98
193
|
delete: 2
|
|
99
|
-
};
|
|
194
|
+
};
|
|
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.Foundation",
|
|
6
|
-
"JSBundleVersion": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.20.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
|
|
|
11
11
|
"node": "Foundation+Node.js"
|
|
12
12
|
},
|
|
13
13
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
14
|
-
"GitRevision": "
|
|
14
|
+
"GitRevision": "39a7679e215d45ade564b5d488c67e099c0ba599"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [
|
|
17
17
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
|
|
4
|
-
"JSBundleVersion": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.20.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "SecurityKit+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "39a7679e215d45ade564b5d488c67e099c0ba599"
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
|
|
6
|
-
"JSBundleVersion": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.20.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
|
|
|
11
11
|
"node": "SecurityKit+Node.js"
|
|
12
12
|
},
|
|
13
13
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
14
|
-
"GitRevision": "
|
|
14
|
+
"GitRevision": "39a7679e215d45ade564b5d488c67e099c0ba599"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [],
|
|
17
17
|
"ResourceLookup": {
|
package/Info.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "node",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.jskit",
|
|
4
|
-
"JSBundleVersion": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.20.0",
|
|
5
5
|
"JSExecutableName": "jskit",
|
|
6
6
|
"NPMOrganization": "breakside",
|
|
7
7
|
"JSResources": [
|
|
8
8
|
"Tests/HTMLTestRunner.js",
|
|
9
9
|
"Tests/NodeTestRunner.js"
|
|
10
10
|
],
|
|
11
|
-
"GitRevision": "
|
|
11
|
+
"GitRevision": "39a7679e215d45ade564b5d488c67e099c0ba599"
|
|
12
12
|
}
|
|
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.jskit'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "node",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.jskit",
|
|
6
|
-
"JSBundleVersion": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.20.0",
|
|
7
7
|
"JSExecutableName": "jskit",
|
|
8
8
|
"NPMOrganization": "breakside",
|
|
9
9
|
"JSResources": [
|
|
10
10
|
"Tests/HTMLTestRunner.js",
|
|
11
11
|
"Tests/NodeTestRunner.js"
|
|
12
12
|
],
|
|
13
|
-
"GitRevision": "
|
|
13
|
+
"GitRevision": "39a7679e215d45ade564b5d488c67e099c0ba599"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -20,80 +20,175 @@ JSClass("JSDiff", JSObject, {
|
|
|
20
20
|
this.initWithArrays(a, b);
|
|
21
21
|
},
|
|
22
22
|
|
|
23
|
+
operations: JSLazyInitProperty(function(){
|
|
24
|
+
return this.shortestOperationList();
|
|
25
|
+
}),
|
|
26
|
+
|
|
23
27
|
commonIndexes: JSLazyInitProperty(function(){
|
|
28
|
+
var operations = this.operations;
|
|
29
|
+
var operationIndex = 0;
|
|
30
|
+
var operationCount = operations.length;
|
|
31
|
+
var m = this.a.length;
|
|
32
|
+
var n = this.b.length;
|
|
33
|
+
var commonIndexes = [];
|
|
34
|
+
var i = 0;
|
|
35
|
+
var j = 0;
|
|
36
|
+
while (i < m && j < n){
|
|
37
|
+
if (operationIndex < operationCount && operations[operationIndex].originalIndex === i){
|
|
38
|
+
if (operations[operationIndex].operator === JSDiff.Operator.delete){
|
|
39
|
+
++i;
|
|
40
|
+
}else{
|
|
41
|
+
++j;
|
|
42
|
+
}
|
|
43
|
+
++operationIndex;
|
|
44
|
+
}else{
|
|
45
|
+
commonIndexes.push([i, j]);
|
|
46
|
+
++i;
|
|
47
|
+
++j;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return commonIndexes;
|
|
51
|
+
}),
|
|
52
|
+
|
|
53
|
+
shortestOperationList: function(){
|
|
54
|
+
var operations = [];
|
|
24
55
|
var a = this.a;
|
|
25
56
|
var b = this.b;
|
|
26
57
|
if (this.mapFunction !== null){
|
|
27
58
|
a = a.map(this.mapFunction);
|
|
28
59
|
b = b.map(this.mapFunction);
|
|
29
60
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
comparisonCount: 0,
|
|
61
|
+
var m = a.length;
|
|
62
|
+
var n = b.length;
|
|
63
|
+
var i = 0;
|
|
64
|
+
var j = 0;
|
|
35
65
|
|
|
36
|
-
|
|
37
|
-
++
|
|
38
|
-
if (i1 >= i0 && j1 >= j0){
|
|
66
|
+
// common prefix
|
|
67
|
+
for (; i < m && j < n; ++i, ++j){
|
|
39
68
|
++this.comparisonCount;
|
|
40
|
-
if (a[
|
|
41
|
-
|
|
42
|
-
++this.comparisonCount;
|
|
43
|
-
while (i1 >= i0 && j1 >= j0 && a[i0] === b[i0]){
|
|
44
|
-
head.push([i0, j0]);
|
|
45
|
-
++i0;
|
|
46
|
-
++j0;
|
|
47
|
-
++this.comparisonCount;
|
|
48
|
-
}
|
|
49
|
-
return head.concat(this.indexesOfLongestCommonSubsequence(a, i0, i1, b, j0, j1));
|
|
69
|
+
if (a[i] !== b[j]){
|
|
70
|
+
break;
|
|
50
71
|
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// common suffix
|
|
75
|
+
for (; m > i && n > j; --m, --n){
|
|
51
76
|
++this.comparisonCount;
|
|
52
|
-
if (a[
|
|
53
|
-
|
|
77
|
+
if (a[m - 1] !== b[n - 1]){
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// special case, a and b are equal
|
|
83
|
+
if (i === m && j === n){
|
|
84
|
+
return operations;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// special case, b contains all of a plus extra at the end
|
|
88
|
+
if (i === m){
|
|
89
|
+
for (; j < n; ++j){
|
|
90
|
+
operations.push(JSDiffOperation(JSDiff.Operator.insert, i, j));
|
|
91
|
+
}
|
|
92
|
+
return operations;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// special case, b contains only the start of a
|
|
96
|
+
if (j === n){
|
|
97
|
+
for (; i < m; ++i){
|
|
98
|
+
operations.push(JSDiffOperation(JSDiff.Operator.delete, i, j));
|
|
99
|
+
}
|
|
100
|
+
return operations;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
var operationCount = 1;
|
|
104
|
+
var maximumOperationCount = Math.min(m + n, this.maximumOperationCount);
|
|
105
|
+
var diagonalNumber;
|
|
106
|
+
var minimumDiagonalNumber = -1;
|
|
107
|
+
var maximumDiagonalNumber = 1;
|
|
108
|
+
var diagonals = {};
|
|
109
|
+
var diagonal;
|
|
110
|
+
var referenceDiagonal;
|
|
111
|
+
var operation;
|
|
112
|
+
var operator;
|
|
113
|
+
diagonals[0] = {
|
|
114
|
+
i: i,
|
|
115
|
+
operation: null
|
|
116
|
+
};
|
|
117
|
+
for (; operationCount <= maximumOperationCount; ++operationCount){
|
|
118
|
+
for (diagonalNumber = minimumDiagonalNumber; diagonalNumber <= maximumDiagonalNumber; diagonalNumber += 2){
|
|
54
119
|
++this.comparisonCount;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
120
|
+
if (diagonalNumber === -operationCount || (diagonalNumber !== operationCount && diagonals[diagonalNumber + 1].i >= diagonals[diagonalNumber - 1].i)){
|
|
121
|
+
referenceDiagonal = diagonals[diagonalNumber + 1];
|
|
122
|
+
i = referenceDiagonal.i + 1;
|
|
123
|
+
j = i + diagonalNumber;
|
|
124
|
+
operation = JSDiffOperation(JSDiff.Operator.delete, i - 1, j);
|
|
125
|
+
}else{
|
|
126
|
+
referenceDiagonal = diagonals[diagonalNumber - 1];
|
|
127
|
+
i = referenceDiagonal.i;
|
|
128
|
+
j = i + diagonalNumber;
|
|
129
|
+
operation = JSDiffOperation(JSDiff.Operator.insert, i, j - 1);
|
|
130
|
+
}
|
|
131
|
+
operation.previous = referenceDiagonal.operation;
|
|
132
|
+
for (; i < m && j < n; ++i, ++j){
|
|
59
133
|
++this.comparisonCount;
|
|
134
|
+
if (a[i] !== b[j]){
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
diagonal = diagonals[diagonalNumber];
|
|
139
|
+
if (diagonal === undefined){
|
|
140
|
+
diagonal = {
|
|
141
|
+
i: i,
|
|
142
|
+
operation: operation,
|
|
143
|
+
};
|
|
144
|
+
diagonals[diagonalNumber] = diagonal;
|
|
145
|
+
}else{
|
|
146
|
+
diagonal.i = i;
|
|
147
|
+
diagonal.operation = operation;
|
|
148
|
+
}
|
|
149
|
+
if (i === m && j === n){
|
|
150
|
+
while (operation !== null){
|
|
151
|
+
operations.unshift(operation);
|
|
152
|
+
operation = operation.previous;
|
|
153
|
+
}
|
|
154
|
+
return operations;
|
|
155
|
+
}
|
|
156
|
+
if (i === m){
|
|
157
|
+
minimumDiagonalNumber = diagonalNumber + 2;
|
|
158
|
+
}
|
|
159
|
+
if (j === n){
|
|
160
|
+
maximumDiagonalNumber = diagonalNumber - 2;
|
|
60
161
|
}
|
|
61
|
-
return this.indexesOfLongestCommonSubsequence(a, i0, i1, b, j0, j1).concat(tail);
|
|
62
|
-
}
|
|
63
|
-
var sequence1 = this.indexesOfLongestCommonSubsequence(a, i0, i1, b, j0, j1 - 1);
|
|
64
|
-
var sequence2 = this.indexesOfLongestCommonSubsequence(a, i0, i1 - 1, b, j0, j1);
|
|
65
|
-
if (sequence1.length >= sequence2.length){
|
|
66
|
-
return sequence1;
|
|
67
162
|
}
|
|
68
|
-
|
|
163
|
+
--minimumDiagonalNumber;
|
|
164
|
+
++maximumDiagonalNumber;
|
|
69
165
|
}
|
|
70
|
-
return [];
|
|
71
|
-
},
|
|
72
166
|
|
|
73
|
-
|
|
74
|
-
var a = [];
|
|
75
|
-
var b = [];
|
|
76
|
-
var i, l;
|
|
77
|
-
var j, k;
|
|
78
|
-
var commonIndexes = this.commonIndexes;
|
|
79
|
-
for (i = 0, l = a.length; i < l; ++i){
|
|
80
|
-
}
|
|
81
|
-
return [a, b];
|
|
167
|
+
return null;
|
|
82
168
|
},
|
|
83
169
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
var sequence = [];
|
|
87
|
-
var i, l;
|
|
88
|
-
for (i = 0, l = commonIndexes.length; i < l; ++i){
|
|
89
|
-
sequence.push(this.a[commonIndexes[i][0]]);
|
|
90
|
-
}
|
|
91
|
-
return sequence;
|
|
92
|
-
}
|
|
170
|
+
maximumOperationCount: Infinity,
|
|
171
|
+
comparisonCount: 0,
|
|
93
172
|
|
|
94
173
|
});
|
|
95
174
|
|
|
96
|
-
|
|
175
|
+
JSGlobalObject.JSDiffOperation = function(operator, originalIndex, modifiedIndex){
|
|
176
|
+
if (this === undefined){
|
|
177
|
+
return new JSDiffOperation(operator, originalIndex, modifiedIndex);
|
|
178
|
+
}
|
|
179
|
+
if (operator instanceof JSDiffOperation){
|
|
180
|
+
this.operator = operator.operator;
|
|
181
|
+
this.originalIndex = operator.originalIndex;
|
|
182
|
+
this.modifiedIndex = operator.modifiedIndex;
|
|
183
|
+
}else{
|
|
184
|
+
this.operator = operator;
|
|
185
|
+
this.originalIndex = originalIndex;
|
|
186
|
+
this.modifiedIndex = modifiedIndex;
|
|
187
|
+
}
|
|
188
|
+
this.previous = null;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
JSDiff.Operator = {
|
|
97
192
|
insert: 1,
|
|
98
193
|
delete: 2
|
|
99
|
-
};
|
|
194
|
+
};
|