prettier 3.3.1 → 3.3.3
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/LICENSE +41 -40
- package/doc.js +11 -11
- package/doc.mjs +11 -11
- package/index.cjs +9 -9
- package/index.d.ts +1 -2
- package/index.mjs +703 -763
- package/internal/cli.mjs +15 -15
- package/package.json +1 -1
- package/plugins/acorn.js +14 -12
- package/plugins/acorn.mjs +14 -12
- package/plugins/angular.js +1 -1
- package/plugins/angular.mjs +1 -1
- package/plugins/babel.js +10 -11
- package/plugins/babel.mjs +10 -11
- package/plugins/estree.js +27 -27
- package/plugins/estree.mjs +27 -27
- package/plugins/flow.js +15 -16
- package/plugins/flow.mjs +15 -16
- package/plugins/glimmer.js +13 -13
- package/plugins/glimmer.mjs +13 -13
- package/plugins/graphql.js +8 -8
- package/plugins/graphql.mjs +8 -8
- package/plugins/html.js +19 -16
- package/plugins/html.mjs +18 -15
- package/plugins/markdown.js +43 -40
- package/plugins/markdown.mjs +43 -40
- package/plugins/meriyah.js +4 -5
- package/plugins/meriyah.mjs +4 -5
- package/plugins/postcss.js +28 -25
- package/plugins/postcss.mjs +28 -25
- package/plugins/typescript.js +15 -20
- package/plugins/typescript.mjs +15 -20
- package/plugins/yaml.js +6 -6
- package/plugins/yaml.mjs +6 -6
- package/standalone.js +31 -30
- package/standalone.mjs +28 -27
package/index.mjs
CHANGED
|
@@ -55,538 +55,6 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
55
55
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
56
56
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
57
57
|
|
|
58
|
-
// node_modules/diff/lib/diff/base.js
|
|
59
|
-
var require_base = __commonJS({
|
|
60
|
-
"node_modules/diff/lib/diff/base.js"(exports) {
|
|
61
|
-
"use strict";
|
|
62
|
-
Object.defineProperty(exports, "__esModule", {
|
|
63
|
-
value: true
|
|
64
|
-
});
|
|
65
|
-
exports["default"] = Diff;
|
|
66
|
-
function Diff() {
|
|
67
|
-
}
|
|
68
|
-
Diff.prototype = {
|
|
69
|
-
/*istanbul ignore start*/
|
|
70
|
-
/*istanbul ignore end*/
|
|
71
|
-
diff: function diff(oldString, newString) {
|
|
72
|
-
var _options$timeout;
|
|
73
|
-
var options8 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
74
|
-
var callback = options8.callback;
|
|
75
|
-
if (typeof options8 === "function") {
|
|
76
|
-
callback = options8;
|
|
77
|
-
options8 = {};
|
|
78
|
-
}
|
|
79
|
-
this.options = options8;
|
|
80
|
-
var self = this;
|
|
81
|
-
function done(value) {
|
|
82
|
-
if (callback) {
|
|
83
|
-
setTimeout(function() {
|
|
84
|
-
callback(void 0, value);
|
|
85
|
-
}, 0);
|
|
86
|
-
return true;
|
|
87
|
-
} else {
|
|
88
|
-
return value;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
oldString = this.castInput(oldString);
|
|
92
|
-
newString = this.castInput(newString);
|
|
93
|
-
oldString = this.removeEmpty(this.tokenize(oldString));
|
|
94
|
-
newString = this.removeEmpty(this.tokenize(newString));
|
|
95
|
-
var newLen = newString.length, oldLen = oldString.length;
|
|
96
|
-
var editLength = 1;
|
|
97
|
-
var maxEditLength = newLen + oldLen;
|
|
98
|
-
if (options8.maxEditLength) {
|
|
99
|
-
maxEditLength = Math.min(maxEditLength, options8.maxEditLength);
|
|
100
|
-
}
|
|
101
|
-
var maxExecutionTime = (
|
|
102
|
-
/*istanbul ignore start*/
|
|
103
|
-
(_options$timeout = /*istanbul ignore end*/
|
|
104
|
-
options8.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity
|
|
105
|
-
);
|
|
106
|
-
var abortAfterTimestamp = Date.now() + maxExecutionTime;
|
|
107
|
-
var bestPath = [{
|
|
108
|
-
oldPos: -1,
|
|
109
|
-
lastComponent: void 0
|
|
110
|
-
}];
|
|
111
|
-
var newPos = this.extractCommon(bestPath[0], newString, oldString, 0);
|
|
112
|
-
if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
|
113
|
-
return done([{
|
|
114
|
-
value: this.join(newString),
|
|
115
|
-
count: newString.length
|
|
116
|
-
}]);
|
|
117
|
-
}
|
|
118
|
-
var minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;
|
|
119
|
-
function execEditLength() {
|
|
120
|
-
for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
|
|
121
|
-
var basePath = (
|
|
122
|
-
/*istanbul ignore start*/
|
|
123
|
-
void 0
|
|
124
|
-
);
|
|
125
|
-
var removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];
|
|
126
|
-
if (removePath) {
|
|
127
|
-
bestPath[diagonalPath - 1] = void 0;
|
|
128
|
-
}
|
|
129
|
-
var canAdd = false;
|
|
130
|
-
if (addPath) {
|
|
131
|
-
var addPathNewPos = addPath.oldPos - diagonalPath;
|
|
132
|
-
canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
|
|
133
|
-
}
|
|
134
|
-
var canRemove = removePath && removePath.oldPos + 1 < oldLen;
|
|
135
|
-
if (!canAdd && !canRemove) {
|
|
136
|
-
bestPath[diagonalPath] = void 0;
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
if (!canRemove || canAdd && removePath.oldPos + 1 < addPath.oldPos) {
|
|
140
|
-
basePath = self.addToPath(addPath, true, void 0, 0);
|
|
141
|
-
} else {
|
|
142
|
-
basePath = self.addToPath(removePath, void 0, true, 1);
|
|
143
|
-
}
|
|
144
|
-
newPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
|
|
145
|
-
if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
|
146
|
-
return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
|
|
147
|
-
} else {
|
|
148
|
-
bestPath[diagonalPath] = basePath;
|
|
149
|
-
if (basePath.oldPos + 1 >= oldLen) {
|
|
150
|
-
maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
|
|
151
|
-
}
|
|
152
|
-
if (newPos + 1 >= newLen) {
|
|
153
|
-
minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
editLength++;
|
|
158
|
-
}
|
|
159
|
-
if (callback) {
|
|
160
|
-
(function exec() {
|
|
161
|
-
setTimeout(function() {
|
|
162
|
-
if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
|
|
163
|
-
return callback();
|
|
164
|
-
}
|
|
165
|
-
if (!execEditLength()) {
|
|
166
|
-
exec();
|
|
167
|
-
}
|
|
168
|
-
}, 0);
|
|
169
|
-
})();
|
|
170
|
-
} else {
|
|
171
|
-
while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
|
|
172
|
-
var ret = execEditLength();
|
|
173
|
-
if (ret) {
|
|
174
|
-
return ret;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
/*istanbul ignore start*/
|
|
180
|
-
/*istanbul ignore end*/
|
|
181
|
-
addToPath: function addToPath(path13, added, removed, oldPosInc) {
|
|
182
|
-
var last = path13.lastComponent;
|
|
183
|
-
if (last && last.added === added && last.removed === removed) {
|
|
184
|
-
return {
|
|
185
|
-
oldPos: path13.oldPos + oldPosInc,
|
|
186
|
-
lastComponent: {
|
|
187
|
-
count: last.count + 1,
|
|
188
|
-
added,
|
|
189
|
-
removed,
|
|
190
|
-
previousComponent: last.previousComponent
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
} else {
|
|
194
|
-
return {
|
|
195
|
-
oldPos: path13.oldPos + oldPosInc,
|
|
196
|
-
lastComponent: {
|
|
197
|
-
count: 1,
|
|
198
|
-
added,
|
|
199
|
-
removed,
|
|
200
|
-
previousComponent: last
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
/*istanbul ignore start*/
|
|
206
|
-
/*istanbul ignore end*/
|
|
207
|
-
extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
|
|
208
|
-
var newLen = newString.length, oldLen = oldString.length, oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
|
|
209
|
-
while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
|
|
210
|
-
newPos++;
|
|
211
|
-
oldPos++;
|
|
212
|
-
commonCount++;
|
|
213
|
-
}
|
|
214
|
-
if (commonCount) {
|
|
215
|
-
basePath.lastComponent = {
|
|
216
|
-
count: commonCount,
|
|
217
|
-
previousComponent: basePath.lastComponent
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
basePath.oldPos = oldPos;
|
|
221
|
-
return newPos;
|
|
222
|
-
},
|
|
223
|
-
/*istanbul ignore start*/
|
|
224
|
-
/*istanbul ignore end*/
|
|
225
|
-
equals: function equals(left, right) {
|
|
226
|
-
if (this.options.comparator) {
|
|
227
|
-
return this.options.comparator(left, right);
|
|
228
|
-
} else {
|
|
229
|
-
return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
/*istanbul ignore start*/
|
|
233
|
-
/*istanbul ignore end*/
|
|
234
|
-
removeEmpty: function removeEmpty(array2) {
|
|
235
|
-
var ret = [];
|
|
236
|
-
for (var i = 0; i < array2.length; i++) {
|
|
237
|
-
if (array2[i]) {
|
|
238
|
-
ret.push(array2[i]);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
return ret;
|
|
242
|
-
},
|
|
243
|
-
/*istanbul ignore start*/
|
|
244
|
-
/*istanbul ignore end*/
|
|
245
|
-
castInput: function castInput(value) {
|
|
246
|
-
return value;
|
|
247
|
-
},
|
|
248
|
-
/*istanbul ignore start*/
|
|
249
|
-
/*istanbul ignore end*/
|
|
250
|
-
tokenize: function tokenize(value) {
|
|
251
|
-
return value.split("");
|
|
252
|
-
},
|
|
253
|
-
/*istanbul ignore start*/
|
|
254
|
-
/*istanbul ignore end*/
|
|
255
|
-
join: function join2(chars) {
|
|
256
|
-
return chars.join("");
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
function buildValues(diff, lastComponent, newString, oldString, useLongestToken) {
|
|
260
|
-
var components = [];
|
|
261
|
-
var nextComponent;
|
|
262
|
-
while (lastComponent) {
|
|
263
|
-
components.push(lastComponent);
|
|
264
|
-
nextComponent = lastComponent.previousComponent;
|
|
265
|
-
delete lastComponent.previousComponent;
|
|
266
|
-
lastComponent = nextComponent;
|
|
267
|
-
}
|
|
268
|
-
components.reverse();
|
|
269
|
-
var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0;
|
|
270
|
-
for (; componentPos < componentLen; componentPos++) {
|
|
271
|
-
var component = components[componentPos];
|
|
272
|
-
if (!component.removed) {
|
|
273
|
-
if (!component.added && useLongestToken) {
|
|
274
|
-
var value = newString.slice(newPos, newPos + component.count);
|
|
275
|
-
value = value.map(function(value2, i) {
|
|
276
|
-
var oldValue = oldString[oldPos + i];
|
|
277
|
-
return oldValue.length > value2.length ? oldValue : value2;
|
|
278
|
-
});
|
|
279
|
-
component.value = diff.join(value);
|
|
280
|
-
} else {
|
|
281
|
-
component.value = diff.join(newString.slice(newPos, newPos + component.count));
|
|
282
|
-
}
|
|
283
|
-
newPos += component.count;
|
|
284
|
-
if (!component.added) {
|
|
285
|
-
oldPos += component.count;
|
|
286
|
-
}
|
|
287
|
-
} else {
|
|
288
|
-
component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
|
|
289
|
-
oldPos += component.count;
|
|
290
|
-
if (componentPos && components[componentPos - 1].added) {
|
|
291
|
-
var tmp = components[componentPos - 1];
|
|
292
|
-
components[componentPos - 1] = components[componentPos];
|
|
293
|
-
components[componentPos] = tmp;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
var finalComponent = components[componentLen - 1];
|
|
298
|
-
if (componentLen > 1 && typeof finalComponent.value === "string" && (finalComponent.added || finalComponent.removed) && diff.equals("", finalComponent.value)) {
|
|
299
|
-
components[componentLen - 2].value += finalComponent.value;
|
|
300
|
-
components.pop();
|
|
301
|
-
}
|
|
302
|
-
return components;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
// node_modules/diff/lib/util/params.js
|
|
308
|
-
var require_params = __commonJS({
|
|
309
|
-
"node_modules/diff/lib/util/params.js"(exports) {
|
|
310
|
-
"use strict";
|
|
311
|
-
Object.defineProperty(exports, "__esModule", {
|
|
312
|
-
value: true
|
|
313
|
-
});
|
|
314
|
-
exports.generateOptions = generateOptions;
|
|
315
|
-
function generateOptions(options8, defaults) {
|
|
316
|
-
if (typeof options8 === "function") {
|
|
317
|
-
defaults.callback = options8;
|
|
318
|
-
} else if (options8) {
|
|
319
|
-
for (var name in options8) {
|
|
320
|
-
if (options8.hasOwnProperty(name)) {
|
|
321
|
-
defaults[name] = options8[name];
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
return defaults;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
// node_modules/diff/lib/diff/line.js
|
|
331
|
-
var require_line = __commonJS({
|
|
332
|
-
"node_modules/diff/lib/diff/line.js"(exports) {
|
|
333
|
-
"use strict";
|
|
334
|
-
Object.defineProperty(exports, "__esModule", {
|
|
335
|
-
value: true
|
|
336
|
-
});
|
|
337
|
-
exports.diffLines = diffLines;
|
|
338
|
-
exports.diffTrimmedLines = diffTrimmedLines;
|
|
339
|
-
exports.lineDiff = void 0;
|
|
340
|
-
var _base = _interopRequireDefault(require_base());
|
|
341
|
-
var _params = require_params();
|
|
342
|
-
function _interopRequireDefault(obj) {
|
|
343
|
-
return obj && obj.__esModule ? obj : { "default": obj };
|
|
344
|
-
}
|
|
345
|
-
var lineDiff = new /*istanbul ignore start*/
|
|
346
|
-
_base[
|
|
347
|
-
/*istanbul ignore start*/
|
|
348
|
-
"default"
|
|
349
|
-
/*istanbul ignore end*/
|
|
350
|
-
]();
|
|
351
|
-
exports.lineDiff = lineDiff;
|
|
352
|
-
lineDiff.tokenize = function(value) {
|
|
353
|
-
if (this.options.stripTrailingCr) {
|
|
354
|
-
value = value.replace(/\r\n/g, "\n");
|
|
355
|
-
}
|
|
356
|
-
var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
|
|
357
|
-
if (!linesAndNewlines[linesAndNewlines.length - 1]) {
|
|
358
|
-
linesAndNewlines.pop();
|
|
359
|
-
}
|
|
360
|
-
for (var i = 0; i < linesAndNewlines.length; i++) {
|
|
361
|
-
var line3 = linesAndNewlines[i];
|
|
362
|
-
if (i % 2 && !this.options.newlineIsToken) {
|
|
363
|
-
retLines[retLines.length - 1] += line3;
|
|
364
|
-
} else {
|
|
365
|
-
if (this.options.ignoreWhitespace) {
|
|
366
|
-
line3 = line3.trim();
|
|
367
|
-
}
|
|
368
|
-
retLines.push(line3);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
return retLines;
|
|
372
|
-
};
|
|
373
|
-
function diffLines(oldStr, newStr, callback) {
|
|
374
|
-
return lineDiff.diff(oldStr, newStr, callback);
|
|
375
|
-
}
|
|
376
|
-
function diffTrimmedLines(oldStr, newStr, callback) {
|
|
377
|
-
var options8 = (
|
|
378
|
-
/*istanbul ignore start*/
|
|
379
|
-
(0, /*istanbul ignore end*/
|
|
380
|
-
/*istanbul ignore start*/
|
|
381
|
-
_params.generateOptions)(callback, {
|
|
382
|
-
ignoreWhitespace: true
|
|
383
|
-
})
|
|
384
|
-
);
|
|
385
|
-
return lineDiff.diff(oldStr, newStr, options8);
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
});
|
|
389
|
-
|
|
390
|
-
// node_modules/diff/lib/patch/create.js
|
|
391
|
-
var require_create = __commonJS({
|
|
392
|
-
"node_modules/diff/lib/patch/create.js"(exports) {
|
|
393
|
-
"use strict";
|
|
394
|
-
Object.defineProperty(exports, "__esModule", {
|
|
395
|
-
value: true
|
|
396
|
-
});
|
|
397
|
-
exports.structuredPatch = structuredPatch;
|
|
398
|
-
exports.formatPatch = formatPatch;
|
|
399
|
-
exports.createTwoFilesPatch = createTwoFilesPatch2;
|
|
400
|
-
exports.createPatch = createPatch;
|
|
401
|
-
var _line = require_line();
|
|
402
|
-
function _toConsumableArray(arr) {
|
|
403
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
404
|
-
}
|
|
405
|
-
function _nonIterableSpread() {
|
|
406
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
407
|
-
}
|
|
408
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
409
|
-
if (!o) return;
|
|
410
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
411
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
412
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
413
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
414
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
415
|
-
}
|
|
416
|
-
function _iterableToArray(iter) {
|
|
417
|
-
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
|
418
|
-
}
|
|
419
|
-
function _arrayWithoutHoles(arr) {
|
|
420
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
421
|
-
}
|
|
422
|
-
function _arrayLikeToArray(arr, len) {
|
|
423
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
424
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
425
|
-
arr2[i] = arr[i];
|
|
426
|
-
}
|
|
427
|
-
return arr2;
|
|
428
|
-
}
|
|
429
|
-
function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8) {
|
|
430
|
-
if (!options8) {
|
|
431
|
-
options8 = {};
|
|
432
|
-
}
|
|
433
|
-
if (typeof options8.context === "undefined") {
|
|
434
|
-
options8.context = 4;
|
|
435
|
-
}
|
|
436
|
-
var diff = (
|
|
437
|
-
/*istanbul ignore start*/
|
|
438
|
-
(0, /*istanbul ignore end*/
|
|
439
|
-
/*istanbul ignore start*/
|
|
440
|
-
_line.diffLines)(oldStr, newStr, options8)
|
|
441
|
-
);
|
|
442
|
-
if (!diff) {
|
|
443
|
-
return;
|
|
444
|
-
}
|
|
445
|
-
diff.push({
|
|
446
|
-
value: "",
|
|
447
|
-
lines: []
|
|
448
|
-
});
|
|
449
|
-
function contextLines(lines) {
|
|
450
|
-
return lines.map(function(entry) {
|
|
451
|
-
return " " + entry;
|
|
452
|
-
});
|
|
453
|
-
}
|
|
454
|
-
var hunks = [];
|
|
455
|
-
var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1;
|
|
456
|
-
var _loop = function _loop2(i2) {
|
|
457
|
-
var current = diff[i2], lines = current.lines || current.value.replace(/\n$/, "").split("\n");
|
|
458
|
-
current.lines = lines;
|
|
459
|
-
if (current.added || current.removed) {
|
|
460
|
-
var _curRange;
|
|
461
|
-
if (!oldRangeStart) {
|
|
462
|
-
var prev = diff[i2 - 1];
|
|
463
|
-
oldRangeStart = oldLine;
|
|
464
|
-
newRangeStart = newLine;
|
|
465
|
-
if (prev) {
|
|
466
|
-
curRange = options8.context > 0 ? contextLines(prev.lines.slice(-options8.context)) : [];
|
|
467
|
-
oldRangeStart -= curRange.length;
|
|
468
|
-
newRangeStart -= curRange.length;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
(_curRange = /*istanbul ignore end*/
|
|
472
|
-
curRange).push.apply(
|
|
473
|
-
/*istanbul ignore start*/
|
|
474
|
-
_curRange,
|
|
475
|
-
/*istanbul ignore start*/
|
|
476
|
-
_toConsumableArray(
|
|
477
|
-
/*istanbul ignore end*/
|
|
478
|
-
lines.map(function(entry) {
|
|
479
|
-
return (current.added ? "+" : "-") + entry;
|
|
480
|
-
})
|
|
481
|
-
)
|
|
482
|
-
);
|
|
483
|
-
if (current.added) {
|
|
484
|
-
newLine += lines.length;
|
|
485
|
-
} else {
|
|
486
|
-
oldLine += lines.length;
|
|
487
|
-
}
|
|
488
|
-
} else {
|
|
489
|
-
if (oldRangeStart) {
|
|
490
|
-
if (lines.length <= options8.context * 2 && i2 < diff.length - 2) {
|
|
491
|
-
var _curRange2;
|
|
492
|
-
(_curRange2 = /*istanbul ignore end*/
|
|
493
|
-
curRange).push.apply(
|
|
494
|
-
/*istanbul ignore start*/
|
|
495
|
-
_curRange2,
|
|
496
|
-
/*istanbul ignore start*/
|
|
497
|
-
_toConsumableArray(
|
|
498
|
-
/*istanbul ignore end*/
|
|
499
|
-
contextLines(lines)
|
|
500
|
-
)
|
|
501
|
-
);
|
|
502
|
-
} else {
|
|
503
|
-
var _curRange3;
|
|
504
|
-
var contextSize = Math.min(lines.length, options8.context);
|
|
505
|
-
(_curRange3 = /*istanbul ignore end*/
|
|
506
|
-
curRange).push.apply(
|
|
507
|
-
/*istanbul ignore start*/
|
|
508
|
-
_curRange3,
|
|
509
|
-
/*istanbul ignore start*/
|
|
510
|
-
_toConsumableArray(
|
|
511
|
-
/*istanbul ignore end*/
|
|
512
|
-
contextLines(lines.slice(0, contextSize))
|
|
513
|
-
)
|
|
514
|
-
);
|
|
515
|
-
var hunk = {
|
|
516
|
-
oldStart: oldRangeStart,
|
|
517
|
-
oldLines: oldLine - oldRangeStart + contextSize,
|
|
518
|
-
newStart: newRangeStart,
|
|
519
|
-
newLines: newLine - newRangeStart + contextSize,
|
|
520
|
-
lines: curRange
|
|
521
|
-
};
|
|
522
|
-
if (i2 >= diff.length - 2 && lines.length <= options8.context) {
|
|
523
|
-
var oldEOFNewline = /\n$/.test(oldStr);
|
|
524
|
-
var newEOFNewline = /\n$/.test(newStr);
|
|
525
|
-
var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines;
|
|
526
|
-
if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) {
|
|
527
|
-
curRange.splice(hunk.oldLines, 0, "\");
|
|
528
|
-
}
|
|
529
|
-
if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) {
|
|
530
|
-
curRange.push("\");
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
hunks.push(hunk);
|
|
534
|
-
oldRangeStart = 0;
|
|
535
|
-
newRangeStart = 0;
|
|
536
|
-
curRange = [];
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
oldLine += lines.length;
|
|
540
|
-
newLine += lines.length;
|
|
541
|
-
}
|
|
542
|
-
};
|
|
543
|
-
for (var i = 0; i < diff.length; i++) {
|
|
544
|
-
_loop(
|
|
545
|
-
/*istanbul ignore end*/
|
|
546
|
-
i
|
|
547
|
-
);
|
|
548
|
-
}
|
|
549
|
-
return {
|
|
550
|
-
oldFileName,
|
|
551
|
-
newFileName,
|
|
552
|
-
oldHeader,
|
|
553
|
-
newHeader,
|
|
554
|
-
hunks
|
|
555
|
-
};
|
|
556
|
-
}
|
|
557
|
-
function formatPatch(diff) {
|
|
558
|
-
if (Array.isArray(diff)) {
|
|
559
|
-
return diff.map(formatPatch).join("\n");
|
|
560
|
-
}
|
|
561
|
-
var ret = [];
|
|
562
|
-
if (diff.oldFileName == diff.newFileName) {
|
|
563
|
-
ret.push("Index: " + diff.oldFileName);
|
|
564
|
-
}
|
|
565
|
-
ret.push("===================================================================");
|
|
566
|
-
ret.push("--- " + diff.oldFileName + (typeof diff.oldHeader === "undefined" ? "" : " " + diff.oldHeader));
|
|
567
|
-
ret.push("+++ " + diff.newFileName + (typeof diff.newHeader === "undefined" ? "" : " " + diff.newHeader));
|
|
568
|
-
for (var i = 0; i < diff.hunks.length; i++) {
|
|
569
|
-
var hunk = diff.hunks[i];
|
|
570
|
-
if (hunk.oldLines === 0) {
|
|
571
|
-
hunk.oldStart -= 1;
|
|
572
|
-
}
|
|
573
|
-
if (hunk.newLines === 0) {
|
|
574
|
-
hunk.newStart -= 1;
|
|
575
|
-
}
|
|
576
|
-
ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@");
|
|
577
|
-
ret.push.apply(ret, hunk.lines);
|
|
578
|
-
}
|
|
579
|
-
return ret.join("\n") + "\n";
|
|
580
|
-
}
|
|
581
|
-
function createTwoFilesPatch2(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8) {
|
|
582
|
-
return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8));
|
|
583
|
-
}
|
|
584
|
-
function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options8) {
|
|
585
|
-
return createTwoFilesPatch2(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options8);
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
});
|
|
589
|
-
|
|
590
58
|
// node_modules/fast-glob/out/utils/array.js
|
|
591
59
|
var require_array = __commonJS({
|
|
592
60
|
"node_modules/fast-glob/out/utils/array.js"(exports) {
|
|
@@ -1202,9 +670,9 @@ var require_to_regex_range = __commonJS({
|
|
|
1202
670
|
if (!tok.isPadded) {
|
|
1203
671
|
return value;
|
|
1204
672
|
}
|
|
1205
|
-
let
|
|
673
|
+
let diff2 = Math.abs(tok.maxLen - String(value).length);
|
|
1206
674
|
let relax = options8.relaxZeros !== false;
|
|
1207
|
-
switch (
|
|
675
|
+
switch (diff2) {
|
|
1208
676
|
case 0:
|
|
1209
677
|
return "";
|
|
1210
678
|
case 1:
|
|
@@ -1212,7 +680,7 @@ var require_to_regex_range = __commonJS({
|
|
|
1212
680
|
case 2:
|
|
1213
681
|
return relax ? "0{0,2}" : "00";
|
|
1214
682
|
default: {
|
|
1215
|
-
return relax ? `0{0,${
|
|
683
|
+
return relax ? `0{0,${diff2}}` : `0{${diff2}}`;
|
|
1216
684
|
}
|
|
1217
685
|
}
|
|
1218
686
|
}
|
|
@@ -4627,14 +4095,14 @@ var require_queue = __commonJS({
|
|
|
4627
4095
|
"node_modules/fastq/queue.js"(exports, module) {
|
|
4628
4096
|
"use strict";
|
|
4629
4097
|
var reusify = require_reusify();
|
|
4630
|
-
function fastqueue(context, worker,
|
|
4098
|
+
function fastqueue(context, worker, _concurrency) {
|
|
4631
4099
|
if (typeof context === "function") {
|
|
4632
|
-
|
|
4100
|
+
_concurrency = worker;
|
|
4633
4101
|
worker = context;
|
|
4634
4102
|
context = null;
|
|
4635
4103
|
}
|
|
4636
|
-
if (
|
|
4637
|
-
throw new Error("fastqueue concurrency must be greater than 1");
|
|
4104
|
+
if (!(_concurrency >= 1)) {
|
|
4105
|
+
throw new Error("fastqueue concurrency must be equal to or greater than 1");
|
|
4638
4106
|
}
|
|
4639
4107
|
var cache3 = reusify(Task);
|
|
4640
4108
|
var queueHead = null;
|
|
@@ -4647,7 +4115,20 @@ var require_queue = __commonJS({
|
|
|
4647
4115
|
saturated: noop2,
|
|
4648
4116
|
pause,
|
|
4649
4117
|
paused: false,
|
|
4650
|
-
concurrency
|
|
4118
|
+
get concurrency() {
|
|
4119
|
+
return _concurrency;
|
|
4120
|
+
},
|
|
4121
|
+
set concurrency(value) {
|
|
4122
|
+
if (!(value >= 1)) {
|
|
4123
|
+
throw new Error("fastqueue concurrency must be equal to or greater than 1");
|
|
4124
|
+
}
|
|
4125
|
+
_concurrency = value;
|
|
4126
|
+
if (self.paused) return;
|
|
4127
|
+
for (; queueHead && _running < _concurrency; ) {
|
|
4128
|
+
_running++;
|
|
4129
|
+
release();
|
|
4130
|
+
}
|
|
4131
|
+
},
|
|
4651
4132
|
running,
|
|
4652
4133
|
resume,
|
|
4653
4134
|
idle,
|
|
@@ -4687,7 +4168,12 @@ var require_queue = __commonJS({
|
|
|
4687
4168
|
function resume() {
|
|
4688
4169
|
if (!self.paused) return;
|
|
4689
4170
|
self.paused = false;
|
|
4690
|
-
|
|
4171
|
+
if (queueHead === null) {
|
|
4172
|
+
_running++;
|
|
4173
|
+
release();
|
|
4174
|
+
return;
|
|
4175
|
+
}
|
|
4176
|
+
for (; queueHead && _running < _concurrency; ) {
|
|
4691
4177
|
_running++;
|
|
4692
4178
|
release();
|
|
4693
4179
|
}
|
|
@@ -4702,7 +4188,7 @@ var require_queue = __commonJS({
|
|
|
4702
4188
|
current.value = value;
|
|
4703
4189
|
current.callback = done || noop2;
|
|
4704
4190
|
current.errorHandler = errorHandler;
|
|
4705
|
-
if (_running
|
|
4191
|
+
if (_running >= _concurrency || self.paused) {
|
|
4706
4192
|
if (queueTail) {
|
|
4707
4193
|
queueTail.next = current;
|
|
4708
4194
|
queueTail = current;
|
|
@@ -4722,7 +4208,8 @@ var require_queue = __commonJS({
|
|
|
4722
4208
|
current.release = release;
|
|
4723
4209
|
current.value = value;
|
|
4724
4210
|
current.callback = done || noop2;
|
|
4725
|
-
|
|
4211
|
+
current.errorHandler = errorHandler;
|
|
4212
|
+
if (_running >= _concurrency || self.paused) {
|
|
4726
4213
|
if (queueHead) {
|
|
4727
4214
|
current.next = queueHead;
|
|
4728
4215
|
queueHead = current;
|
|
@@ -4741,7 +4228,7 @@ var require_queue = __commonJS({
|
|
|
4741
4228
|
cache3.release(holder);
|
|
4742
4229
|
}
|
|
4743
4230
|
var next = queueHead;
|
|
4744
|
-
if (next) {
|
|
4231
|
+
if (next && _running <= _concurrency) {
|
|
4745
4232
|
if (!self.paused) {
|
|
4746
4233
|
if (queueTail === queueHead) {
|
|
4747
4234
|
queueTail = null;
|
|
@@ -4797,9 +4284,9 @@ var require_queue = __commonJS({
|
|
|
4797
4284
|
self.release(self);
|
|
4798
4285
|
};
|
|
4799
4286
|
}
|
|
4800
|
-
function queueAsPromised(context, worker,
|
|
4287
|
+
function queueAsPromised(context, worker, _concurrency) {
|
|
4801
4288
|
if (typeof context === "function") {
|
|
4802
|
-
|
|
4289
|
+
_concurrency = worker;
|
|
4803
4290
|
worker = context;
|
|
4804
4291
|
context = null;
|
|
4805
4292
|
}
|
|
@@ -4808,7 +4295,7 @@ var require_queue = __commonJS({
|
|
|
4808
4295
|
cb(null, res);
|
|
4809
4296
|
}, cb);
|
|
4810
4297
|
}
|
|
4811
|
-
var queue = fastqueue(context, asyncWrapper,
|
|
4298
|
+
var queue = fastqueue(context, asyncWrapper, _concurrency);
|
|
4812
4299
|
var pushCb = queue.push;
|
|
4813
4300
|
var unshiftCb = queue.unshift;
|
|
4814
4301
|
queue.push = push2;
|
|
@@ -7401,9 +6888,9 @@ var require_yallist = __commonJS({
|
|
|
7401
6888
|
}
|
|
7402
6889
|
});
|
|
7403
6890
|
|
|
7404
|
-
// node_modules/
|
|
6891
|
+
// node_modules/lru-cache/index.js
|
|
7405
6892
|
var require_lru_cache = __commonJS({
|
|
7406
|
-
"node_modules/
|
|
6893
|
+
"node_modules/lru-cache/index.js"(exports, module) {
|
|
7407
6894
|
"use strict";
|
|
7408
6895
|
module.exports = LRUCache;
|
|
7409
6896
|
var Map2 = require_map();
|
|
@@ -7755,11 +7242,11 @@ var require_lru_cache = __commonJS({
|
|
|
7755
7242
|
return false;
|
|
7756
7243
|
}
|
|
7757
7244
|
var stale = false;
|
|
7758
|
-
var
|
|
7245
|
+
var diff2 = Date.now() - hit.now;
|
|
7759
7246
|
if (hit.maxAge) {
|
|
7760
|
-
stale =
|
|
7247
|
+
stale = diff2 > hit.maxAge;
|
|
7761
7248
|
} else {
|
|
7762
|
-
stale = self[MAX_AGE] &&
|
|
7249
|
+
stale = self[MAX_AGE] && diff2 > self[MAX_AGE];
|
|
7763
7250
|
}
|
|
7764
7251
|
return stale;
|
|
7765
7252
|
}
|
|
@@ -11198,47 +10685,55 @@ var require_lib = __commonJS({
|
|
|
11198
10685
|
// node_modules/picocolors/picocolors.js
|
|
11199
10686
|
var require_picocolors = __commonJS({
|
|
11200
10687
|
"node_modules/picocolors/picocolors.js"(exports, module) {
|
|
11201
|
-
var
|
|
11202
|
-
var
|
|
10688
|
+
var argv = process.argv || [];
|
|
10689
|
+
var env2 = process.env;
|
|
10690
|
+
var isColorSupported = !("NO_COLOR" in env2 || argv.includes("--no-color")) && ("FORCE_COLOR" in env2 || argv.includes("--color") || process.platform === "win32" || __require != null && __require("tty").isatty(1) && env2.TERM !== "dumb" || "CI" in env2);
|
|
11203
10691
|
var formatter = (open, close, replace = open) => (input) => {
|
|
11204
10692
|
let string = "" + input;
|
|
11205
10693
|
let index = string.indexOf(close, open.length);
|
|
11206
10694
|
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
11207
10695
|
};
|
|
11208
10696
|
var replaceClose = (string, close, replace, index) => {
|
|
11209
|
-
let
|
|
11210
|
-
let
|
|
11211
|
-
|
|
11212
|
-
|
|
10697
|
+
let result = "";
|
|
10698
|
+
let cursor2 = 0;
|
|
10699
|
+
do {
|
|
10700
|
+
result += string.substring(cursor2, index) + replace;
|
|
10701
|
+
cursor2 = index + close.length;
|
|
10702
|
+
index = string.indexOf(close, cursor2);
|
|
10703
|
+
} while (~index);
|
|
10704
|
+
return result + string.substring(cursor2);
|
|
10705
|
+
};
|
|
10706
|
+
var createColors = (enabled = isColorSupported) => {
|
|
10707
|
+
let init = enabled ? formatter : () => String;
|
|
10708
|
+
return {
|
|
10709
|
+
isColorSupported: enabled,
|
|
10710
|
+
reset: init("\x1B[0m", "\x1B[0m"),
|
|
10711
|
+
bold: init("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
10712
|
+
dim: init("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
10713
|
+
italic: init("\x1B[3m", "\x1B[23m"),
|
|
10714
|
+
underline: init("\x1B[4m", "\x1B[24m"),
|
|
10715
|
+
inverse: init("\x1B[7m", "\x1B[27m"),
|
|
10716
|
+
hidden: init("\x1B[8m", "\x1B[28m"),
|
|
10717
|
+
strikethrough: init("\x1B[9m", "\x1B[29m"),
|
|
10718
|
+
black: init("\x1B[30m", "\x1B[39m"),
|
|
10719
|
+
red: init("\x1B[31m", "\x1B[39m"),
|
|
10720
|
+
green: init("\x1B[32m", "\x1B[39m"),
|
|
10721
|
+
yellow: init("\x1B[33m", "\x1B[39m"),
|
|
10722
|
+
blue: init("\x1B[34m", "\x1B[39m"),
|
|
10723
|
+
magenta: init("\x1B[35m", "\x1B[39m"),
|
|
10724
|
+
cyan: init("\x1B[36m", "\x1B[39m"),
|
|
10725
|
+
white: init("\x1B[37m", "\x1B[39m"),
|
|
10726
|
+
gray: init("\x1B[90m", "\x1B[39m"),
|
|
10727
|
+
bgBlack: init("\x1B[40m", "\x1B[49m"),
|
|
10728
|
+
bgRed: init("\x1B[41m", "\x1B[49m"),
|
|
10729
|
+
bgGreen: init("\x1B[42m", "\x1B[49m"),
|
|
10730
|
+
bgYellow: init("\x1B[43m", "\x1B[49m"),
|
|
10731
|
+
bgBlue: init("\x1B[44m", "\x1B[49m"),
|
|
10732
|
+
bgMagenta: init("\x1B[45m", "\x1B[49m"),
|
|
10733
|
+
bgCyan: init("\x1B[46m", "\x1B[49m"),
|
|
10734
|
+
bgWhite: init("\x1B[47m", "\x1B[49m")
|
|
10735
|
+
};
|
|
11213
10736
|
};
|
|
11214
|
-
var createColors = (enabled = isColorSupported) => ({
|
|
11215
|
-
isColorSupported: enabled,
|
|
11216
|
-
reset: enabled ? (s) => `\x1B[0m${s}\x1B[0m` : String,
|
|
11217
|
-
bold: enabled ? formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m") : String,
|
|
11218
|
-
dim: enabled ? formatter("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m") : String,
|
|
11219
|
-
italic: enabled ? formatter("\x1B[3m", "\x1B[23m") : String,
|
|
11220
|
-
underline: enabled ? formatter("\x1B[4m", "\x1B[24m") : String,
|
|
11221
|
-
inverse: enabled ? formatter("\x1B[7m", "\x1B[27m") : String,
|
|
11222
|
-
hidden: enabled ? formatter("\x1B[8m", "\x1B[28m") : String,
|
|
11223
|
-
strikethrough: enabled ? formatter("\x1B[9m", "\x1B[29m") : String,
|
|
11224
|
-
black: enabled ? formatter("\x1B[30m", "\x1B[39m") : String,
|
|
11225
|
-
red: enabled ? formatter("\x1B[31m", "\x1B[39m") : String,
|
|
11226
|
-
green: enabled ? formatter("\x1B[32m", "\x1B[39m") : String,
|
|
11227
|
-
yellow: enabled ? formatter("\x1B[33m", "\x1B[39m") : String,
|
|
11228
|
-
blue: enabled ? formatter("\x1B[34m", "\x1B[39m") : String,
|
|
11229
|
-
magenta: enabled ? formatter("\x1B[35m", "\x1B[39m") : String,
|
|
11230
|
-
cyan: enabled ? formatter("\x1B[36m", "\x1B[39m") : String,
|
|
11231
|
-
white: enabled ? formatter("\x1B[37m", "\x1B[39m") : String,
|
|
11232
|
-
gray: enabled ? formatter("\x1B[90m", "\x1B[39m") : String,
|
|
11233
|
-
bgBlack: enabled ? formatter("\x1B[40m", "\x1B[49m") : String,
|
|
11234
|
-
bgRed: enabled ? formatter("\x1B[41m", "\x1B[49m") : String,
|
|
11235
|
-
bgGreen: enabled ? formatter("\x1B[42m", "\x1B[49m") : String,
|
|
11236
|
-
bgYellow: enabled ? formatter("\x1B[43m", "\x1B[49m") : String,
|
|
11237
|
-
bgBlue: enabled ? formatter("\x1B[44m", "\x1B[49m") : String,
|
|
11238
|
-
bgMagenta: enabled ? formatter("\x1B[45m", "\x1B[49m") : String,
|
|
11239
|
-
bgCyan: enabled ? formatter("\x1B[46m", "\x1B[49m") : String,
|
|
11240
|
-
bgWhite: enabled ? formatter("\x1B[47m", "\x1B[49m") : String
|
|
11241
|
-
});
|
|
11242
10737
|
module.exports = createColors();
|
|
11243
10738
|
module.exports.createColors = createColors;
|
|
11244
10739
|
}
|
|
@@ -11293,7 +10788,7 @@ var require_lib2 = __commonJS({
|
|
|
11293
10788
|
}
|
|
11294
10789
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
11295
10790
|
var BRACKET = /^[()[\]{}]$/;
|
|
11296
|
-
var
|
|
10791
|
+
var tokenize2;
|
|
11297
10792
|
{
|
|
11298
10793
|
const JSX_TAG = /^[a-z][\w-]*$/i;
|
|
11299
10794
|
const getTokenType = function(token2, offset, text) {
|
|
@@ -11316,7 +10811,7 @@ var require_lib2 = __commonJS({
|
|
|
11316
10811
|
}
|
|
11317
10812
|
return token2.type;
|
|
11318
10813
|
};
|
|
11319
|
-
|
|
10814
|
+
tokenize2 = function* (text) {
|
|
11320
10815
|
let match;
|
|
11321
10816
|
while (match = _jsTokens.default.exec(text)) {
|
|
11322
10817
|
const token2 = _jsTokens.matchToToken(match);
|
|
@@ -11332,7 +10827,7 @@ var require_lib2 = __commonJS({
|
|
|
11332
10827
|
for (const {
|
|
11333
10828
|
type: type2,
|
|
11334
10829
|
value
|
|
11335
|
-
} of
|
|
10830
|
+
} of tokenize2(text)) {
|
|
11336
10831
|
const colorize = defs[type2];
|
|
11337
10832
|
if (colorize) {
|
|
11338
10833
|
highlighted += value.split(NEWLINE).map((str2) => colorize(str2)).join("\n");
|
|
@@ -11455,17 +10950,17 @@ var require_lib3 = __commonJS({
|
|
|
11455
10950
|
if (endLine === -1) {
|
|
11456
10951
|
end = source2.length;
|
|
11457
10952
|
}
|
|
11458
|
-
const
|
|
10953
|
+
const lineDiff2 = endLine - startLine;
|
|
11459
10954
|
const markerLines = {};
|
|
11460
|
-
if (
|
|
11461
|
-
for (let i = 0; i <=
|
|
10955
|
+
if (lineDiff2) {
|
|
10956
|
+
for (let i = 0; i <= lineDiff2; i++) {
|
|
11462
10957
|
const lineNumber = i + startLine;
|
|
11463
10958
|
if (!startColumn) {
|
|
11464
10959
|
markerLines[lineNumber] = true;
|
|
11465
10960
|
} else if (i === 0) {
|
|
11466
10961
|
const sourceLength = source2[lineNumber - 1].length;
|
|
11467
10962
|
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
|
11468
|
-
} else if (i ===
|
|
10963
|
+
} else if (i === lineDiff2) {
|
|
11469
10964
|
markerLines[lineNumber] = [0, endColumn];
|
|
11470
10965
|
} else {
|
|
11471
10966
|
const sourceLength = source2[lineNumber - i].length;
|
|
@@ -12061,38 +11556,6 @@ var require_readlines = __commonJS({
|
|
|
12061
11556
|
}
|
|
12062
11557
|
});
|
|
12063
11558
|
|
|
12064
|
-
// node_modules/diff/lib/diff/array.js
|
|
12065
|
-
var require_array2 = __commonJS({
|
|
12066
|
-
"node_modules/diff/lib/diff/array.js"(exports) {
|
|
12067
|
-
"use strict";
|
|
12068
|
-
Object.defineProperty(exports, "__esModule", {
|
|
12069
|
-
value: true
|
|
12070
|
-
});
|
|
12071
|
-
exports.diffArrays = diffArrays2;
|
|
12072
|
-
exports.arrayDiff = void 0;
|
|
12073
|
-
var _base = _interopRequireDefault(require_base());
|
|
12074
|
-
function _interopRequireDefault(obj) {
|
|
12075
|
-
return obj && obj.__esModule ? obj : { "default": obj };
|
|
12076
|
-
}
|
|
12077
|
-
var arrayDiff = new /*istanbul ignore start*/
|
|
12078
|
-
_base[
|
|
12079
|
-
/*istanbul ignore start*/
|
|
12080
|
-
"default"
|
|
12081
|
-
/*istanbul ignore end*/
|
|
12082
|
-
]();
|
|
12083
|
-
exports.arrayDiff = arrayDiff;
|
|
12084
|
-
arrayDiff.tokenize = function(value) {
|
|
12085
|
-
return value.slice();
|
|
12086
|
-
};
|
|
12087
|
-
arrayDiff.join = arrayDiff.removeEmpty = function(value) {
|
|
12088
|
-
return value;
|
|
12089
|
-
};
|
|
12090
|
-
function diffArrays2(oldArr, newArr, callback) {
|
|
12091
|
-
return arrayDiff.diff(oldArr, newArr, callback);
|
|
12092
|
-
}
|
|
12093
|
-
}
|
|
12094
|
-
});
|
|
12095
|
-
|
|
12096
11559
|
// src/index.js
|
|
12097
11560
|
var src_exports = {};
|
|
12098
11561
|
__export(src_exports, {
|
|
@@ -12110,7 +11573,510 @@ __export(src_exports, {
|
|
|
12110
11573
|
util: () => public_exports,
|
|
12111
11574
|
version: () => version_evaluate_default
|
|
12112
11575
|
});
|
|
12113
|
-
|
|
11576
|
+
|
|
11577
|
+
// node_modules/diff/lib/index.mjs
|
|
11578
|
+
function Diff() {
|
|
11579
|
+
}
|
|
11580
|
+
Diff.prototype = {
|
|
11581
|
+
diff: function diff(oldString, newString) {
|
|
11582
|
+
var _options$timeout;
|
|
11583
|
+
var options8 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
11584
|
+
var callback = options8.callback;
|
|
11585
|
+
if (typeof options8 === "function") {
|
|
11586
|
+
callback = options8;
|
|
11587
|
+
options8 = {};
|
|
11588
|
+
}
|
|
11589
|
+
this.options = options8;
|
|
11590
|
+
var self = this;
|
|
11591
|
+
function done(value) {
|
|
11592
|
+
if (callback) {
|
|
11593
|
+
setTimeout(function() {
|
|
11594
|
+
callback(void 0, value);
|
|
11595
|
+
}, 0);
|
|
11596
|
+
return true;
|
|
11597
|
+
} else {
|
|
11598
|
+
return value;
|
|
11599
|
+
}
|
|
11600
|
+
}
|
|
11601
|
+
oldString = this.castInput(oldString);
|
|
11602
|
+
newString = this.castInput(newString);
|
|
11603
|
+
oldString = this.removeEmpty(this.tokenize(oldString));
|
|
11604
|
+
newString = this.removeEmpty(this.tokenize(newString));
|
|
11605
|
+
var newLen = newString.length, oldLen = oldString.length;
|
|
11606
|
+
var editLength = 1;
|
|
11607
|
+
var maxEditLength = newLen + oldLen;
|
|
11608
|
+
if (options8.maxEditLength) {
|
|
11609
|
+
maxEditLength = Math.min(maxEditLength, options8.maxEditLength);
|
|
11610
|
+
}
|
|
11611
|
+
var maxExecutionTime = (_options$timeout = options8.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity;
|
|
11612
|
+
var abortAfterTimestamp = Date.now() + maxExecutionTime;
|
|
11613
|
+
var bestPath = [{
|
|
11614
|
+
oldPos: -1,
|
|
11615
|
+
lastComponent: void 0
|
|
11616
|
+
}];
|
|
11617
|
+
var newPos = this.extractCommon(bestPath[0], newString, oldString, 0);
|
|
11618
|
+
if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
|
11619
|
+
return done([{
|
|
11620
|
+
value: this.join(newString),
|
|
11621
|
+
count: newString.length
|
|
11622
|
+
}]);
|
|
11623
|
+
}
|
|
11624
|
+
var minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;
|
|
11625
|
+
function execEditLength() {
|
|
11626
|
+
for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
|
|
11627
|
+
var basePath = void 0;
|
|
11628
|
+
var removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];
|
|
11629
|
+
if (removePath) {
|
|
11630
|
+
bestPath[diagonalPath - 1] = void 0;
|
|
11631
|
+
}
|
|
11632
|
+
var canAdd = false;
|
|
11633
|
+
if (addPath) {
|
|
11634
|
+
var addPathNewPos = addPath.oldPos - diagonalPath;
|
|
11635
|
+
canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
|
|
11636
|
+
}
|
|
11637
|
+
var canRemove = removePath && removePath.oldPos + 1 < oldLen;
|
|
11638
|
+
if (!canAdd && !canRemove) {
|
|
11639
|
+
bestPath[diagonalPath] = void 0;
|
|
11640
|
+
continue;
|
|
11641
|
+
}
|
|
11642
|
+
if (!canRemove || canAdd && removePath.oldPos + 1 < addPath.oldPos) {
|
|
11643
|
+
basePath = self.addToPath(addPath, true, void 0, 0);
|
|
11644
|
+
} else {
|
|
11645
|
+
basePath = self.addToPath(removePath, void 0, true, 1);
|
|
11646
|
+
}
|
|
11647
|
+
newPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
|
|
11648
|
+
if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
|
11649
|
+
return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
|
|
11650
|
+
} else {
|
|
11651
|
+
bestPath[diagonalPath] = basePath;
|
|
11652
|
+
if (basePath.oldPos + 1 >= oldLen) {
|
|
11653
|
+
maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
|
|
11654
|
+
}
|
|
11655
|
+
if (newPos + 1 >= newLen) {
|
|
11656
|
+
minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
|
|
11657
|
+
}
|
|
11658
|
+
}
|
|
11659
|
+
}
|
|
11660
|
+
editLength++;
|
|
11661
|
+
}
|
|
11662
|
+
if (callback) {
|
|
11663
|
+
(function exec() {
|
|
11664
|
+
setTimeout(function() {
|
|
11665
|
+
if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
|
|
11666
|
+
return callback();
|
|
11667
|
+
}
|
|
11668
|
+
if (!execEditLength()) {
|
|
11669
|
+
exec();
|
|
11670
|
+
}
|
|
11671
|
+
}, 0);
|
|
11672
|
+
})();
|
|
11673
|
+
} else {
|
|
11674
|
+
while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
|
|
11675
|
+
var ret = execEditLength();
|
|
11676
|
+
if (ret) {
|
|
11677
|
+
return ret;
|
|
11678
|
+
}
|
|
11679
|
+
}
|
|
11680
|
+
}
|
|
11681
|
+
},
|
|
11682
|
+
addToPath: function addToPath(path13, added, removed, oldPosInc) {
|
|
11683
|
+
var last = path13.lastComponent;
|
|
11684
|
+
if (last && last.added === added && last.removed === removed) {
|
|
11685
|
+
return {
|
|
11686
|
+
oldPos: path13.oldPos + oldPosInc,
|
|
11687
|
+
lastComponent: {
|
|
11688
|
+
count: last.count + 1,
|
|
11689
|
+
added,
|
|
11690
|
+
removed,
|
|
11691
|
+
previousComponent: last.previousComponent
|
|
11692
|
+
}
|
|
11693
|
+
};
|
|
11694
|
+
} else {
|
|
11695
|
+
return {
|
|
11696
|
+
oldPos: path13.oldPos + oldPosInc,
|
|
11697
|
+
lastComponent: {
|
|
11698
|
+
count: 1,
|
|
11699
|
+
added,
|
|
11700
|
+
removed,
|
|
11701
|
+
previousComponent: last
|
|
11702
|
+
}
|
|
11703
|
+
};
|
|
11704
|
+
}
|
|
11705
|
+
},
|
|
11706
|
+
extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
|
|
11707
|
+
var newLen = newString.length, oldLen = oldString.length, oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
|
|
11708
|
+
while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
|
|
11709
|
+
newPos++;
|
|
11710
|
+
oldPos++;
|
|
11711
|
+
commonCount++;
|
|
11712
|
+
}
|
|
11713
|
+
if (commonCount) {
|
|
11714
|
+
basePath.lastComponent = {
|
|
11715
|
+
count: commonCount,
|
|
11716
|
+
previousComponent: basePath.lastComponent
|
|
11717
|
+
};
|
|
11718
|
+
}
|
|
11719
|
+
basePath.oldPos = oldPos;
|
|
11720
|
+
return newPos;
|
|
11721
|
+
},
|
|
11722
|
+
equals: function equals(left, right) {
|
|
11723
|
+
if (this.options.comparator) {
|
|
11724
|
+
return this.options.comparator(left, right);
|
|
11725
|
+
} else {
|
|
11726
|
+
return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
|
|
11727
|
+
}
|
|
11728
|
+
},
|
|
11729
|
+
removeEmpty: function removeEmpty(array2) {
|
|
11730
|
+
var ret = [];
|
|
11731
|
+
for (var i = 0; i < array2.length; i++) {
|
|
11732
|
+
if (array2[i]) {
|
|
11733
|
+
ret.push(array2[i]);
|
|
11734
|
+
}
|
|
11735
|
+
}
|
|
11736
|
+
return ret;
|
|
11737
|
+
},
|
|
11738
|
+
castInput: function castInput(value) {
|
|
11739
|
+
return value;
|
|
11740
|
+
},
|
|
11741
|
+
tokenize: function tokenize(value) {
|
|
11742
|
+
return value.split("");
|
|
11743
|
+
},
|
|
11744
|
+
join: function join(chars) {
|
|
11745
|
+
return chars.join("");
|
|
11746
|
+
}
|
|
11747
|
+
};
|
|
11748
|
+
function buildValues(diff2, lastComponent, newString, oldString, useLongestToken) {
|
|
11749
|
+
var components = [];
|
|
11750
|
+
var nextComponent;
|
|
11751
|
+
while (lastComponent) {
|
|
11752
|
+
components.push(lastComponent);
|
|
11753
|
+
nextComponent = lastComponent.previousComponent;
|
|
11754
|
+
delete lastComponent.previousComponent;
|
|
11755
|
+
lastComponent = nextComponent;
|
|
11756
|
+
}
|
|
11757
|
+
components.reverse();
|
|
11758
|
+
var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0;
|
|
11759
|
+
for (; componentPos < componentLen; componentPos++) {
|
|
11760
|
+
var component = components[componentPos];
|
|
11761
|
+
if (!component.removed) {
|
|
11762
|
+
if (!component.added && useLongestToken) {
|
|
11763
|
+
var value = newString.slice(newPos, newPos + component.count);
|
|
11764
|
+
value = value.map(function(value2, i) {
|
|
11765
|
+
var oldValue = oldString[oldPos + i];
|
|
11766
|
+
return oldValue.length > value2.length ? oldValue : value2;
|
|
11767
|
+
});
|
|
11768
|
+
component.value = diff2.join(value);
|
|
11769
|
+
} else {
|
|
11770
|
+
component.value = diff2.join(newString.slice(newPos, newPos + component.count));
|
|
11771
|
+
}
|
|
11772
|
+
newPos += component.count;
|
|
11773
|
+
if (!component.added) {
|
|
11774
|
+
oldPos += component.count;
|
|
11775
|
+
}
|
|
11776
|
+
} else {
|
|
11777
|
+
component.value = diff2.join(oldString.slice(oldPos, oldPos + component.count));
|
|
11778
|
+
oldPos += component.count;
|
|
11779
|
+
if (componentPos && components[componentPos - 1].added) {
|
|
11780
|
+
var tmp = components[componentPos - 1];
|
|
11781
|
+
components[componentPos - 1] = components[componentPos];
|
|
11782
|
+
components[componentPos] = tmp;
|
|
11783
|
+
}
|
|
11784
|
+
}
|
|
11785
|
+
}
|
|
11786
|
+
var finalComponent = components[componentLen - 1];
|
|
11787
|
+
if (componentLen > 1 && typeof finalComponent.value === "string" && (finalComponent.added || finalComponent.removed) && diff2.equals("", finalComponent.value)) {
|
|
11788
|
+
components[componentLen - 2].value += finalComponent.value;
|
|
11789
|
+
components.pop();
|
|
11790
|
+
}
|
|
11791
|
+
return components;
|
|
11792
|
+
}
|
|
11793
|
+
var characterDiff = new Diff();
|
|
11794
|
+
var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/;
|
|
11795
|
+
var reWhitespace = /\S/;
|
|
11796
|
+
var wordDiff = new Diff();
|
|
11797
|
+
wordDiff.equals = function(left, right) {
|
|
11798
|
+
if (this.options.ignoreCase) {
|
|
11799
|
+
left = left.toLowerCase();
|
|
11800
|
+
right = right.toLowerCase();
|
|
11801
|
+
}
|
|
11802
|
+
return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right);
|
|
11803
|
+
};
|
|
11804
|
+
wordDiff.tokenize = function(value) {
|
|
11805
|
+
var tokens = value.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/);
|
|
11806
|
+
for (var i = 0; i < tokens.length - 1; i++) {
|
|
11807
|
+
if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) {
|
|
11808
|
+
tokens[i] += tokens[i + 2];
|
|
11809
|
+
tokens.splice(i + 1, 2);
|
|
11810
|
+
i--;
|
|
11811
|
+
}
|
|
11812
|
+
}
|
|
11813
|
+
return tokens;
|
|
11814
|
+
};
|
|
11815
|
+
var lineDiff = new Diff();
|
|
11816
|
+
lineDiff.tokenize = function(value) {
|
|
11817
|
+
if (this.options.stripTrailingCr) {
|
|
11818
|
+
value = value.replace(/\r\n/g, "\n");
|
|
11819
|
+
}
|
|
11820
|
+
var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
|
|
11821
|
+
if (!linesAndNewlines[linesAndNewlines.length - 1]) {
|
|
11822
|
+
linesAndNewlines.pop();
|
|
11823
|
+
}
|
|
11824
|
+
for (var i = 0; i < linesAndNewlines.length; i++) {
|
|
11825
|
+
var line3 = linesAndNewlines[i];
|
|
11826
|
+
if (i % 2 && !this.options.newlineIsToken) {
|
|
11827
|
+
retLines[retLines.length - 1] += line3;
|
|
11828
|
+
} else {
|
|
11829
|
+
if (this.options.ignoreWhitespace) {
|
|
11830
|
+
line3 = line3.trim();
|
|
11831
|
+
}
|
|
11832
|
+
retLines.push(line3);
|
|
11833
|
+
}
|
|
11834
|
+
}
|
|
11835
|
+
return retLines;
|
|
11836
|
+
};
|
|
11837
|
+
function diffLines(oldStr, newStr, callback) {
|
|
11838
|
+
return lineDiff.diff(oldStr, newStr, callback);
|
|
11839
|
+
}
|
|
11840
|
+
var sentenceDiff = new Diff();
|
|
11841
|
+
sentenceDiff.tokenize = function(value) {
|
|
11842
|
+
return value.split(/(\S.+?[.!?])(?=\s+|$)/);
|
|
11843
|
+
};
|
|
11844
|
+
var cssDiff = new Diff();
|
|
11845
|
+
cssDiff.tokenize = function(value) {
|
|
11846
|
+
return value.split(/([{}:;,]|\s+)/);
|
|
11847
|
+
};
|
|
11848
|
+
function _typeof(obj) {
|
|
11849
|
+
"@babel/helpers - typeof";
|
|
11850
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
11851
|
+
_typeof = function(obj2) {
|
|
11852
|
+
return typeof obj2;
|
|
11853
|
+
};
|
|
11854
|
+
} else {
|
|
11855
|
+
_typeof = function(obj2) {
|
|
11856
|
+
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
11857
|
+
};
|
|
11858
|
+
}
|
|
11859
|
+
return _typeof(obj);
|
|
11860
|
+
}
|
|
11861
|
+
function _toConsumableArray(arr) {
|
|
11862
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
11863
|
+
}
|
|
11864
|
+
function _arrayWithoutHoles(arr) {
|
|
11865
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
11866
|
+
}
|
|
11867
|
+
function _iterableToArray(iter) {
|
|
11868
|
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
|
11869
|
+
}
|
|
11870
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
11871
|
+
if (!o) return;
|
|
11872
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
11873
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
11874
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
11875
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
11876
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
11877
|
+
}
|
|
11878
|
+
function _arrayLikeToArray(arr, len) {
|
|
11879
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
11880
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
11881
|
+
return arr2;
|
|
11882
|
+
}
|
|
11883
|
+
function _nonIterableSpread() {
|
|
11884
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
11885
|
+
}
|
|
11886
|
+
var objectPrototypeToString = Object.prototype.toString;
|
|
11887
|
+
var jsonDiff = new Diff();
|
|
11888
|
+
jsonDiff.useLongestToken = true;
|
|
11889
|
+
jsonDiff.tokenize = lineDiff.tokenize;
|
|
11890
|
+
jsonDiff.castInput = function(value) {
|
|
11891
|
+
var _this$options = this.options, undefinedReplacement = _this$options.undefinedReplacement, _this$options$stringi = _this$options.stringifyReplacer, stringifyReplacer = _this$options$stringi === void 0 ? function(k, v) {
|
|
11892
|
+
return typeof v === "undefined" ? undefinedReplacement : v;
|
|
11893
|
+
} : _this$options$stringi;
|
|
11894
|
+
return typeof value === "string" ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, " ");
|
|
11895
|
+
};
|
|
11896
|
+
jsonDiff.equals = function(left, right) {
|
|
11897
|
+
return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1"));
|
|
11898
|
+
};
|
|
11899
|
+
function canonicalize(obj, stack2, replacementStack, replacer, key2) {
|
|
11900
|
+
stack2 = stack2 || [];
|
|
11901
|
+
replacementStack = replacementStack || [];
|
|
11902
|
+
if (replacer) {
|
|
11903
|
+
obj = replacer(key2, obj);
|
|
11904
|
+
}
|
|
11905
|
+
var i;
|
|
11906
|
+
for (i = 0; i < stack2.length; i += 1) {
|
|
11907
|
+
if (stack2[i] === obj) {
|
|
11908
|
+
return replacementStack[i];
|
|
11909
|
+
}
|
|
11910
|
+
}
|
|
11911
|
+
var canonicalizedObj;
|
|
11912
|
+
if ("[object Array]" === objectPrototypeToString.call(obj)) {
|
|
11913
|
+
stack2.push(obj);
|
|
11914
|
+
canonicalizedObj = new Array(obj.length);
|
|
11915
|
+
replacementStack.push(canonicalizedObj);
|
|
11916
|
+
for (i = 0; i < obj.length; i += 1) {
|
|
11917
|
+
canonicalizedObj[i] = canonicalize(obj[i], stack2, replacementStack, replacer, key2);
|
|
11918
|
+
}
|
|
11919
|
+
stack2.pop();
|
|
11920
|
+
replacementStack.pop();
|
|
11921
|
+
return canonicalizedObj;
|
|
11922
|
+
}
|
|
11923
|
+
if (obj && obj.toJSON) {
|
|
11924
|
+
obj = obj.toJSON();
|
|
11925
|
+
}
|
|
11926
|
+
if (_typeof(obj) === "object" && obj !== null) {
|
|
11927
|
+
stack2.push(obj);
|
|
11928
|
+
canonicalizedObj = {};
|
|
11929
|
+
replacementStack.push(canonicalizedObj);
|
|
11930
|
+
var sortedKeys = [], _key;
|
|
11931
|
+
for (_key in obj) {
|
|
11932
|
+
if (obj.hasOwnProperty(_key)) {
|
|
11933
|
+
sortedKeys.push(_key);
|
|
11934
|
+
}
|
|
11935
|
+
}
|
|
11936
|
+
sortedKeys.sort();
|
|
11937
|
+
for (i = 0; i < sortedKeys.length; i += 1) {
|
|
11938
|
+
_key = sortedKeys[i];
|
|
11939
|
+
canonicalizedObj[_key] = canonicalize(obj[_key], stack2, replacementStack, replacer, _key);
|
|
11940
|
+
}
|
|
11941
|
+
stack2.pop();
|
|
11942
|
+
replacementStack.pop();
|
|
11943
|
+
} else {
|
|
11944
|
+
canonicalizedObj = obj;
|
|
11945
|
+
}
|
|
11946
|
+
return canonicalizedObj;
|
|
11947
|
+
}
|
|
11948
|
+
var arrayDiff = new Diff();
|
|
11949
|
+
arrayDiff.tokenize = function(value) {
|
|
11950
|
+
return value.slice();
|
|
11951
|
+
};
|
|
11952
|
+
arrayDiff.join = arrayDiff.removeEmpty = function(value) {
|
|
11953
|
+
return value;
|
|
11954
|
+
};
|
|
11955
|
+
function diffArrays(oldArr, newArr, callback) {
|
|
11956
|
+
return arrayDiff.diff(oldArr, newArr, callback);
|
|
11957
|
+
}
|
|
11958
|
+
function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8) {
|
|
11959
|
+
if (!options8) {
|
|
11960
|
+
options8 = {};
|
|
11961
|
+
}
|
|
11962
|
+
if (typeof options8.context === "undefined") {
|
|
11963
|
+
options8.context = 4;
|
|
11964
|
+
}
|
|
11965
|
+
var diff2 = diffLines(oldStr, newStr, options8);
|
|
11966
|
+
if (!diff2) {
|
|
11967
|
+
return;
|
|
11968
|
+
}
|
|
11969
|
+
diff2.push({
|
|
11970
|
+
value: "",
|
|
11971
|
+
lines: []
|
|
11972
|
+
});
|
|
11973
|
+
function contextLines(lines) {
|
|
11974
|
+
return lines.map(function(entry) {
|
|
11975
|
+
return " " + entry;
|
|
11976
|
+
});
|
|
11977
|
+
}
|
|
11978
|
+
var hunks = [];
|
|
11979
|
+
var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1;
|
|
11980
|
+
var _loop = function _loop2(i2) {
|
|
11981
|
+
var current = diff2[i2], lines = current.lines || current.value.replace(/\n$/, "").split("\n");
|
|
11982
|
+
current.lines = lines;
|
|
11983
|
+
if (current.added || current.removed) {
|
|
11984
|
+
var _curRange;
|
|
11985
|
+
if (!oldRangeStart) {
|
|
11986
|
+
var prev = diff2[i2 - 1];
|
|
11987
|
+
oldRangeStart = oldLine;
|
|
11988
|
+
newRangeStart = newLine;
|
|
11989
|
+
if (prev) {
|
|
11990
|
+
curRange = options8.context > 0 ? contextLines(prev.lines.slice(-options8.context)) : [];
|
|
11991
|
+
oldRangeStart -= curRange.length;
|
|
11992
|
+
newRangeStart -= curRange.length;
|
|
11993
|
+
}
|
|
11994
|
+
}
|
|
11995
|
+
(_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function(entry) {
|
|
11996
|
+
return (current.added ? "+" : "-") + entry;
|
|
11997
|
+
})));
|
|
11998
|
+
if (current.added) {
|
|
11999
|
+
newLine += lines.length;
|
|
12000
|
+
} else {
|
|
12001
|
+
oldLine += lines.length;
|
|
12002
|
+
}
|
|
12003
|
+
} else {
|
|
12004
|
+
if (oldRangeStart) {
|
|
12005
|
+
if (lines.length <= options8.context * 2 && i2 < diff2.length - 2) {
|
|
12006
|
+
var _curRange2;
|
|
12007
|
+
(_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));
|
|
12008
|
+
} else {
|
|
12009
|
+
var _curRange3;
|
|
12010
|
+
var contextSize = Math.min(lines.length, options8.context);
|
|
12011
|
+
(_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));
|
|
12012
|
+
var hunk = {
|
|
12013
|
+
oldStart: oldRangeStart,
|
|
12014
|
+
oldLines: oldLine - oldRangeStart + contextSize,
|
|
12015
|
+
newStart: newRangeStart,
|
|
12016
|
+
newLines: newLine - newRangeStart + contextSize,
|
|
12017
|
+
lines: curRange
|
|
12018
|
+
};
|
|
12019
|
+
if (i2 >= diff2.length - 2 && lines.length <= options8.context) {
|
|
12020
|
+
var oldEOFNewline = /\n$/.test(oldStr);
|
|
12021
|
+
var newEOFNewline = /\n$/.test(newStr);
|
|
12022
|
+
var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines;
|
|
12023
|
+
if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) {
|
|
12024
|
+
curRange.splice(hunk.oldLines, 0, "\");
|
|
12025
|
+
}
|
|
12026
|
+
if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) {
|
|
12027
|
+
curRange.push("\");
|
|
12028
|
+
}
|
|
12029
|
+
}
|
|
12030
|
+
hunks.push(hunk);
|
|
12031
|
+
oldRangeStart = 0;
|
|
12032
|
+
newRangeStart = 0;
|
|
12033
|
+
curRange = [];
|
|
12034
|
+
}
|
|
12035
|
+
}
|
|
12036
|
+
oldLine += lines.length;
|
|
12037
|
+
newLine += lines.length;
|
|
12038
|
+
}
|
|
12039
|
+
};
|
|
12040
|
+
for (var i = 0; i < diff2.length; i++) {
|
|
12041
|
+
_loop(i);
|
|
12042
|
+
}
|
|
12043
|
+
return {
|
|
12044
|
+
oldFileName,
|
|
12045
|
+
newFileName,
|
|
12046
|
+
oldHeader,
|
|
12047
|
+
newHeader,
|
|
12048
|
+
hunks
|
|
12049
|
+
};
|
|
12050
|
+
}
|
|
12051
|
+
function formatPatch(diff2) {
|
|
12052
|
+
if (Array.isArray(diff2)) {
|
|
12053
|
+
return diff2.map(formatPatch).join("\n");
|
|
12054
|
+
}
|
|
12055
|
+
var ret = [];
|
|
12056
|
+
if (diff2.oldFileName == diff2.newFileName) {
|
|
12057
|
+
ret.push("Index: " + diff2.oldFileName);
|
|
12058
|
+
}
|
|
12059
|
+
ret.push("===================================================================");
|
|
12060
|
+
ret.push("--- " + diff2.oldFileName + (typeof diff2.oldHeader === "undefined" ? "" : " " + diff2.oldHeader));
|
|
12061
|
+
ret.push("+++ " + diff2.newFileName + (typeof diff2.newHeader === "undefined" ? "" : " " + diff2.newHeader));
|
|
12062
|
+
for (var i = 0; i < diff2.hunks.length; i++) {
|
|
12063
|
+
var hunk = diff2.hunks[i];
|
|
12064
|
+
if (hunk.oldLines === 0) {
|
|
12065
|
+
hunk.oldStart -= 1;
|
|
12066
|
+
}
|
|
12067
|
+
if (hunk.newLines === 0) {
|
|
12068
|
+
hunk.newStart -= 1;
|
|
12069
|
+
}
|
|
12070
|
+
ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@");
|
|
12071
|
+
ret.push.apply(ret, hunk.lines);
|
|
12072
|
+
}
|
|
12073
|
+
return ret.join("\n") + "\n";
|
|
12074
|
+
}
|
|
12075
|
+
function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8) {
|
|
12076
|
+
return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options8));
|
|
12077
|
+
}
|
|
12078
|
+
|
|
12079
|
+
// src/index.js
|
|
12114
12080
|
var import_fast_glob = __toESM(require_out4(), 1);
|
|
12115
12081
|
|
|
12116
12082
|
// node_modules/vnopts/lib/descriptors/api.js
|
|
@@ -17754,7 +17720,7 @@ import path10 from "path";
|
|
|
17754
17720
|
import url from "url";
|
|
17755
17721
|
var createIgnore = import_ignore.default.default;
|
|
17756
17722
|
var slash = path10.sep === "\\" ? (filePath) => string_replace_all_default(
|
|
17757
|
-
/* isOptionalObject*/
|
|
17723
|
+
/* isOptionalObject */
|
|
17758
17724
|
false,
|
|
17759
17725
|
filePath,
|
|
17760
17726
|
"\\",
|
|
@@ -17815,11 +17781,11 @@ function getInterpreter(file) {
|
|
|
17815
17781
|
try {
|
|
17816
17782
|
const liner = new import_n_readlines.default(fd);
|
|
17817
17783
|
const firstLine = liner.next().toString("utf8");
|
|
17818
|
-
const m1 = firstLine.match(/^#!\/(?:usr\/)?bin\/env\s+(\S+)/);
|
|
17784
|
+
const m1 = firstLine.match(/^#!\/(?:usr\/)?bin\/env\s+(\S+)/u);
|
|
17819
17785
|
if (m1) {
|
|
17820
17786
|
return m1[1];
|
|
17821
17787
|
}
|
|
17822
|
-
const m2 = firstLine.match(/^#!\/(?:usr\/(?:local\/)?)?bin\/(\S+)/);
|
|
17788
|
+
const m2 = firstLine.match(/^#!\/(?:usr\/(?:local\/)?)?bin\/(\S+)/u);
|
|
17823
17789
|
if (m2) {
|
|
17824
17790
|
return m2[1];
|
|
17825
17791
|
}
|
|
@@ -17833,7 +17799,7 @@ function getInterpreter(file) {
|
|
|
17833
17799
|
var get_interpreter_default = getInterpreter;
|
|
17834
17800
|
|
|
17835
17801
|
// src/utils/infer-parser.js
|
|
17836
|
-
var getFileBasename = (file) => String(file).split(/[/\\]/).pop();
|
|
17802
|
+
var getFileBasename = (file) => String(file).split(/[/\\]/u).pop();
|
|
17837
17803
|
function getLanguageByFileName(languages2, file) {
|
|
17838
17804
|
if (!file) {
|
|
17839
17805
|
return;
|
|
@@ -17905,9 +17871,6 @@ async function getParser(file, options8) {
|
|
|
17905
17871
|
}
|
|
17906
17872
|
var get_file_info_default = getFileInfo;
|
|
17907
17873
|
|
|
17908
|
-
// src/main/core.js
|
|
17909
|
-
var import_array = __toESM(require_array2(), 1);
|
|
17910
|
-
|
|
17911
17874
|
// src/common/end-of-line.js
|
|
17912
17875
|
function guessEndOfLine(text) {
|
|
17913
17876
|
const index = text.indexOf("\r");
|
|
@@ -17930,13 +17893,13 @@ function countEndOfLineChars(text, eol) {
|
|
|
17930
17893
|
let regex;
|
|
17931
17894
|
switch (eol) {
|
|
17932
17895
|
case "\n":
|
|
17933
|
-
regex = /\n/
|
|
17896
|
+
regex = /\n/gu;
|
|
17934
17897
|
break;
|
|
17935
17898
|
case "\r":
|
|
17936
|
-
regex = /\r/
|
|
17899
|
+
regex = /\r/gu;
|
|
17937
17900
|
break;
|
|
17938
17901
|
case "\r\n":
|
|
17939
|
-
regex = /\r\n/
|
|
17902
|
+
regex = /\r\n/gu;
|
|
17940
17903
|
break;
|
|
17941
17904
|
default:
|
|
17942
17905
|
throw new Error(`Unexpected "eol" ${JSON.stringify(eol)}.`);
|
|
@@ -17946,10 +17909,10 @@ function countEndOfLineChars(text, eol) {
|
|
|
17946
17909
|
}
|
|
17947
17910
|
function normalizeEndOfLine(text) {
|
|
17948
17911
|
return string_replace_all_default(
|
|
17949
|
-
/* isOptionalObject*/
|
|
17912
|
+
/* isOptionalObject */
|
|
17950
17913
|
false,
|
|
17951
17914
|
text,
|
|
17952
|
-
/\r\n?/
|
|
17915
|
+
/\r\n?/gu,
|
|
17953
17916
|
"\n"
|
|
17954
17917
|
);
|
|
17955
17918
|
}
|
|
@@ -18326,7 +18289,7 @@ function isWide(x) {
|
|
|
18326
18289
|
var _isNarrowWidth = (codePoint) => !(isFullWidth(codePoint) || isWide(codePoint));
|
|
18327
18290
|
|
|
18328
18291
|
// src/utils/get-string-width.js
|
|
18329
|
-
var notAsciiRegex = /[^\x20-\x7F]
|
|
18292
|
+
var notAsciiRegex = /[^\x20-\x7F]/u;
|
|
18330
18293
|
function getStringWidth(text) {
|
|
18331
18294
|
if (!text) {
|
|
18332
18295
|
return 0;
|
|
@@ -18421,7 +18384,7 @@ function mapDoc(doc2, cb) {
|
|
|
18421
18384
|
function breakParentGroup(groupStack) {
|
|
18422
18385
|
if (groupStack.length > 0) {
|
|
18423
18386
|
const parentGroup = at_default(
|
|
18424
|
-
/* isOptionalObject*/
|
|
18387
|
+
/* isOptionalObject */
|
|
18425
18388
|
false,
|
|
18426
18389
|
groupStack,
|
|
18427
18390
|
-1
|
|
@@ -18466,12 +18429,12 @@ function propagateBreaks(doc2) {
|
|
|
18466
18429
|
function stripTrailingHardlineFromParts(parts) {
|
|
18467
18430
|
parts = [...parts];
|
|
18468
18431
|
while (parts.length >= 2 && at_default(
|
|
18469
|
-
/* isOptionalObject*/
|
|
18432
|
+
/* isOptionalObject */
|
|
18470
18433
|
false,
|
|
18471
18434
|
parts,
|
|
18472
18435
|
-2
|
|
18473
18436
|
).type === DOC_TYPE_LINE && at_default(
|
|
18474
|
-
/* isOptionalObject*/
|
|
18437
|
+
/* isOptionalObject */
|
|
18475
18438
|
false,
|
|
18476
18439
|
parts,
|
|
18477
18440
|
-1
|
|
@@ -18480,7 +18443,7 @@ function stripTrailingHardlineFromParts(parts) {
|
|
|
18480
18443
|
}
|
|
18481
18444
|
if (parts.length > 0) {
|
|
18482
18445
|
const lastPart = stripTrailingHardlineFromDoc(at_default(
|
|
18483
|
-
/* isOptionalObject*/
|
|
18446
|
+
/* isOptionalObject */
|
|
18484
18447
|
false,
|
|
18485
18448
|
parts,
|
|
18486
18449
|
-1
|
|
@@ -18516,7 +18479,7 @@ function stripTrailingHardlineFromDoc(doc2) {
|
|
|
18516
18479
|
case DOC_TYPE_ARRAY:
|
|
18517
18480
|
return stripTrailingHardlineFromParts(doc2);
|
|
18518
18481
|
case DOC_TYPE_STRING:
|
|
18519
|
-
return doc2.replace(/[\n\r]
|
|
18482
|
+
return doc2.replace(/[\n\r]*$/u, "");
|
|
18520
18483
|
case DOC_TYPE_ALIGN:
|
|
18521
18484
|
case DOC_TYPE_CURSOR:
|
|
18522
18485
|
case DOC_TYPE_TRIM:
|
|
@@ -18568,7 +18531,7 @@ function cleanDocFn(doc2) {
|
|
|
18568
18531
|
}
|
|
18569
18532
|
const [currentPart, ...restParts] = Array.isArray(part) ? part : [part];
|
|
18570
18533
|
if (typeof currentPart === "string" && typeof at_default(
|
|
18571
|
-
/* isOptionalObject*/
|
|
18534
|
+
/* isOptionalObject */
|
|
18572
18535
|
false,
|
|
18573
18536
|
parts,
|
|
18574
18537
|
-1
|
|
@@ -18803,7 +18766,7 @@ function fits(next, restCommands, width, hasLineSuffix, groupModeMap, mustBeFlat
|
|
|
18803
18766
|
}
|
|
18804
18767
|
const groupMode = doc2.break ? MODE_BREAK : mode;
|
|
18805
18768
|
const contents = doc2.expandedStates && groupMode === MODE_BREAK ? at_default(
|
|
18806
|
-
/* isOptionalObject*/
|
|
18769
|
+
/* isOptionalObject */
|
|
18807
18770
|
false,
|
|
18808
18771
|
doc2.expandedStates,
|
|
18809
18772
|
-1
|
|
@@ -18870,7 +18833,7 @@ function printDocToString(doc2, options8) {
|
|
|
18870
18833
|
switch (get_doc_type_default(doc3)) {
|
|
18871
18834
|
case DOC_TYPE_STRING: {
|
|
18872
18835
|
const formatted = newLine !== "\n" ? string_replace_all_default(
|
|
18873
|
-
/* isOptionalObject*/
|
|
18836
|
+
/* isOptionalObject */
|
|
18874
18837
|
false,
|
|
18875
18838
|
doc3,
|
|
18876
18839
|
"\n",
|
|
@@ -18940,7 +18903,7 @@ function printDocToString(doc2, options8) {
|
|
|
18940
18903
|
} else {
|
|
18941
18904
|
if (doc3.expandedStates) {
|
|
18942
18905
|
const mostExpanded = at_default(
|
|
18943
|
-
/* isOptionalObject*/
|
|
18906
|
+
/* isOptionalObject */
|
|
18944
18907
|
false,
|
|
18945
18908
|
doc3.expandedStates,
|
|
18946
18909
|
-1
|
|
@@ -18988,7 +18951,7 @@ function printDocToString(doc2, options8) {
|
|
|
18988
18951
|
}
|
|
18989
18952
|
if (doc3.id) {
|
|
18990
18953
|
groupModeMap[doc3.id] = at_default(
|
|
18991
|
-
/* isOptionalObject*/
|
|
18954
|
+
/* isOptionalObject */
|
|
18992
18955
|
false,
|
|
18993
18956
|
cmds,
|
|
18994
18957
|
-1
|
|
@@ -19204,7 +19167,7 @@ var AstPath = class {
|
|
|
19204
19167
|
siblings
|
|
19205
19168
|
} = this;
|
|
19206
19169
|
return at_default(
|
|
19207
|
-
/* isOptionalObject*/
|
|
19170
|
+
/* isOptionalObject */
|
|
19208
19171
|
false,
|
|
19209
19172
|
stack2,
|
|
19210
19173
|
siblings === null ? -2 : -4
|
|
@@ -19213,7 +19176,7 @@ var AstPath = class {
|
|
|
19213
19176
|
/** @type {number | null} */
|
|
19214
19177
|
get index() {
|
|
19215
19178
|
return this.siblings === null ? null : at_default(
|
|
19216
|
-
/* isOptionalObject*/
|
|
19179
|
+
/* isOptionalObject */
|
|
19217
19180
|
false,
|
|
19218
19181
|
this.stack,
|
|
19219
19182
|
-2
|
|
@@ -19222,7 +19185,7 @@ var AstPath = class {
|
|
|
19222
19185
|
/** @type {object} */
|
|
19223
19186
|
get node() {
|
|
19224
19187
|
return at_default(
|
|
19225
|
-
/* isOptionalObject*/
|
|
19188
|
+
/* isOptionalObject */
|
|
19226
19189
|
false,
|
|
19227
19190
|
this.stack,
|
|
19228
19191
|
-1
|
|
@@ -19246,7 +19209,7 @@ var AstPath = class {
|
|
|
19246
19209
|
stack: stack2
|
|
19247
19210
|
} = this;
|
|
19248
19211
|
const maybeArray = at_default(
|
|
19249
|
-
/* isOptionalObject*/
|
|
19212
|
+
/* isOptionalObject */
|
|
19250
19213
|
false,
|
|
19251
19214
|
stack2,
|
|
19252
19215
|
-3
|
|
@@ -19302,7 +19265,7 @@ var AstPath = class {
|
|
|
19302
19265
|
} = stack2;
|
|
19303
19266
|
if (length > 1) {
|
|
19304
19267
|
return at_default(
|
|
19305
|
-
/* isOptionalObject*/
|
|
19268
|
+
/* isOptionalObject */
|
|
19306
19269
|
false,
|
|
19307
19270
|
stack2,
|
|
19308
19271
|
-2
|
|
@@ -19314,7 +19277,7 @@ var AstPath = class {
|
|
|
19314
19277
|
// this.stack.
|
|
19315
19278
|
getValue() {
|
|
19316
19279
|
return at_default(
|
|
19317
|
-
/* isOptionalObject*/
|
|
19280
|
+
/* isOptionalObject */
|
|
19318
19281
|
false,
|
|
19319
19282
|
this.stack,
|
|
19320
19283
|
-1
|
|
@@ -19340,7 +19303,7 @@ var AstPath = class {
|
|
|
19340
19303
|
length
|
|
19341
19304
|
} = stack2;
|
|
19342
19305
|
let value = at_default(
|
|
19343
|
-
/* isOptionalObject*/
|
|
19306
|
+
/* isOptionalObject */
|
|
19344
19307
|
false,
|
|
19345
19308
|
stack2,
|
|
19346
19309
|
-1
|
|
@@ -19355,6 +19318,12 @@ var AstPath = class {
|
|
|
19355
19318
|
stack2.length = length;
|
|
19356
19319
|
}
|
|
19357
19320
|
}
|
|
19321
|
+
/**
|
|
19322
|
+
* @template {(path: AstPath) => any} T
|
|
19323
|
+
* @param {T} callback
|
|
19324
|
+
* @param {number} [count=0]
|
|
19325
|
+
* @returns {ReturnType<T>}
|
|
19326
|
+
*/
|
|
19358
19327
|
callParent(callback, count = 0) {
|
|
19359
19328
|
const stackIndex = __privateMethod(this, _AstPath_instances, getNodeStackIndex_fn).call(this, count + 1);
|
|
19360
19329
|
const parentValues = this.stack.splice(stackIndex + 1);
|
|
@@ -19376,7 +19345,7 @@ var AstPath = class {
|
|
|
19376
19345
|
length
|
|
19377
19346
|
} = stack2;
|
|
19378
19347
|
let value = at_default(
|
|
19379
|
-
/* isOptionalObject*/
|
|
19348
|
+
/* isOptionalObject */
|
|
19380
19349
|
false,
|
|
19381
19350
|
stack2,
|
|
19382
19351
|
-1
|
|
@@ -19552,10 +19521,10 @@ function skip(characters) {
|
|
|
19552
19521
|
return false;
|
|
19553
19522
|
};
|
|
19554
19523
|
}
|
|
19555
|
-
var skipWhitespace = skip(/\s/);
|
|
19524
|
+
var skipWhitespace = skip(/\s/u);
|
|
19556
19525
|
var skipSpaces = skip(" ");
|
|
19557
19526
|
var skipToLineEnd = skip(",; ");
|
|
19558
|
-
var skipEverythingButNewLine = skip(/[^\n\r]/);
|
|
19527
|
+
var skipEverythingButNewLine = skip(/[^\n\r]/u);
|
|
19559
19528
|
|
|
19560
19529
|
// src/utils/skip-newline.js
|
|
19561
19530
|
function skipNewline(text, startIndex, options8) {
|
|
@@ -19847,7 +19816,7 @@ function attachComments(ast, options8) {
|
|
|
19847
19816
|
}
|
|
19848
19817
|
}
|
|
19849
19818
|
}
|
|
19850
|
-
var isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]
|
|
19819
|
+
var isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/u.test(text);
|
|
19851
19820
|
function isOwnLineComment(text, options8, decoratedComments, commentIndex) {
|
|
19852
19821
|
const { comment, precedingNode } = decoratedComments[commentIndex];
|
|
19853
19822
|
const { locStart, locEnd } = options8;
|
|
@@ -19896,7 +19865,7 @@ function breakTies(tiesToBreak, options8) {
|
|
|
19896
19865
|
assert4.strictEqual(currentCommentPrecedingNode, precedingNode);
|
|
19897
19866
|
assert4.strictEqual(currentCommentFollowingNode, followingNode);
|
|
19898
19867
|
const gap = options8.originalText.slice(options8.locEnd(comment), gapEndPos);
|
|
19899
|
-
if (((_b = (_a = options8.printer).isGap) == null ? void 0 : _b.call(_a, gap, options8)) ?? /^[\s(]
|
|
19868
|
+
if (((_b = (_a = options8.printer).isGap) == null ? void 0 : _b.call(_a, gap, options8)) ?? /^[\s(]*$/u.test(gap)) {
|
|
19900
19869
|
gapEndPos = options8.locStart(comment);
|
|
19901
19870
|
} else {
|
|
19902
19871
|
break;
|
|
@@ -20388,7 +20357,7 @@ function normalizeOptionSettings(settings) {
|
|
|
20388
20357
|
};
|
|
20389
20358
|
if (Array.isArray(option.default)) {
|
|
20390
20359
|
option.default = at_default(
|
|
20391
|
-
/* isOptionalObject*/
|
|
20360
|
+
/* isOptionalObject */
|
|
20392
20361
|
false,
|
|
20393
20362
|
option.default,
|
|
20394
20363
|
-1
|
|
@@ -20544,7 +20513,7 @@ function optionInfoToSchema(optionInfo, {
|
|
|
20544
20513
|
if (isCLI && !optionInfo.array) {
|
|
20545
20514
|
const originalPreprocess = parameters.preprocess || ((x) => x);
|
|
20546
20515
|
parameters.preprocess = (value, schema2, utils) => schema2.preprocess(originalPreprocess(Array.isArray(value) ? at_default(
|
|
20547
|
-
/* isOptionalObject*/
|
|
20516
|
+
/* isOptionalObject */
|
|
20548
20517
|
false,
|
|
20549
20518
|
value,
|
|
20550
20519
|
-1
|
|
@@ -20587,7 +20556,7 @@ function getParserPluginByParserName(plugins, parserName) {
|
|
|
20587
20556
|
throw new Error("parserName is required.");
|
|
20588
20557
|
}
|
|
20589
20558
|
const plugin = array_find_last_default(
|
|
20590
|
-
/* isOptionalObject*/
|
|
20559
|
+
/* isOptionalObject */
|
|
20591
20560
|
false,
|
|
20592
20561
|
plugins,
|
|
20593
20562
|
(plugin2) => plugin2.parsers && Object.prototype.hasOwnProperty.call(plugin2.parsers, parserName)
|
|
@@ -20606,7 +20575,7 @@ function getPrinterPluginByAstFormat(plugins, astFormat) {
|
|
|
20606
20575
|
throw new Error("astFormat is required.");
|
|
20607
20576
|
}
|
|
20608
20577
|
const plugin = array_find_last_default(
|
|
20609
|
-
/* isOptionalObject*/
|
|
20578
|
+
/* isOptionalObject */
|
|
20610
20579
|
false,
|
|
20611
20580
|
plugins,
|
|
20612
20581
|
(plugin2) => plugin2.printers && Object.prototype.hasOwnProperty.call(plugin2.printers, astFormat)
|
|
@@ -20982,35 +20951,50 @@ function massageAst(ast, options8) {
|
|
|
20982
20951
|
}
|
|
20983
20952
|
var massage_ast_default = massageAst;
|
|
20984
20953
|
|
|
20954
|
+
// scripts/build/shims/array-find-last-index.js
|
|
20955
|
+
var arrayFindLastIndex = (isOptionalObject, array2, callback) => {
|
|
20956
|
+
if (isOptionalObject && (array2 === void 0 || array2 === null)) {
|
|
20957
|
+
return;
|
|
20958
|
+
}
|
|
20959
|
+
if (array2.findLastIndex) {
|
|
20960
|
+
return array2.findLastIndex(callback);
|
|
20961
|
+
}
|
|
20962
|
+
for (let index = array2.length - 1; index >= 0; index--) {
|
|
20963
|
+
const element = array2[index];
|
|
20964
|
+
if (callback(element, index, array2)) {
|
|
20965
|
+
return index;
|
|
20966
|
+
}
|
|
20967
|
+
}
|
|
20968
|
+
return -1;
|
|
20969
|
+
};
|
|
20970
|
+
var array_find_last_index_default = arrayFindLastIndex;
|
|
20971
|
+
|
|
20985
20972
|
// src/main/range-util.js
|
|
20986
20973
|
import assert5 from "assert";
|
|
20987
|
-
var isJsonParser = ({
|
|
20974
|
+
var isJsonParser = ({
|
|
20975
|
+
parser
|
|
20976
|
+
}) => parser === "json" || parser === "json5" || parser === "jsonc" || parser === "json-stringify";
|
|
20988
20977
|
function findCommonAncestor(startNodeAndParents, endNodeAndParents) {
|
|
20989
|
-
const startNodeAndAncestors = [
|
|
20990
|
-
|
|
20991
|
-
|
|
20992
|
-
];
|
|
20993
|
-
const endNodeAndAncestors = /* @__PURE__ */ new Set([
|
|
20994
|
-
endNodeAndParents.node,
|
|
20995
|
-
...endNodeAndParents.parentNodes
|
|
20996
|
-
]);
|
|
20997
|
-
return startNodeAndAncestors.find(
|
|
20998
|
-
(node) => jsonSourceElements.has(node.type) && endNodeAndAncestors.has(node)
|
|
20999
|
-
);
|
|
20978
|
+
const startNodeAndAncestors = [startNodeAndParents.node, ...startNodeAndParents.parentNodes];
|
|
20979
|
+
const endNodeAndAncestors = /* @__PURE__ */ new Set([endNodeAndParents.node, ...endNodeAndParents.parentNodes]);
|
|
20980
|
+
return startNodeAndAncestors.find((node) => jsonSourceElements.has(node.type) && endNodeAndAncestors.has(node));
|
|
21000
20981
|
}
|
|
21001
20982
|
function dropRootParents(parents) {
|
|
21002
|
-
|
|
21003
|
-
|
|
21004
|
-
|
|
21005
|
-
|
|
21006
|
-
|
|
21007
|
-
|
|
21008
|
-
|
|
21009
|
-
|
|
20983
|
+
const index = array_find_last_index_default(
|
|
20984
|
+
/* isOptionalObject */
|
|
20985
|
+
false,
|
|
20986
|
+
parents,
|
|
20987
|
+
(node) => node.type !== "Program" && node.type !== "File"
|
|
20988
|
+
);
|
|
20989
|
+
if (index === -1) {
|
|
20990
|
+
return parents;
|
|
21010
20991
|
}
|
|
21011
|
-
return parents.slice(0,
|
|
20992
|
+
return parents.slice(0, index + 1);
|
|
21012
20993
|
}
|
|
21013
|
-
function findSiblingAncestors(startNodeAndParents, endNodeAndParents, {
|
|
20994
|
+
function findSiblingAncestors(startNodeAndParents, endNodeAndParents, {
|
|
20995
|
+
locStart,
|
|
20996
|
+
locEnd
|
|
20997
|
+
}) {
|
|
21014
20998
|
let resultStartNode = startNodeAndParents.node;
|
|
21015
20999
|
let resultEndNode = endNodeAndParents.node;
|
|
21016
21000
|
if (resultStartNode === resultEndNode) {
|
|
@@ -21044,21 +21028,17 @@ function findSiblingAncestors(startNodeAndParents, endNodeAndParents, { locStart
|
|
|
21044
21028
|
};
|
|
21045
21029
|
}
|
|
21046
21030
|
function findNodeAtOffset(node, offset, options8, predicate, parentNodes = [], type2) {
|
|
21047
|
-
const {
|
|
21031
|
+
const {
|
|
21032
|
+
locStart,
|
|
21033
|
+
locEnd
|
|
21034
|
+
} = options8;
|
|
21048
21035
|
const start = locStart(node);
|
|
21049
21036
|
const end = locEnd(node);
|
|
21050
21037
|
if (offset > end || offset < start || type2 === "rangeEnd" && offset === start || type2 === "rangeStart" && offset === end) {
|
|
21051
21038
|
return;
|
|
21052
21039
|
}
|
|
21053
21040
|
for (const childNode of getSortedChildNodes(node, options8)) {
|
|
21054
|
-
const childResult = findNodeAtOffset(
|
|
21055
|
-
childNode,
|
|
21056
|
-
offset,
|
|
21057
|
-
options8,
|
|
21058
|
-
predicate,
|
|
21059
|
-
[node, ...parentNodes],
|
|
21060
|
-
type2
|
|
21061
|
-
);
|
|
21041
|
+
const childResult = findNodeAtOffset(childNode, offset, options8, predicate, [node, ...parentNodes], type2);
|
|
21062
21042
|
if (childResult) {
|
|
21063
21043
|
return childResult;
|
|
21064
21044
|
}
|
|
@@ -21073,35 +21053,8 @@ function findNodeAtOffset(node, offset, options8, predicate, parentNodes = [], t
|
|
|
21073
21053
|
function isJsSourceElement(type2, parentType) {
|
|
21074
21054
|
return parentType !== "DeclareExportDeclaration" && type2 !== "TypeParameterDeclaration" && (type2 === "Directive" || type2 === "TypeAlias" || type2 === "TSExportAssignment" || type2.startsWith("Declare") || type2.startsWith("TSDeclare") || type2.endsWith("Statement") || type2.endsWith("Declaration"));
|
|
21075
21055
|
}
|
|
21076
|
-
var jsonSourceElements = /* @__PURE__ */ new Set([
|
|
21077
|
-
|
|
21078
|
-
"ObjectExpression",
|
|
21079
|
-
"ArrayExpression",
|
|
21080
|
-
"StringLiteral",
|
|
21081
|
-
"NumericLiteral",
|
|
21082
|
-
"BooleanLiteral",
|
|
21083
|
-
"NullLiteral",
|
|
21084
|
-
"UnaryExpression",
|
|
21085
|
-
"TemplateLiteral"
|
|
21086
|
-
]);
|
|
21087
|
-
var graphqlSourceElements = /* @__PURE__ */ new Set([
|
|
21088
|
-
"OperationDefinition",
|
|
21089
|
-
"FragmentDefinition",
|
|
21090
|
-
"VariableDefinition",
|
|
21091
|
-
"TypeExtensionDefinition",
|
|
21092
|
-
"ObjectTypeDefinition",
|
|
21093
|
-
"FieldDefinition",
|
|
21094
|
-
"DirectiveDefinition",
|
|
21095
|
-
"EnumTypeDefinition",
|
|
21096
|
-
"EnumValueDefinition",
|
|
21097
|
-
"InputValueDefinition",
|
|
21098
|
-
"InputObjectTypeDefinition",
|
|
21099
|
-
"SchemaDefinition",
|
|
21100
|
-
"OperationTypeDefinition",
|
|
21101
|
-
"InterfaceTypeDefinition",
|
|
21102
|
-
"UnionTypeDefinition",
|
|
21103
|
-
"ScalarTypeDefinition"
|
|
21104
|
-
]);
|
|
21056
|
+
var jsonSourceElements = /* @__PURE__ */ new Set(["JsonRoot", "ObjectExpression", "ArrayExpression", "StringLiteral", "NumericLiteral", "BooleanLiteral", "NullLiteral", "UnaryExpression", "TemplateLiteral"]);
|
|
21057
|
+
var graphqlSourceElements = /* @__PURE__ */ new Set(["OperationDefinition", "FragmentDefinition", "VariableDefinition", "TypeExtensionDefinition", "ObjectTypeDefinition", "FieldDefinition", "DirectiveDefinition", "EnumTypeDefinition", "EnumValueDefinition", "InputValueDefinition", "InputObjectTypeDefinition", "SchemaDefinition", "OperationTypeDefinition", "InterfaceTypeDefinition", "UnionTypeDefinition", "ScalarTypeDefinition"]);
|
|
21105
21058
|
function isSourceElement(opts, node, parentNode) {
|
|
21106
21059
|
if (!node) {
|
|
21107
21060
|
return false;
|
|
@@ -21130,36 +21083,27 @@ function isSourceElement(opts, node, parentNode) {
|
|
|
21130
21083
|
return false;
|
|
21131
21084
|
}
|
|
21132
21085
|
function calculateRange(text, opts, ast) {
|
|
21133
|
-
let {
|
|
21086
|
+
let {
|
|
21087
|
+
rangeStart: start,
|
|
21088
|
+
rangeEnd: end,
|
|
21089
|
+
locStart,
|
|
21090
|
+
locEnd
|
|
21091
|
+
} = opts;
|
|
21134
21092
|
assert5.ok(end > start);
|
|
21135
|
-
const firstNonWhitespaceCharacterIndex = text.slice(start, end).search(/\S/);
|
|
21093
|
+
const firstNonWhitespaceCharacterIndex = text.slice(start, end).search(/\S/u);
|
|
21136
21094
|
const isAllWhitespace = firstNonWhitespaceCharacterIndex === -1;
|
|
21137
21095
|
if (!isAllWhitespace) {
|
|
21138
21096
|
start += firstNonWhitespaceCharacterIndex;
|
|
21139
21097
|
for (; end > start; --end) {
|
|
21140
|
-
if (/\S
|
|
21098
|
+
if (/\S/u.test(text[end - 1])) {
|
|
21141
21099
|
break;
|
|
21142
21100
|
}
|
|
21143
21101
|
}
|
|
21144
21102
|
}
|
|
21145
|
-
const startNodeAndParents = findNodeAtOffset(
|
|
21146
|
-
ast,
|
|
21147
|
-
start,
|
|
21148
|
-
opts,
|
|
21149
|
-
(node, parentNode) => isSourceElement(opts, node, parentNode),
|
|
21150
|
-
[],
|
|
21151
|
-
"rangeStart"
|
|
21152
|
-
);
|
|
21103
|
+
const startNodeAndParents = findNodeAtOffset(ast, start, opts, (node, parentNode) => isSourceElement(opts, node, parentNode), [], "rangeStart");
|
|
21153
21104
|
const endNodeAndParents = (
|
|
21154
21105
|
// No need find Node at `end`, it will be the same as `startNodeAndParents`
|
|
21155
|
-
isAllWhitespace ? startNodeAndParents : findNodeAtOffset(
|
|
21156
|
-
ast,
|
|
21157
|
-
end,
|
|
21158
|
-
opts,
|
|
21159
|
-
(node) => isSourceElement(opts, node),
|
|
21160
|
-
[],
|
|
21161
|
-
"rangeEnd"
|
|
21162
|
-
)
|
|
21106
|
+
isAllWhitespace ? startNodeAndParents : findNodeAtOffset(ast, end, opts, (node) => isSourceElement(opts, node), [], "rangeEnd")
|
|
21163
21107
|
);
|
|
21164
21108
|
if (!startNodeAndParents || !endNodeAndParents) {
|
|
21165
21109
|
return {
|
|
@@ -21170,18 +21114,14 @@ function calculateRange(text, opts, ast) {
|
|
|
21170
21114
|
let startNode;
|
|
21171
21115
|
let endNode;
|
|
21172
21116
|
if (isJsonParser(opts)) {
|
|
21173
|
-
const commonAncestor = findCommonAncestor(
|
|
21174
|
-
startNodeAndParents,
|
|
21175
|
-
endNodeAndParents
|
|
21176
|
-
);
|
|
21117
|
+
const commonAncestor = findCommonAncestor(startNodeAndParents, endNodeAndParents);
|
|
21177
21118
|
startNode = commonAncestor;
|
|
21178
21119
|
endNode = commonAncestor;
|
|
21179
21120
|
} else {
|
|
21180
|
-
({
|
|
21181
|
-
|
|
21182
|
-
|
|
21183
|
-
|
|
21184
|
-
));
|
|
21121
|
+
({
|
|
21122
|
+
startNode,
|
|
21123
|
+
endNode
|
|
21124
|
+
} = findSiblingAncestors(startNodeAndParents, endNodeAndParents, opts));
|
|
21185
21125
|
}
|
|
21186
21126
|
return {
|
|
21187
21127
|
rangeStart: Math.min(locStart(startNode), locStart(endNode)),
|
|
@@ -21249,7 +21189,7 @@ async function coreFormat(originalText, opts, addAlignmentSize = 0) {
|
|
|
21249
21189
|
const oldCursorNodeCharArray = oldCursorNodeText.split("");
|
|
21250
21190
|
oldCursorNodeCharArray.splice(cursorOffsetRelativeToOldCursorNode, 0, CURSOR);
|
|
21251
21191
|
const newCursorNodeCharArray = newCursorNodeText.split("");
|
|
21252
|
-
const cursorNodeDiff =
|
|
21192
|
+
const cursorNodeDiff = diffArrays(oldCursorNodeCharArray, newCursorNodeCharArray);
|
|
21253
21193
|
let cursorOffset = newCursorNodeStart;
|
|
21254
21194
|
for (const entry of cursorNodeDiff) {
|
|
21255
21195
|
if (entry.removed) {
|
|
@@ -21283,7 +21223,7 @@ async function formatRange(originalText, opts) {
|
|
|
21283
21223
|
} = calculateRange(text, opts, ast);
|
|
21284
21224
|
const rangeString = text.slice(rangeStart, rangeEnd);
|
|
21285
21225
|
const rangeStart2 = Math.min(rangeStart, text.lastIndexOf("\n", rangeStart) + 1);
|
|
21286
|
-
const indentString = text.slice(rangeStart2, rangeStart).match(/^\s*/)[0];
|
|
21226
|
+
const indentString = text.slice(rangeStart2, rangeStart).match(/^\s*/u)[0];
|
|
21287
21227
|
const alignmentSize = get_alignment_size_default(indentString, opts.tabWidth);
|
|
21288
21228
|
const rangeResult = await coreFormat(rangeString, {
|
|
21289
21229
|
...opts,
|
|
@@ -21310,7 +21250,7 @@ async function formatRange(originalText, opts) {
|
|
|
21310
21250
|
cursorOffset += countEndOfLineChars(formatted.slice(0, cursorOffset), "\n");
|
|
21311
21251
|
}
|
|
21312
21252
|
formatted = string_replace_all_default(
|
|
21313
|
-
/* isOptionalObject*/
|
|
21253
|
+
/* isOptionalObject */
|
|
21314
21254
|
false,
|
|
21315
21255
|
formatted,
|
|
21316
21256
|
"\n",
|
|
@@ -22555,7 +22495,7 @@ var object_omit_default = omit;
|
|
|
22555
22495
|
import * as doc from "./doc.mjs";
|
|
22556
22496
|
|
|
22557
22497
|
// src/main/version.evaluate.cjs
|
|
22558
|
-
var version_evaluate_default = "3.3.
|
|
22498
|
+
var version_evaluate_default = "3.3.3";
|
|
22559
22499
|
|
|
22560
22500
|
// src/utils/public.js
|
|
22561
22501
|
var public_exports = {};
|
|
@@ -22653,7 +22593,7 @@ function getIndentSize(value, tabWidth) {
|
|
|
22653
22593
|
}
|
|
22654
22594
|
return get_alignment_size_default(
|
|
22655
22595
|
// All the leading whitespaces
|
|
22656
|
-
value.slice(lastNewlineIndex + 1).match(/^[\t ]*/)[0],
|
|
22596
|
+
value.slice(lastNewlineIndex + 1).match(/^[\t ]*/u)[0],
|
|
22657
22597
|
tabWidth
|
|
22658
22598
|
);
|
|
22659
22599
|
}
|
|
@@ -22670,7 +22610,7 @@ function escapeStringRegexp(string) {
|
|
|
22670
22610
|
// src/utils/get-max-continuous-count.js
|
|
22671
22611
|
function getMaxContinuousCount(text, searchString) {
|
|
22672
22612
|
const results = text.match(
|
|
22673
|
-
new RegExp(`(${escapeStringRegexp(searchString)})+`, "
|
|
22613
|
+
new RegExp(`(${escapeStringRegexp(searchString)})+`, "gu")
|
|
22674
22614
|
);
|
|
22675
22615
|
if (results === null) {
|
|
22676
22616
|
return 0;
|
|
@@ -22714,9 +22654,9 @@ var has_spaces_default = hasSpaces;
|
|
|
22714
22654
|
// src/utils/make-string.js
|
|
22715
22655
|
function makeString(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
|
|
22716
22656
|
const otherQuote = enclosingQuote === '"' ? "'" : '"';
|
|
22717
|
-
const regex = /\\(.)|(["'])/
|
|
22657
|
+
const regex = /\\(.)|(["'])/gsu;
|
|
22718
22658
|
const raw = string_replace_all_default(
|
|
22719
|
-
/* isOptionalObject*/
|
|
22659
|
+
/* isOptionalObject */
|
|
22720
22660
|
false,
|
|
22721
22661
|
rawText,
|
|
22722
22662
|
regex,
|
|
@@ -22730,7 +22670,7 @@ function makeString(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
|
|
|
22730
22670
|
if (quote) {
|
|
22731
22671
|
return quote;
|
|
22732
22672
|
}
|
|
22733
|
-
return unescapeUnnecessaryEscapes && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]
|
|
22673
|
+
return unescapeUnnecessaryEscapes && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(escaped) ? escaped : "\\" + escaped;
|
|
22734
22674
|
}
|
|
22735
22675
|
);
|
|
22736
22676
|
return enclosingQuote + raw + enclosingQuote;
|
|
@@ -22818,7 +22758,7 @@ var sharedWithCli = {
|
|
|
22818
22758
|
apiDescriptor
|
|
22819
22759
|
},
|
|
22820
22760
|
fastGlob: import_fast_glob.default,
|
|
22821
|
-
createTwoFilesPatch
|
|
22761
|
+
createTwoFilesPatch,
|
|
22822
22762
|
utils: {
|
|
22823
22763
|
isNonEmptyArray: is_non_empty_array_default,
|
|
22824
22764
|
partition: partition_default,
|