@base-attribution-os/github-action 0.2.2 → 0.2.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/README.md +5 -1
- package/action.yml +1 -1
- package/dist/index.cjs +684 -681
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -230,10 +230,10 @@ var require_tunnel = __commonJS({
|
|
|
230
230
|
var overrides = arguments[i];
|
|
231
231
|
if (typeof overrides === "object") {
|
|
232
232
|
var keys = Object.keys(overrides);
|
|
233
|
-
for (var
|
|
234
|
-
var
|
|
235
|
-
if (overrides[
|
|
236
|
-
target[
|
|
233
|
+
for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
|
|
234
|
+
var k = keys[j];
|
|
235
|
+
if (overrides[k] !== void 0) {
|
|
236
|
+
target[k] = overrides[k];
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
}
|
|
@@ -1157,8 +1157,8 @@ var require_util = __commonJS({
|
|
|
1157
1157
|
}
|
|
1158
1158
|
var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/;
|
|
1159
1159
|
function parseKeepAliveTimeout(val) {
|
|
1160
|
-
const
|
|
1161
|
-
return
|
|
1160
|
+
const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR);
|
|
1161
|
+
return m ? parseInt(m[1], 10) * 1e3 : null;
|
|
1162
1162
|
}
|
|
1163
1163
|
function headerNameToString(value) {
|
|
1164
1164
|
return typeof value === "string" ? headerNameLowerCasedRecord[value] ?? value.toLowerCase() : tree.lookup(value) ?? value.toString("latin1").toLowerCase();
|
|
@@ -1360,11 +1360,11 @@ var require_util = __commonJS({
|
|
|
1360
1360
|
}
|
|
1361
1361
|
function parseRangeHeader(range) {
|
|
1362
1362
|
if (range == null || range === "") return { start: 0, end: null, size: null };
|
|
1363
|
-
const
|
|
1364
|
-
return
|
|
1365
|
-
start: parseInt(
|
|
1366
|
-
end:
|
|
1367
|
-
size:
|
|
1363
|
+
const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null;
|
|
1364
|
+
return m ? {
|
|
1365
|
+
start: parseInt(m[1]),
|
|
1366
|
+
end: m[2] ? parseInt(m[2]) : null,
|
|
1367
|
+
size: m[3] ? parseInt(m[3]) : null
|
|
1368
1368
|
} : null;
|
|
1369
1369
|
}
|
|
1370
1370
|
function addListener(obj, name, listener) {
|
|
@@ -3326,19 +3326,19 @@ var require_data_url = __commonJS({
|
|
|
3326
3326
|
function percentDecode(input) {
|
|
3327
3327
|
const length = input.length;
|
|
3328
3328
|
const output = new Uint8Array(length);
|
|
3329
|
-
let
|
|
3329
|
+
let j = 0;
|
|
3330
3330
|
for (let i = 0; i < length; ++i) {
|
|
3331
3331
|
const byte = input[i];
|
|
3332
3332
|
if (byte !== 37) {
|
|
3333
|
-
output[
|
|
3333
|
+
output[j++] = byte;
|
|
3334
3334
|
} else if (byte === 37 && !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2]))) {
|
|
3335
|
-
output[
|
|
3335
|
+
output[j++] = 37;
|
|
3336
3336
|
} else {
|
|
3337
|
-
output[
|
|
3337
|
+
output[j++] = hexByteToNumber(input[i + 1]) << 4 | hexByteToNumber(input[i + 2]);
|
|
3338
3338
|
i += 2;
|
|
3339
3339
|
}
|
|
3340
3340
|
}
|
|
3341
|
-
return length ===
|
|
3341
|
+
return length === j ? output : output.subarray(0, j);
|
|
3342
3342
|
}
|
|
3343
3343
|
function parseMIMEType(input) {
|
|
3344
3344
|
input = removeHTTPWhitespace(input, true, true);
|
|
@@ -3929,12 +3929,12 @@ var require_webidl = __commonJS({
|
|
|
3929
3929
|
}
|
|
3930
3930
|
return V2;
|
|
3931
3931
|
};
|
|
3932
|
-
webidl.converters.TypedArray = function(V2,
|
|
3933
|
-
if (webidl.util.Type(V2) !== "Object" || !types.isTypedArray(V2) || V2.constructor.name !==
|
|
3932
|
+
webidl.converters.TypedArray = function(V2, T2, prefix, name, opts) {
|
|
3933
|
+
if (webidl.util.Type(V2) !== "Object" || !types.isTypedArray(V2) || V2.constructor.name !== T2.name) {
|
|
3934
3934
|
throw webidl.errors.conversionFailed({
|
|
3935
3935
|
prefix,
|
|
3936
3936
|
argument: `${name} ("${webidl.util.Stringify(V2)}")`,
|
|
3937
|
-
types: [
|
|
3937
|
+
types: [T2.name]
|
|
3938
3938
|
});
|
|
3939
3939
|
}
|
|
3940
3940
|
if (opts?.allowShared === false && types.isSharedArrayBuffer(V2.buffer)) {
|
|
@@ -5047,15 +5047,15 @@ var require_formdata = __commonJS({
|
|
|
5047
5047
|
}
|
|
5048
5048
|
}
|
|
5049
5049
|
[nodeUtil.inspect.custom](depth, options) {
|
|
5050
|
-
const state = this[kState].reduce((a2,
|
|
5051
|
-
if (a2[
|
|
5052
|
-
if (Array.isArray(a2[
|
|
5053
|
-
a2[
|
|
5050
|
+
const state = this[kState].reduce((a2, b2) => {
|
|
5051
|
+
if (a2[b2.name]) {
|
|
5052
|
+
if (Array.isArray(a2[b2.name])) {
|
|
5053
|
+
a2[b2.name].push(b2.value);
|
|
5054
5054
|
} else {
|
|
5055
|
-
a2[
|
|
5055
|
+
a2[b2.name] = [a2[b2.name], b2.value];
|
|
5056
5056
|
}
|
|
5057
5057
|
} else {
|
|
5058
|
-
a2[
|
|
5058
|
+
a2[b2.name] = b2.value;
|
|
5059
5059
|
}
|
|
5060
5060
|
return a2;
|
|
5061
5061
|
}, { __proto__: null });
|
|
@@ -8373,11 +8373,11 @@ var require_balanced_pool = __commonJS({
|
|
|
8373
8373
|
var kWeight = /* @__PURE__ */ Symbol("kWeight");
|
|
8374
8374
|
var kMaxWeightPerServer = /* @__PURE__ */ Symbol("kMaxWeightPerServer");
|
|
8375
8375
|
var kErrorPenalty = /* @__PURE__ */ Symbol("kErrorPenalty");
|
|
8376
|
-
function getGreatestCommonDivisor(a2,
|
|
8377
|
-
if (a2 === 0) return
|
|
8378
|
-
while (
|
|
8379
|
-
const t =
|
|
8380
|
-
|
|
8376
|
+
function getGreatestCommonDivisor(a2, b2) {
|
|
8377
|
+
if (a2 === 0) return b2;
|
|
8378
|
+
while (b2 !== 0) {
|
|
8379
|
+
const t = b2;
|
|
8380
|
+
b2 = a2 % b2;
|
|
8381
8381
|
a2 = t;
|
|
8382
8382
|
}
|
|
8383
8383
|
return a2;
|
|
@@ -8459,7 +8459,7 @@ var require_balanced_pool = __commonJS({
|
|
|
8459
8459
|
if (!dispatcher) {
|
|
8460
8460
|
return;
|
|
8461
8461
|
}
|
|
8462
|
-
const allClientsBusy = this[kClients].map((pool) => pool[kNeedDrain]).reduce((a2,
|
|
8462
|
+
const allClientsBusy = this[kClients].map((pool) => pool[kNeedDrain]).reduce((a2, b2) => a2 && b2, true);
|
|
8463
8463
|
if (allClientsBusy) {
|
|
8464
8464
|
return;
|
|
8465
8465
|
}
|
|
@@ -10714,8 +10714,8 @@ var require_mock_utils = __commonJS({
|
|
|
10714
10714
|
const value = data[key];
|
|
10715
10715
|
const name = Buffer.from(`${key}`);
|
|
10716
10716
|
if (Array.isArray(value)) {
|
|
10717
|
-
for (let
|
|
10718
|
-
result.push(name, Buffer.from(`${value[
|
|
10717
|
+
for (let j = 0; j < value.length; ++j) {
|
|
10718
|
+
result.push(name, Buffer.from(`${value[j]}`));
|
|
10719
10719
|
}
|
|
10720
10720
|
} else {
|
|
10721
10721
|
result.push(name, Buffer.from(`${value}`));
|
|
@@ -11838,10 +11838,10 @@ var require_headers = __commonJS({
|
|
|
11838
11838
|
}
|
|
11839
11839
|
function headerValueNormalize(potentialValue) {
|
|
11840
11840
|
let i = 0;
|
|
11841
|
-
let
|
|
11842
|
-
while (
|
|
11843
|
-
while (
|
|
11844
|
-
return i === 0 &&
|
|
11841
|
+
let j = potentialValue.length;
|
|
11842
|
+
while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j;
|
|
11843
|
+
while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i;
|
|
11844
|
+
return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j);
|
|
11845
11845
|
}
|
|
11846
11846
|
function fill(headers, object) {
|
|
11847
11847
|
if (Array.isArray(object)) {
|
|
@@ -11888,8 +11888,8 @@ var require_headers = __commonJS({
|
|
|
11888
11888
|
}
|
|
11889
11889
|
return getHeadersList(headers).append(name, value, false);
|
|
11890
11890
|
}
|
|
11891
|
-
function compareHeaderName(a2,
|
|
11892
|
-
return a2[0] <
|
|
11891
|
+
function compareHeaderName(a2, b2) {
|
|
11892
|
+
return a2[0] < b2[0] ? -1 : 1;
|
|
11893
11893
|
}
|
|
11894
11894
|
var HeadersList = class _HeadersList {
|
|
11895
11895
|
/** @type {[string, string][]|null} */
|
|
@@ -12020,7 +12020,7 @@ var require_headers = __commonJS({
|
|
|
12020
12020
|
const firstValue = iterator.next().value;
|
|
12021
12021
|
array[0] = [firstValue[0], firstValue[1].value];
|
|
12022
12022
|
assert(firstValue[1].value !== null);
|
|
12023
|
-
for (let i = 1,
|
|
12023
|
+
for (let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value; i < size; ++i) {
|
|
12024
12024
|
value = iterator.next().value;
|
|
12025
12025
|
x = array[i] = [value[0], value[1].value];
|
|
12026
12026
|
assert(x[1] !== null);
|
|
@@ -12035,9 +12035,9 @@ var require_headers = __commonJS({
|
|
|
12035
12035
|
}
|
|
12036
12036
|
}
|
|
12037
12037
|
if (i !== pivot) {
|
|
12038
|
-
|
|
12039
|
-
while (
|
|
12040
|
-
array[
|
|
12038
|
+
j = i;
|
|
12039
|
+
while (j > left) {
|
|
12040
|
+
array[j] = array[--j];
|
|
12041
12041
|
}
|
|
12042
12042
|
array[left] = x;
|
|
12043
12043
|
}
|
|
@@ -12180,8 +12180,8 @@ var require_headers = __commonJS({
|
|
|
12180
12180
|
for (let i = 0; i < names.length; ++i) {
|
|
12181
12181
|
const { 0: name, 1: value } = names[i];
|
|
12182
12182
|
if (name === "set-cookie") {
|
|
12183
|
-
for (let
|
|
12184
|
-
headers.push([name, cookies[
|
|
12183
|
+
for (let j = 0; j < cookies.length; ++j) {
|
|
12184
|
+
headers.push([name, cookies[j]]);
|
|
12185
12185
|
}
|
|
12186
12186
|
} else {
|
|
12187
12187
|
headers.push([name, value]);
|
|
@@ -14989,24 +14989,24 @@ var require_util4 = __commonJS({
|
|
|
14989
14989
|
return new TextDecoder(encoding).decode(sliced);
|
|
14990
14990
|
}
|
|
14991
14991
|
function BOMSniffing(ioQueue) {
|
|
14992
|
-
const [a2,
|
|
14993
|
-
if (a2 === 239 &&
|
|
14992
|
+
const [a2, b2, c] = ioQueue;
|
|
14993
|
+
if (a2 === 239 && b2 === 187 && c === 191) {
|
|
14994
14994
|
return "UTF-8";
|
|
14995
|
-
} else if (a2 === 254 &&
|
|
14995
|
+
} else if (a2 === 254 && b2 === 255) {
|
|
14996
14996
|
return "UTF-16BE";
|
|
14997
|
-
} else if (a2 === 255 &&
|
|
14997
|
+
} else if (a2 === 255 && b2 === 254) {
|
|
14998
14998
|
return "UTF-16LE";
|
|
14999
14999
|
}
|
|
15000
15000
|
return null;
|
|
15001
15001
|
}
|
|
15002
15002
|
function combineByteSequences(sequences) {
|
|
15003
|
-
const size = sequences.reduce((a2,
|
|
15004
|
-
return a2 +
|
|
15003
|
+
const size = sequences.reduce((a2, b2) => {
|
|
15004
|
+
return a2 + b2.byteLength;
|
|
15005
15005
|
}, 0);
|
|
15006
15006
|
let offset = 0;
|
|
15007
|
-
return sequences.reduce((a2,
|
|
15008
|
-
a2.set(
|
|
15009
|
-
offset +=
|
|
15007
|
+
return sequences.reduce((a2, b2) => {
|
|
15008
|
+
a2.set(b2, offset);
|
|
15009
|
+
offset += b2.byteLength;
|
|
15010
15010
|
return a2;
|
|
15011
15011
|
}, new Uint8Array(size));
|
|
15012
15012
|
}
|
|
@@ -21857,7 +21857,7 @@ var require_typescript = __commonJS({
|
|
|
21857
21857
|
}
|
|
21858
21858
|
}
|
|
21859
21859
|
function stableSortIndices(array, indices, comparer) {
|
|
21860
|
-
indices.sort((x,
|
|
21860
|
+
indices.sort((x, y2) => comparer(array[x], array[y2]) || compareValues(x, y2));
|
|
21861
21861
|
}
|
|
21862
21862
|
function toSorted(array, comparer) {
|
|
21863
21863
|
return array.length === 0 ? emptyArray : array.slice().sort(comparer);
|
|
@@ -22361,23 +22361,23 @@ var require_typescript = __commonJS({
|
|
|
22361
22361
|
AssertionLevel2[AssertionLevel2["VeryAggressive"] = 3] = "VeryAggressive";
|
|
22362
22362
|
return AssertionLevel2;
|
|
22363
22363
|
})(AssertionLevel || {});
|
|
22364
|
-
function equateValues(a2,
|
|
22365
|
-
return a2 ===
|
|
22364
|
+
function equateValues(a2, b2) {
|
|
22365
|
+
return a2 === b2;
|
|
22366
22366
|
}
|
|
22367
|
-
function equateStringsCaseInsensitive(a2,
|
|
22368
|
-
return a2 ===
|
|
22367
|
+
function equateStringsCaseInsensitive(a2, b2) {
|
|
22368
|
+
return a2 === b2 || a2 !== void 0 && b2 !== void 0 && a2.toUpperCase() === b2.toUpperCase();
|
|
22369
22369
|
}
|
|
22370
|
-
function equateStringsCaseSensitive(a2,
|
|
22371
|
-
return equateValues(a2,
|
|
22370
|
+
function equateStringsCaseSensitive(a2, b2) {
|
|
22371
|
+
return equateValues(a2, b2);
|
|
22372
22372
|
}
|
|
22373
|
-
function compareComparableValues(a2,
|
|
22374
|
-
return a2 ===
|
|
22373
|
+
function compareComparableValues(a2, b2) {
|
|
22374
|
+
return a2 === b2 ? 0 : a2 === void 0 ? -1 : b2 === void 0 ? 1 : a2 < b2 ? -1 : 1;
|
|
22375
22375
|
}
|
|
22376
|
-
function compareValues(a2,
|
|
22377
|
-
return compareComparableValues(a2,
|
|
22376
|
+
function compareValues(a2, b2) {
|
|
22377
|
+
return compareComparableValues(a2, b2);
|
|
22378
22378
|
}
|
|
22379
|
-
function compareTextSpans(a2,
|
|
22380
|
-
return compareValues(a2 == null ? void 0 : a2.start,
|
|
22379
|
+
function compareTextSpans(a2, b2) {
|
|
22380
|
+
return compareValues(a2 == null ? void 0 : a2.start, b2 == null ? void 0 : b2.start) || compareValues(a2 == null ? void 0 : a2.length, b2 == null ? void 0 : b2.length);
|
|
22381
22381
|
}
|
|
22382
22382
|
function maxBy(arr, init, mapper) {
|
|
22383
22383
|
for (let i = 0; i < arr.length; i++) {
|
|
@@ -22386,42 +22386,42 @@ var require_typescript = __commonJS({
|
|
|
22386
22386
|
return init;
|
|
22387
22387
|
}
|
|
22388
22388
|
function min(items, compare) {
|
|
22389
|
-
return reduceLeft(items, (x,
|
|
22389
|
+
return reduceLeft(items, (x, y2) => compare(x, y2) === -1 ? x : y2);
|
|
22390
22390
|
}
|
|
22391
|
-
function compareStringsCaseInsensitive(a2,
|
|
22392
|
-
if (a2 ===
|
|
22391
|
+
function compareStringsCaseInsensitive(a2, b2) {
|
|
22392
|
+
if (a2 === b2) return 0;
|
|
22393
22393
|
if (a2 === void 0) return -1;
|
|
22394
|
-
if (
|
|
22394
|
+
if (b2 === void 0) return 1;
|
|
22395
22395
|
a2 = a2.toUpperCase();
|
|
22396
|
-
|
|
22397
|
-
return a2 <
|
|
22396
|
+
b2 = b2.toUpperCase();
|
|
22397
|
+
return a2 < b2 ? -1 : a2 > b2 ? 1 : 0;
|
|
22398
22398
|
}
|
|
22399
|
-
function compareStringsCaseInsensitiveEslintCompatible(a2,
|
|
22400
|
-
if (a2 ===
|
|
22399
|
+
function compareStringsCaseInsensitiveEslintCompatible(a2, b2) {
|
|
22400
|
+
if (a2 === b2) return 0;
|
|
22401
22401
|
if (a2 === void 0) return -1;
|
|
22402
|
-
if (
|
|
22402
|
+
if (b2 === void 0) return 1;
|
|
22403
22403
|
a2 = a2.toLowerCase();
|
|
22404
|
-
|
|
22405
|
-
return a2 <
|
|
22404
|
+
b2 = b2.toLowerCase();
|
|
22405
|
+
return a2 < b2 ? -1 : a2 > b2 ? 1 : 0;
|
|
22406
22406
|
}
|
|
22407
|
-
function compareStringsCaseSensitive(a2,
|
|
22408
|
-
return compareComparableValues(a2,
|
|
22407
|
+
function compareStringsCaseSensitive(a2, b2) {
|
|
22408
|
+
return compareComparableValues(a2, b2);
|
|
22409
22409
|
}
|
|
22410
22410
|
function getStringComparer(ignoreCase) {
|
|
22411
22411
|
return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive;
|
|
22412
22412
|
}
|
|
22413
22413
|
var createUIStringComparer = /* @__PURE__ */ (() => {
|
|
22414
22414
|
return createIntlCollatorStringComparer;
|
|
22415
|
-
function compareWithCallback(a2,
|
|
22416
|
-
if (a2 ===
|
|
22415
|
+
function compareWithCallback(a2, b2, comparer) {
|
|
22416
|
+
if (a2 === b2) return 0;
|
|
22417
22417
|
if (a2 === void 0) return -1;
|
|
22418
|
-
if (
|
|
22419
|
-
const value = comparer(a2,
|
|
22418
|
+
if (b2 === void 0) return 1;
|
|
22419
|
+
const value = comparer(a2, b2);
|
|
22420
22420
|
return value < 0 ? -1 : value > 0 ? 1 : 0;
|
|
22421
22421
|
}
|
|
22422
22422
|
function createIntlCollatorStringComparer(locale) {
|
|
22423
22423
|
const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant", numeric: true }).compare;
|
|
22424
|
-
return (a2,
|
|
22424
|
+
return (a2, b2) => compareWithCallback(a2, b2, comparer);
|
|
22425
22425
|
}
|
|
22426
22426
|
})();
|
|
22427
22427
|
var uiComparerCaseSensitive;
|
|
@@ -22435,15 +22435,15 @@ var require_typescript = __commonJS({
|
|
|
22435
22435
|
uiComparerCaseSensitive = void 0;
|
|
22436
22436
|
}
|
|
22437
22437
|
}
|
|
22438
|
-
function compareStringsCaseSensitiveUI(a2,
|
|
22438
|
+
function compareStringsCaseSensitiveUI(a2, b2) {
|
|
22439
22439
|
uiComparerCaseSensitive ?? (uiComparerCaseSensitive = createUIStringComparer(uiLocale));
|
|
22440
|
-
return uiComparerCaseSensitive(a2,
|
|
22440
|
+
return uiComparerCaseSensitive(a2, b2);
|
|
22441
22441
|
}
|
|
22442
|
-
function compareProperties(a2,
|
|
22443
|
-
return a2 ===
|
|
22442
|
+
function compareProperties(a2, b2, key, comparer) {
|
|
22443
|
+
return a2 === b2 ? 0 : a2 === void 0 ? -1 : b2 === void 0 ? 1 : comparer(a2[key], b2[key]);
|
|
22444
22444
|
}
|
|
22445
|
-
function compareBooleans(a2,
|
|
22446
|
-
return compareValues(a2 ? 1 : 0,
|
|
22445
|
+
function compareBooleans(a2, b2) {
|
|
22446
|
+
return compareValues(a2 ? 1 : 0, b2 ? 1 : 0);
|
|
22447
22447
|
}
|
|
22448
22448
|
function getSpellingSuggestion(name, candidates, getName) {
|
|
22449
22449
|
const maximumLengthDifference = Math.max(2, Math.floor(name.length * 0.34));
|
|
@@ -22482,24 +22482,24 @@ var require_typescript = __commonJS({
|
|
|
22482
22482
|
const maxJ = Math.floor(s2.length > max + i ? max + i : s2.length);
|
|
22483
22483
|
current[0] = i;
|
|
22484
22484
|
let colMin = i;
|
|
22485
|
-
for (let
|
|
22486
|
-
current[
|
|
22485
|
+
for (let j = 1; j < minJ; j++) {
|
|
22486
|
+
current[j] = big;
|
|
22487
22487
|
}
|
|
22488
|
-
for (let
|
|
22489
|
-
const substitutionDistance = s1[i - 1].toLowerCase() === s2[
|
|
22490
|
-
const dist = c1 === s2.charCodeAt(
|
|
22488
|
+
for (let j = minJ; j <= maxJ; j++) {
|
|
22489
|
+
const substitutionDistance = s1[i - 1].toLowerCase() === s2[j - 1].toLowerCase() ? previous[j - 1] + 0.1 : previous[j - 1] + 2;
|
|
22490
|
+
const dist = c1 === s2.charCodeAt(j - 1) ? previous[j - 1] : Math.min(
|
|
22491
22491
|
/*delete*/
|
|
22492
|
-
previous[
|
|
22492
|
+
previous[j] + 1,
|
|
22493
22493
|
/*insert*/
|
|
22494
|
-
current[
|
|
22494
|
+
current[j - 1] + 1,
|
|
22495
22495
|
/*substitute*/
|
|
22496
22496
|
substitutionDistance
|
|
22497
22497
|
);
|
|
22498
|
-
current[
|
|
22498
|
+
current[j] = dist;
|
|
22499
22499
|
colMin = Math.min(colMin, dist);
|
|
22500
22500
|
}
|
|
22501
|
-
for (let
|
|
22502
|
-
current[
|
|
22501
|
+
for (let j = maxJ + 1; j <= s2.length; j++) {
|
|
22502
|
+
current[j] = big;
|
|
22503
22503
|
}
|
|
22504
22504
|
if (colMin > max) {
|
|
22505
22505
|
return void 0;
|
|
@@ -22619,8 +22619,8 @@ var require_typescript = __commonJS({
|
|
|
22619
22619
|
function isPatternMatch({ prefix, suffix }, candidate) {
|
|
22620
22620
|
return candidate.length >= prefix.length + suffix.length && startsWith(candidate, prefix) && endsWith(candidate, suffix);
|
|
22621
22621
|
}
|
|
22622
|
-
function and(f,
|
|
22623
|
-
return (arg) => f(arg) &&
|
|
22622
|
+
function and(f, g2) {
|
|
22623
|
+
return (arg) => f(arg) && g2(arg);
|
|
22624
22624
|
}
|
|
22625
22625
|
function or(...fs4) {
|
|
22626
22626
|
return (...args) => {
|
|
@@ -22829,28 +22829,28 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
22829
22829
|
}
|
|
22830
22830
|
}
|
|
22831
22831
|
Debug2.assert = assert;
|
|
22832
|
-
function assertEqual(a2,
|
|
22833
|
-
if (a2 !==
|
|
22832
|
+
function assertEqual(a2, b2, msg, msg2, stackCrawlMark) {
|
|
22833
|
+
if (a2 !== b2) {
|
|
22834
22834
|
const message = msg ? msg2 ? `${msg} ${msg2}` : msg : "";
|
|
22835
|
-
fail(`Expected ${a2} === ${
|
|
22835
|
+
fail(`Expected ${a2} === ${b2}. ${message}`, stackCrawlMark || assertEqual);
|
|
22836
22836
|
}
|
|
22837
22837
|
}
|
|
22838
22838
|
Debug2.assertEqual = assertEqual;
|
|
22839
|
-
function assertLessThan(a2,
|
|
22840
|
-
if (a2 >=
|
|
22841
|
-
fail(`Expected ${a2} < ${
|
|
22839
|
+
function assertLessThan(a2, b2, msg, stackCrawlMark) {
|
|
22840
|
+
if (a2 >= b2) {
|
|
22841
|
+
fail(`Expected ${a2} < ${b2}. ${msg || ""}`, stackCrawlMark || assertLessThan);
|
|
22842
22842
|
}
|
|
22843
22843
|
}
|
|
22844
22844
|
Debug2.assertLessThan = assertLessThan;
|
|
22845
|
-
function assertLessThanOrEqual(a2,
|
|
22846
|
-
if (a2 >
|
|
22847
|
-
fail(`Expected ${a2} <= ${
|
|
22845
|
+
function assertLessThanOrEqual(a2, b2, stackCrawlMark) {
|
|
22846
|
+
if (a2 > b2) {
|
|
22847
|
+
fail(`Expected ${a2} <= ${b2}`, stackCrawlMark || assertLessThanOrEqual);
|
|
22848
22848
|
}
|
|
22849
22849
|
}
|
|
22850
22850
|
Debug2.assertLessThanOrEqual = assertLessThanOrEqual;
|
|
22851
|
-
function assertGreaterThanOrEqual(a2,
|
|
22852
|
-
if (a2 <
|
|
22853
|
-
fail(`Expected ${a2} >= ${
|
|
22851
|
+
function assertGreaterThanOrEqual(a2, b2, stackCrawlMark) {
|
|
22852
|
+
if (a2 < b2) {
|
|
22853
|
+
fail(`Expected ${a2} >= ${b2}`, stackCrawlMark || assertGreaterThanOrEqual);
|
|
22854
22854
|
}
|
|
22855
22855
|
}
|
|
22856
22856
|
Debug2.assertGreaterThanOrEqual = assertGreaterThanOrEqual;
|
|
@@ -23009,7 +23009,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
23009
23009
|
result.push([value, name]);
|
|
23010
23010
|
}
|
|
23011
23011
|
}
|
|
23012
|
-
const sorted = toSorted(result, (x,
|
|
23012
|
+
const sorted = toSorted(result, (x, y2) => compareValues(x[0], y2[0]));
|
|
23013
23013
|
enumMemberCache.set(enumObject, sorted);
|
|
23014
23014
|
return sorted;
|
|
23015
23015
|
}
|
|
@@ -28275,23 +28275,23 @@ ${lanes.join("\n")}
|
|
|
28275
28275
|
return changeAnyExtension(path3, newExtension);
|
|
28276
28276
|
}
|
|
28277
28277
|
var relativePathSegmentRegExp = /\/\/|(?:^|\/)\.\.?(?:$|\/)/;
|
|
28278
|
-
function comparePathsWorker(a2,
|
|
28279
|
-
if (a2 ===
|
|
28278
|
+
function comparePathsWorker(a2, b2, componentComparer) {
|
|
28279
|
+
if (a2 === b2) return 0;
|
|
28280
28280
|
if (a2 === void 0) return -1;
|
|
28281
|
-
if (
|
|
28281
|
+
if (b2 === void 0) return 1;
|
|
28282
28282
|
const aRoot = a2.substring(0, getRootLength(a2));
|
|
28283
|
-
const bRoot =
|
|
28283
|
+
const bRoot = b2.substring(0, getRootLength(b2));
|
|
28284
28284
|
const result = compareStringsCaseInsensitive(aRoot, bRoot);
|
|
28285
28285
|
if (result !== 0) {
|
|
28286
28286
|
return result;
|
|
28287
28287
|
}
|
|
28288
28288
|
const aRest = a2.substring(aRoot.length);
|
|
28289
|
-
const bRest =
|
|
28289
|
+
const bRest = b2.substring(bRoot.length);
|
|
28290
28290
|
if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) {
|
|
28291
28291
|
return componentComparer(aRest, bRest);
|
|
28292
28292
|
}
|
|
28293
28293
|
const aComponents = reducePathComponents(getPathComponents(a2));
|
|
28294
|
-
const bComponents = reducePathComponents(getPathComponents(
|
|
28294
|
+
const bComponents = reducePathComponents(getPathComponents(b2));
|
|
28295
28295
|
const sharedLength = Math.min(aComponents.length, bComponents.length);
|
|
28296
28296
|
for (let i = 1; i < sharedLength; i++) {
|
|
28297
28297
|
const result2 = componentComparer(aComponents[i], bComponents[i]);
|
|
@@ -28301,20 +28301,20 @@ ${lanes.join("\n")}
|
|
|
28301
28301
|
}
|
|
28302
28302
|
return compareValues(aComponents.length, bComponents.length);
|
|
28303
28303
|
}
|
|
28304
|
-
function comparePathsCaseSensitive(a2,
|
|
28305
|
-
return comparePathsWorker(a2,
|
|
28304
|
+
function comparePathsCaseSensitive(a2, b2) {
|
|
28305
|
+
return comparePathsWorker(a2, b2, compareStringsCaseSensitive);
|
|
28306
28306
|
}
|
|
28307
|
-
function comparePathsCaseInsensitive(a2,
|
|
28308
|
-
return comparePathsWorker(a2,
|
|
28307
|
+
function comparePathsCaseInsensitive(a2, b2) {
|
|
28308
|
+
return comparePathsWorker(a2, b2, compareStringsCaseInsensitive);
|
|
28309
28309
|
}
|
|
28310
|
-
function comparePaths(a2,
|
|
28310
|
+
function comparePaths(a2, b2, currentDirectory, ignoreCase) {
|
|
28311
28311
|
if (typeof currentDirectory === "string") {
|
|
28312
28312
|
a2 = combinePaths(currentDirectory, a2);
|
|
28313
|
-
|
|
28313
|
+
b2 = combinePaths(currentDirectory, b2);
|
|
28314
28314
|
} else if (typeof currentDirectory === "boolean") {
|
|
28315
28315
|
ignoreCase = currentDirectory;
|
|
28316
28316
|
}
|
|
28317
|
-
return comparePathsWorker(a2,
|
|
28317
|
+
return comparePathsWorker(a2, b2, getStringComparer(ignoreCase));
|
|
28318
28318
|
}
|
|
28319
28319
|
function containsPath(parent2, child, currentDirectory, ignoreCase) {
|
|
28320
28320
|
if (typeof currentDirectory === "string") {
|
|
@@ -34108,21 +34108,21 @@ ${lanes.join("\n")}
|
|
|
34108
34108
|
return start <= end ? createTextSpanFromBounds(start, end) : void 0;
|
|
34109
34109
|
}
|
|
34110
34110
|
function normalizeSpans(spans) {
|
|
34111
|
-
spans = spans.filter((span) => span.length > 0).sort((a2,
|
|
34112
|
-
return a2.start !==
|
|
34111
|
+
spans = spans.filter((span) => span.length > 0).sort((a2, b2) => {
|
|
34112
|
+
return a2.start !== b2.start ? a2.start - b2.start : a2.length - b2.length;
|
|
34113
34113
|
});
|
|
34114
34114
|
const result = [];
|
|
34115
34115
|
let i = 0;
|
|
34116
34116
|
while (i < spans.length) {
|
|
34117
34117
|
let span = spans[i];
|
|
34118
|
-
let
|
|
34119
|
-
while (
|
|
34120
|
-
const start = Math.min(span.start, spans[
|
|
34121
|
-
const end = Math.max(textSpanEnd(span), textSpanEnd(spans[
|
|
34118
|
+
let j = i + 1;
|
|
34119
|
+
while (j < spans.length && textSpanIntersectsWithTextSpan(span, spans[j])) {
|
|
34120
|
+
const start = Math.min(span.start, spans[j].start);
|
|
34121
|
+
const end = Math.max(textSpanEnd(span), textSpanEnd(spans[j]));
|
|
34122
34122
|
span = createTextSpanFromBounds(start, end);
|
|
34123
|
-
|
|
34123
|
+
j++;
|
|
34124
34124
|
}
|
|
34125
|
-
i =
|
|
34125
|
+
i = j;
|
|
34126
34126
|
result.push(span);
|
|
34127
34127
|
}
|
|
34128
34128
|
return result;
|
|
@@ -34668,7 +34668,7 @@ ${lanes.join("\n")}
|
|
|
34668
34668
|
if (tags === void 0 || noCache) {
|
|
34669
34669
|
const comments = getJSDocCommentsAndTags(node, noCache);
|
|
34670
34670
|
Debug.assert(comments.length < 2 || comments[0] !== comments[1]);
|
|
34671
|
-
tags = flatMap(comments, (
|
|
34671
|
+
tags = flatMap(comments, (j) => isJSDoc(j) ? j.tags : j);
|
|
34672
34672
|
if (!noCache) {
|
|
34673
34673
|
node.jsDoc ?? (node.jsDoc = []);
|
|
34674
34674
|
node.jsDoc.jsDocCache = tags;
|
|
@@ -35816,8 +35816,8 @@ ${lanes.join("\n")}
|
|
|
35816
35816
|
result.repopulateInfo = () => true;
|
|
35817
35817
|
return result;
|
|
35818
35818
|
}
|
|
35819
|
-
function packageIdIsEqual(a2,
|
|
35820
|
-
return a2 ===
|
|
35819
|
+
function packageIdIsEqual(a2, b2) {
|
|
35820
|
+
return a2 === b2 || !!a2 && !!b2 && a2.name === b2.name && a2.subModuleName === b2.subModuleName && a2.version === b2.version && a2.peerDependencies === b2.peerDependencies;
|
|
35821
35821
|
}
|
|
35822
35822
|
function packageIdToPackageName({ name, subModuleName }) {
|
|
35823
35823
|
return subModuleName ? `${name}/${subModuleName}` : name;
|
|
@@ -37734,9 +37734,9 @@ ${lanes.join("\n")}
|
|
|
37734
37734
|
function childIsDecorated(useLegacyDecorators, node, parent2) {
|
|
37735
37735
|
switch (node.kind) {
|
|
37736
37736
|
case 264:
|
|
37737
|
-
return some(node.members, (
|
|
37737
|
+
return some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2));
|
|
37738
37738
|
case 232:
|
|
37739
|
-
return !useLegacyDecorators && some(node.members, (
|
|
37739
|
+
return !useLegacyDecorators && some(node.members, (m) => nodeOrChildIsDecorated(useLegacyDecorators, m, node, parent2));
|
|
37740
37740
|
case 175:
|
|
37741
37741
|
case 179:
|
|
37742
37742
|
case 177:
|
|
@@ -41805,9 +41805,9 @@ ${lanes.join("\n")}
|
|
|
41805
41805
|
}
|
|
41806
41806
|
}
|
|
41807
41807
|
}
|
|
41808
|
-
function guessDirectorySymlink(a2,
|
|
41808
|
+
function guessDirectorySymlink(a2, b2, cwd, getCanonicalFileName) {
|
|
41809
41809
|
const aParts = getPathComponents(getNormalizedAbsolutePath(a2, cwd));
|
|
41810
|
-
const bParts = getPathComponents(getNormalizedAbsolutePath(
|
|
41810
|
+
const bParts = getPathComponents(getNormalizedAbsolutePath(b2, cwd));
|
|
41811
41811
|
let isDirectory2 = false;
|
|
41812
41812
|
while (aParts.length >= 2 && bParts.length >= 2 && !isNodeModulesOrScopedPackageDirectory(aParts[aParts.length - 2], getCanonicalFileName) && !isNodeModulesOrScopedPackageDirectory(bParts[bParts.length - 2], getCanonicalFileName) && getCanonicalFileName(aParts[aParts.length - 1]) === getCanonicalFileName(bParts[bParts.length - 1])) {
|
|
41813
41813
|
aParts.pop();
|
|
@@ -42451,8 +42451,8 @@ ${lanes.join("\n")}
|
|
|
42451
42451
|
const isPlainJs = isPlainJsFile(sourceFile, options.checkJs);
|
|
42452
42452
|
return isPlainJs || isCheckJs || sourceFile.scriptKind === 7;
|
|
42453
42453
|
}
|
|
42454
|
-
function isJsonEqual(a2,
|
|
42455
|
-
return a2 ===
|
|
42454
|
+
function isJsonEqual(a2, b2) {
|
|
42455
|
+
return a2 === b2 || typeof a2 === "object" && a2 !== null && typeof b2 === "object" && b2 !== null && equalOwnProperties(a2, b2, isJsonEqual);
|
|
42456
42456
|
}
|
|
42457
42457
|
function parsePseudoBigInt(stringValue) {
|
|
42458
42458
|
let log2Base;
|
|
@@ -44020,11 +44020,11 @@ ${lanes.join("\n")}
|
|
|
44020
44020
|
}
|
|
44021
44021
|
return parenthesizerRule;
|
|
44022
44022
|
}
|
|
44023
|
-
function mixingBinaryOperatorsRequiresParentheses(a2,
|
|
44023
|
+
function mixingBinaryOperatorsRequiresParentheses(a2, b2) {
|
|
44024
44024
|
if (a2 === 61) {
|
|
44025
|
-
return
|
|
44025
|
+
return b2 === 56 || b2 === 57;
|
|
44026
44026
|
}
|
|
44027
|
-
if (
|
|
44027
|
+
if (b2 === 61) {
|
|
44028
44028
|
return a2 === 56 || a2 === 57;
|
|
44029
44029
|
}
|
|
44030
44030
|
return false;
|
|
@@ -50594,12 +50594,12 @@ ${lanes.join("\n")}
|
|
|
50594
50594
|
);
|
|
50595
50595
|
}
|
|
50596
50596
|
}
|
|
50597
|
-
function compareEmitHelpers(x,
|
|
50598
|
-
if (x ===
|
|
50599
|
-
if (x.priority ===
|
|
50597
|
+
function compareEmitHelpers(x, y2) {
|
|
50598
|
+
if (x === y2) return 0;
|
|
50599
|
+
if (x.priority === y2.priority) return 0;
|
|
50600
50600
|
if (x.priority === void 0) return 1;
|
|
50601
|
-
if (
|
|
50602
|
-
return compareValues(x.priority,
|
|
50601
|
+
if (y2.priority === void 0) return -1;
|
|
50602
|
+
return compareValues(x.priority, y2.priority);
|
|
50603
50603
|
}
|
|
50604
50604
|
function helperString(input, ...args) {
|
|
50605
50605
|
return (uniqueName) => {
|
|
@@ -52997,7 +52997,7 @@ ${lanes.join("\n")}
|
|
|
52997
52997
|
return isImportMeta2(node) ? node : forEachChild(node, walkTreeForImportMeta);
|
|
52998
52998
|
}
|
|
52999
52999
|
function hasModifierOfKind(node, kind) {
|
|
53000
|
-
return some(node.modifiers, (
|
|
53000
|
+
return some(node.modifiers, (m) => m.kind === kind);
|
|
53001
53001
|
}
|
|
53002
53002
|
function isImportMeta2(node) {
|
|
53003
53003
|
return isMetaProperty(node) && node.keywordToken === 102 && node.name.escapedText === "meta";
|
|
@@ -59551,8 +59551,8 @@ ${lanes.join("\n")}
|
|
|
59551
59551
|
if (node) {
|
|
59552
59552
|
return node;
|
|
59553
59553
|
}
|
|
59554
|
-
for (const
|
|
59555
|
-
|
|
59554
|
+
for (const m of modifiers) {
|
|
59555
|
+
m.flags |= 33554432;
|
|
59556
59556
|
}
|
|
59557
59557
|
return doInsideOfContext(33554432, () => parseDeclarationWorker(pos, hasJSDoc, modifiers));
|
|
59558
59558
|
} else {
|
|
@@ -60147,8 +60147,8 @@ ${lanes.join("\n")}
|
|
|
60147
60147
|
if (tokenIsIdentifierOrKeyword(token()) || token() === 11 || token() === 9 || token() === 10 || token() === 42 || token() === 23) {
|
|
60148
60148
|
const isAmbient = some(modifiers, isDeclareModifier);
|
|
60149
60149
|
if (isAmbient) {
|
|
60150
|
-
for (const
|
|
60151
|
-
|
|
60150
|
+
for (const m of modifiers) {
|
|
60151
|
+
m.flags |= 33554432;
|
|
60152
60152
|
}
|
|
60153
60153
|
return doInsideOfContext(33554432, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers));
|
|
60154
60154
|
} else {
|
|
@@ -61828,16 +61828,16 @@ ${lanes.join("\n")}
|
|
|
61828
61828
|
const end2 = comment !== void 0 ? getNodePos() : typeExpression.end;
|
|
61829
61829
|
return finishNode(factory2.createJSDocOverloadTag(tagName, typeExpression, comment), start2, end2);
|
|
61830
61830
|
}
|
|
61831
|
-
function escapedTextsEqual(a2,
|
|
61832
|
-
while (!isIdentifier(a2) || !isIdentifier(
|
|
61833
|
-
if (!isIdentifier(a2) && !isIdentifier(
|
|
61831
|
+
function escapedTextsEqual(a2, b2) {
|
|
61832
|
+
while (!isIdentifier(a2) || !isIdentifier(b2)) {
|
|
61833
|
+
if (!isIdentifier(a2) && !isIdentifier(b2) && a2.right.escapedText === b2.right.escapedText) {
|
|
61834
61834
|
a2 = a2.left;
|
|
61835
|
-
|
|
61835
|
+
b2 = b2.left;
|
|
61836
61836
|
} else {
|
|
61837
61837
|
return false;
|
|
61838
61838
|
}
|
|
61839
61839
|
}
|
|
61840
|
-
return a2.escapedText ===
|
|
61840
|
+
return a2.escapedText === b2.escapedText;
|
|
61841
61841
|
}
|
|
61842
61842
|
function parseChildPropertyTag(indent3) {
|
|
61843
61843
|
return parseChildParameterOrPropertyTag(1, indent3);
|
|
@@ -64279,7 +64279,7 @@ ${lanes.join("\n")}
|
|
|
64279
64279
|
}
|
|
64280
64280
|
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
|
|
64281
64281
|
const namesOfType = arrayFrom(opt.type.keys());
|
|
64282
|
-
const stringNames = (opt.deprecatedKeys ? namesOfType.filter((
|
|
64282
|
+
const stringNames = (opt.deprecatedKeys ? namesOfType.filter((k) => !opt.deprecatedKeys.has(k)) : namesOfType).map((key) => `'${key}'`).join(", ");
|
|
64283
64283
|
return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, stringNames);
|
|
64284
64284
|
}
|
|
64285
64285
|
function parseCustomTypeOption(opt, value, errors) {
|
|
@@ -65001,7 +65001,7 @@ ${lanes.join("\n")}
|
|
|
65001
65001
|
function generateTSConfig(options, newLine) {
|
|
65002
65002
|
const tab = " ";
|
|
65003
65003
|
const result = [];
|
|
65004
|
-
const allSetOptions = Object.keys(options).filter((
|
|
65004
|
+
const allSetOptions = Object.keys(options).filter((k) => k !== "init" && k !== "help" && k !== "watch");
|
|
65005
65005
|
result.push(`{`);
|
|
65006
65006
|
result.push(`${tab}// ${getLocaleSpecificMessage(Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)}`);
|
|
65007
65007
|
result.push(`${tab}"compilerOptions": {`);
|
|
@@ -67820,7 +67820,7 @@ ${lanes.join("\n")}
|
|
|
67820
67820
|
state
|
|
67821
67821
|
);
|
|
67822
67822
|
if (result) {
|
|
67823
|
-
entrypoints = appendIfUnique(entrypoints, result, (a2,
|
|
67823
|
+
entrypoints = appendIfUnique(entrypoints, result, (a2, b2) => a2.path === b2.path);
|
|
67824
67824
|
return true;
|
|
67825
67825
|
}
|
|
67826
67826
|
}
|
|
@@ -68023,10 +68023,10 @@ ${lanes.join("\n")}
|
|
|
68023
68023
|
return idx === -1 ? { packageName: moduleName, rest: "" } : { packageName: moduleName.slice(0, idx), rest: moduleName.slice(idx + 1) };
|
|
68024
68024
|
}
|
|
68025
68025
|
function allKeysStartWithDot(obj) {
|
|
68026
|
-
return every(getOwnKeys(obj), (
|
|
68026
|
+
return every(getOwnKeys(obj), (k) => startsWith(k, "."));
|
|
68027
68027
|
}
|
|
68028
68028
|
function noKeyStartsWithDot(obj) {
|
|
68029
|
-
return !some(getOwnKeys(obj), (
|
|
68029
|
+
return !some(getOwnKeys(obj), (k) => startsWith(k, "."));
|
|
68030
68030
|
}
|
|
68031
68031
|
function loadModuleFromSelfNameReference(extensions, moduleName, directory, state, cache, redirectedReference) {
|
|
68032
68032
|
var _a, _b;
|
|
@@ -68168,17 +68168,17 @@ ${lanes.join("\n")}
|
|
|
68168
68168
|
void 0
|
|
68169
68169
|
);
|
|
68170
68170
|
}
|
|
68171
|
-
function comparePatternKeys(a2,
|
|
68171
|
+
function comparePatternKeys(a2, b2) {
|
|
68172
68172
|
const aPatternIndex = a2.indexOf("*");
|
|
68173
|
-
const bPatternIndex =
|
|
68173
|
+
const bPatternIndex = b2.indexOf("*");
|
|
68174
68174
|
const baseLenA = aPatternIndex === -1 ? a2.length : aPatternIndex + 1;
|
|
68175
|
-
const baseLenB = bPatternIndex === -1 ?
|
|
68175
|
+
const baseLenB = bPatternIndex === -1 ? b2.length : bPatternIndex + 1;
|
|
68176
68176
|
if (baseLenA > baseLenB) return -1;
|
|
68177
68177
|
if (baseLenB > baseLenA) return 1;
|
|
68178
68178
|
if (aPatternIndex === -1) return 1;
|
|
68179
68179
|
if (bPatternIndex === -1) return -1;
|
|
68180
|
-
if (a2.length >
|
|
68181
|
-
if (
|
|
68180
|
+
if (a2.length > b2.length) return -1;
|
|
68181
|
+
if (b2.length > a2.length) return 1;
|
|
68182
68182
|
return 0;
|
|
68183
68183
|
}
|
|
68184
68184
|
function loadModuleFromExportsOrImports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
|
|
@@ -68194,7 +68194,7 @@ ${lanes.join("\n")}
|
|
|
68194
68194
|
moduleName
|
|
68195
68195
|
);
|
|
68196
68196
|
}
|
|
68197
|
-
const expandingKeys = toSorted(filter(getOwnKeys(lookupTable), (
|
|
68197
|
+
const expandingKeys = toSorted(filter(getOwnKeys(lookupTable), (k) => hasOneAsterisk(k) || endsWith(k, "/")), comparePatternKeys);
|
|
68198
68198
|
for (const potentialTarget of expandingKeys) {
|
|
68199
68199
|
if (state.features & 16 && matchesPatternWithTrailer(potentialTarget, moduleName)) {
|
|
68200
68200
|
const target = lookupTable[potentialTarget];
|
|
@@ -70954,14 +70954,14 @@ ${lanes.join("\n")}
|
|
|
70954
70954
|
function bindJSDoc(node) {
|
|
70955
70955
|
if (hasJSDocNodes(node)) {
|
|
70956
70956
|
if (isInJSFile(node)) {
|
|
70957
|
-
for (const
|
|
70958
|
-
bind(
|
|
70957
|
+
for (const j of node.jsDoc) {
|
|
70958
|
+
bind(j);
|
|
70959
70959
|
}
|
|
70960
70960
|
} else {
|
|
70961
|
-
for (const
|
|
70962
|
-
setParent(
|
|
70961
|
+
for (const j of node.jsDoc) {
|
|
70962
|
+
setParent(j, node);
|
|
70963
70963
|
setParentRecursive(
|
|
70964
|
-
|
|
70964
|
+
j,
|
|
70965
70965
|
/*incremental*/
|
|
70966
70966
|
false
|
|
70967
70967
|
);
|
|
@@ -72134,25 +72134,25 @@ ${lanes.join("\n")}
|
|
|
72134
72134
|
}
|
|
72135
72135
|
function isExportsOrModuleExportsOrAlias(sourceFile, node) {
|
|
72136
72136
|
let i = 0;
|
|
72137
|
-
const
|
|
72138
|
-
|
|
72139
|
-
while (!
|
|
72137
|
+
const q2 = createQueue();
|
|
72138
|
+
q2.enqueue(node);
|
|
72139
|
+
while (!q2.isEmpty() && i < 100) {
|
|
72140
72140
|
i++;
|
|
72141
|
-
node =
|
|
72141
|
+
node = q2.dequeue();
|
|
72142
72142
|
if (isExportsIdentifier(node) || isModuleExportsAccessExpression(node)) {
|
|
72143
72143
|
return true;
|
|
72144
72144
|
} else if (isIdentifier(node)) {
|
|
72145
72145
|
const symbol = lookupSymbolForName(sourceFile, node.escapedText);
|
|
72146
72146
|
if (!!symbol && !!symbol.valueDeclaration && isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) {
|
|
72147
72147
|
const init = symbol.valueDeclaration.initializer;
|
|
72148
|
-
|
|
72148
|
+
q2.enqueue(init);
|
|
72149
72149
|
if (isAssignmentExpression(
|
|
72150
72150
|
init,
|
|
72151
72151
|
/*excludeCompoundAssignment*/
|
|
72152
72152
|
true
|
|
72153
72153
|
)) {
|
|
72154
|
-
|
|
72155
|
-
|
|
72154
|
+
q2.enqueue(init.left);
|
|
72155
|
+
q2.enqueue(init.right);
|
|
72156
72156
|
}
|
|
72157
72157
|
}
|
|
72158
72158
|
}
|
|
@@ -72787,10 +72787,10 @@ ${lanes.join("\n")}
|
|
|
72787
72787
|
}
|
|
72788
72788
|
return isPathRelativeToParent(maybeNonRelative) || countPathComponents(relativePath) < countPathComponents(maybeNonRelative) ? relativePath : maybeNonRelative;
|
|
72789
72789
|
}
|
|
72790
|
-
function packageJsonPathsAreEqual(a2,
|
|
72791
|
-
if (a2 ===
|
|
72792
|
-
if (a2 === void 0 ||
|
|
72793
|
-
return comparePaths(a2,
|
|
72790
|
+
function packageJsonPathsAreEqual(a2, b2, ignoreCase) {
|
|
72791
|
+
if (a2 === b2) return true;
|
|
72792
|
+
if (a2 === void 0 || b2 === void 0) return false;
|
|
72793
|
+
return comparePaths(a2, b2, ignoreCase) === 0;
|
|
72794
72794
|
}
|
|
72795
72795
|
function countPathComponents(path3) {
|
|
72796
72796
|
let count = 0;
|
|
@@ -72799,8 +72799,8 @@ ${lanes.join("\n")}
|
|
|
72799
72799
|
}
|
|
72800
72800
|
return count;
|
|
72801
72801
|
}
|
|
72802
|
-
function comparePathsByRedirectAndNumberOfDirectorySeparators(a2,
|
|
72803
|
-
return compareBooleans(
|
|
72802
|
+
function comparePathsByRedirectAndNumberOfDirectorySeparators(a2, b2) {
|
|
72803
|
+
return compareBooleans(b2.isRedirect, a2.isRedirect) || compareNumberOfDirectorySeparators(a2.path, b2.path);
|
|
72804
72804
|
}
|
|
72805
72805
|
function getNearestAncestorDirectoryWithPackageJson(host, fileName) {
|
|
72806
72806
|
if (host.getNearestAncestorDirectoryWithPackageJson) {
|
|
@@ -73135,20 +73135,20 @@ ${lanes.join("\n")}
|
|
|
73135
73135
|
}
|
|
73136
73136
|
function tryGetModuleNameFromExports(options, host, targetFilePath, packageDirectory, packageName, exports22, conditions) {
|
|
73137
73137
|
if (typeof exports22 === "object" && exports22 !== null && !Array.isArray(exports22) && allKeysStartWithDot(exports22)) {
|
|
73138
|
-
return forEach(getOwnKeys(exports22), (
|
|
73138
|
+
return forEach(getOwnKeys(exports22), (k) => {
|
|
73139
73139
|
const subPackageName = getNormalizedAbsolutePath(
|
|
73140
|
-
combinePaths(packageName,
|
|
73140
|
+
combinePaths(packageName, k),
|
|
73141
73141
|
/*currentDirectory*/
|
|
73142
73142
|
void 0
|
|
73143
73143
|
);
|
|
73144
|
-
const mode = endsWith(
|
|
73144
|
+
const mode = endsWith(k, "/") ? 1 : k.includes("*") ? 2 : 0;
|
|
73145
73145
|
return tryGetModuleNameFromExportsOrImports(
|
|
73146
73146
|
options,
|
|
73147
73147
|
host,
|
|
73148
73148
|
targetFilePath,
|
|
73149
73149
|
packageDirectory,
|
|
73150
73150
|
subPackageName,
|
|
73151
|
-
exports22[
|
|
73151
|
+
exports22[k],
|
|
73152
73152
|
conditions,
|
|
73153
73153
|
mode,
|
|
73154
73154
|
/*isImports*/
|
|
@@ -73193,16 +73193,16 @@ ${lanes.join("\n")}
|
|
|
73193
73193
|
return void 0;
|
|
73194
73194
|
}
|
|
73195
73195
|
const conditions = getConditions(options, importMode);
|
|
73196
|
-
return (_c = forEach(getOwnKeys(imports), (
|
|
73197
|
-
if (!startsWith(
|
|
73198
|
-
const mode = endsWith(
|
|
73196
|
+
return (_c = forEach(getOwnKeys(imports), (k) => {
|
|
73197
|
+
if (!startsWith(k, "#") || k === "#" || startsWith(k, "#/")) return void 0;
|
|
73198
|
+
const mode = endsWith(k, "/") ? 1 : k.includes("*") ? 2 : 0;
|
|
73199
73199
|
return tryGetModuleNameFromExportsOrImports(
|
|
73200
73200
|
options,
|
|
73201
73201
|
host,
|
|
73202
73202
|
moduleFileName,
|
|
73203
73203
|
ancestorDirectoryWithPackageJson,
|
|
73204
|
-
|
|
73205
|
-
imports[
|
|
73204
|
+
k,
|
|
73205
|
+
imports[k],
|
|
73206
73206
|
conditions,
|
|
73207
73207
|
mode,
|
|
73208
73208
|
/*isImports*/
|
|
@@ -80018,7 +80018,7 @@ ${lanes.join("\n")}
|
|
|
80018
80018
|
const restoreFlags = saveRestoreFlags(context);
|
|
80019
80019
|
context.flags |= 64;
|
|
80020
80020
|
seenNames.forEach((types2) => {
|
|
80021
|
-
if (!arrayIsHomogeneous(types2, ([a2], [
|
|
80021
|
+
if (!arrayIsHomogeneous(types2, ([a2], [b2]) => typesAreSameReference(a2, b2))) {
|
|
80022
80022
|
for (const [type, resultIndex] of types2) {
|
|
80023
80023
|
result[resultIndex] = typeToTypeNodeHelper(type, context);
|
|
80024
80024
|
}
|
|
@@ -80029,8 +80029,8 @@ ${lanes.join("\n")}
|
|
|
80029
80029
|
return result;
|
|
80030
80030
|
}
|
|
80031
80031
|
}
|
|
80032
|
-
function typesAreSameReference(a2,
|
|
80033
|
-
return a2 ===
|
|
80032
|
+
function typesAreSameReference(a2, b2) {
|
|
80033
|
+
return a2 === b2 || !!a2.symbol && a2.symbol === b2.symbol || !!a2.aliasSymbol && a2.aliasSymbol === b2.aliasSymbol;
|
|
80034
80034
|
}
|
|
80035
80035
|
function indexInfoToIndexSignatureDeclarationHelper(indexInfo, context, typeNode) {
|
|
80036
80036
|
const name = getNameFromIndexInfo(indexInfo) || "x";
|
|
@@ -80617,9 +80617,9 @@ ${lanes.join("\n")}
|
|
|
80617
80617
|
}
|
|
80618
80618
|
return [symbol2];
|
|
80619
80619
|
}
|
|
80620
|
-
function sortByBestName(a2,
|
|
80620
|
+
function sortByBestName(a2, b2) {
|
|
80621
80621
|
const specifierA = parentSpecifiers[a2];
|
|
80622
|
-
const specifierB = parentSpecifiers[
|
|
80622
|
+
const specifierB = parentSpecifiers[b2];
|
|
80623
80623
|
if (specifierA && specifierB) {
|
|
80624
80624
|
const isBRelative = pathIsRelative(specifierB);
|
|
80625
80625
|
if (pathIsRelative(specifierA) === isBRelative) {
|
|
@@ -81987,8 +81987,8 @@ ${lanes.join("\n")}
|
|
|
81987
81987
|
/* ConstructSignature */
|
|
81988
81988
|
);
|
|
81989
81989
|
const indexSignatures = serializeIndexSignatures(interfaceType, baseType);
|
|
81990
|
-
const heritageClauses = !length(baseTypes) ? void 0 : [factory.createHeritageClause(96, mapDefined(baseTypes, (
|
|
81991
|
-
|
|
81990
|
+
const heritageClauses = !length(baseTypes) ? void 0 : [factory.createHeritageClause(96, mapDefined(baseTypes, (b2) => trySerializeAsTypeReference(
|
|
81991
|
+
b2,
|
|
81992
81992
|
111551
|
|
81993
81993
|
/* Value */
|
|
81994
81994
|
)))];
|
|
@@ -82067,19 +82067,19 @@ ${lanes.join("\n")}
|
|
|
82067
82067
|
}
|
|
82068
82068
|
exports22 = arrayFrom(membersSet);
|
|
82069
82069
|
}
|
|
82070
|
-
return filter(exports22, (
|
|
82071
|
-
|
|
82070
|
+
return filter(exports22, (m) => isNamespaceMember(m) && isIdentifierText(
|
|
82071
|
+
m.escapedName,
|
|
82072
82072
|
99
|
|
82073
82073
|
/* ESNext */
|
|
82074
82074
|
));
|
|
82075
82075
|
}
|
|
82076
82076
|
function isTypeOnlyNamespace(symbol) {
|
|
82077
|
-
return every(getNamespaceMembersForSerialization(symbol), (
|
|
82077
|
+
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551));
|
|
82078
82078
|
}
|
|
82079
82079
|
function serializeModule(symbol, symbolName2, modifierFlags) {
|
|
82080
82080
|
const members = getNamespaceMembersForSerialization(symbol);
|
|
82081
82081
|
const expanding = isExpanding(context);
|
|
82082
|
-
const locationMap = arrayToMultiMap(members, (
|
|
82082
|
+
const locationMap = arrayToMultiMap(members, (m) => m.parent && m.parent === symbol || expanding ? "real" : "merged");
|
|
82083
82083
|
const realMembers = locationMap.get("real") || emptyArray;
|
|
82084
82084
|
const mergedMembers = locationMap.get("merged") || emptyArray;
|
|
82085
82085
|
if (length(realMembers) || expanding) {
|
|
@@ -82373,7 +82373,7 @@ ${lanes.join("\n")}
|
|
|
82373
82373
|
const staticBaseType = isClass ? getBaseConstructorTypeOfClass(staticType) : anyType;
|
|
82374
82374
|
context.approximateLength += (length(baseTypes) ? 8 : 0) + (length(implementsExpressions) ? 11 : 0);
|
|
82375
82375
|
const heritageClauses = [
|
|
82376
|
-
...!length(baseTypes) ? [] : [factory.createHeritageClause(96, map(baseTypes, (
|
|
82376
|
+
...!length(baseTypes) ? [] : [factory.createHeritageClause(96, map(baseTypes, (b2) => serializeBaseType(b2, staticBaseType, localName)))],
|
|
82377
82377
|
...!length(implementsExpressions) ? [] : [factory.createHeritageClause(119, implementsExpressions)]
|
|
82378
82378
|
];
|
|
82379
82379
|
const symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType));
|
|
@@ -86298,7 +86298,7 @@ ${lanes.join("\n")}
|
|
|
86298
86298
|
/* Construct */
|
|
86299
86299
|
).length > 0);
|
|
86300
86300
|
const mixinFlags = map(types, isMixinConstructorType);
|
|
86301
|
-
if (constructorTypeCount > 0 && constructorTypeCount === countWhere(mixinFlags, (
|
|
86301
|
+
if (constructorTypeCount > 0 && constructorTypeCount === countWhere(mixinFlags, (b2) => b2)) {
|
|
86302
86302
|
const firstMixinIndex = mixinFlags.indexOf(
|
|
86303
86303
|
/*searchElement*/
|
|
86304
86304
|
true
|
|
@@ -86328,7 +86328,7 @@ ${lanes.join("\n")}
|
|
|
86328
86328
|
let indexInfos;
|
|
86329
86329
|
const types = type.types;
|
|
86330
86330
|
const mixinFlags = findMixins(types);
|
|
86331
|
-
const mixinCount = countWhere(mixinFlags, (
|
|
86331
|
+
const mixinCount = countWhere(mixinFlags, (b2) => b2);
|
|
86332
86332
|
for (let i = 0; i < types.length; i++) {
|
|
86333
86333
|
const t = type.types[i];
|
|
86334
86334
|
if (!mixinFlags[i]) {
|
|
@@ -87244,7 +87244,7 @@ ${lanes.join("\n")}
|
|
|
87244
87244
|
if (isInstantiation && compareProperties2(
|
|
87245
87245
|
singleProp,
|
|
87246
87246
|
prop,
|
|
87247
|
-
(a2,
|
|
87247
|
+
(a2, b2) => a2 === b2 ? -1 : 0
|
|
87248
87248
|
/* False */
|
|
87249
87249
|
) === -1) {
|
|
87250
87250
|
mergedInstantiations = !!singleProp.parent && !!length(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(singleProp.parent));
|
|
@@ -89826,8 +89826,8 @@ ${lanes.join("\n")}
|
|
|
89826
89826
|
const compositeType = getUnionOrIntersectionType(types, kind);
|
|
89827
89827
|
return createTypePredicate(last2.kind, last2.parameterName, last2.parameterIndex, compositeType);
|
|
89828
89828
|
}
|
|
89829
|
-
function typePredicateKindsMatch(a2,
|
|
89830
|
-
return a2.kind ===
|
|
89829
|
+
function typePredicateKindsMatch(a2, b2) {
|
|
89830
|
+
return a2.kind === b2.kind && a2.parameterIndex === b2.parameterIndex;
|
|
89831
89831
|
}
|
|
89832
89832
|
function getUnionTypeFromSortedList(types, precomputedObjectFlags, aliasSymbol, aliasTypeArguments, origin) {
|
|
89833
89833
|
if (types.length === 0) {
|
|
@@ -90126,11 +90126,11 @@ ${lanes.join("\n")}
|
|
|
90126
90126
|
for (let i = 0; i < count; i++) {
|
|
90127
90127
|
const constituents = types.slice();
|
|
90128
90128
|
let n = i;
|
|
90129
|
-
for (let
|
|
90130
|
-
if (types[
|
|
90131
|
-
const sourceTypes = types[
|
|
90129
|
+
for (let j = types.length - 1; j >= 0; j--) {
|
|
90130
|
+
if (types[j].flags & 1048576) {
|
|
90131
|
+
const sourceTypes = types[j].types;
|
|
90132
90132
|
const length2 = sourceTypes.length;
|
|
90133
|
-
constituents[
|
|
90133
|
+
constituents[j] = sourceTypes[n % length2];
|
|
90134
90134
|
n = Math.floor(n / length2);
|
|
90135
90135
|
}
|
|
90136
90136
|
}
|
|
@@ -110477,9 +110477,9 @@ ${lanes.join("\n")}
|
|
|
110477
110477
|
function hasInferenceCandidatesOrDefault(info2) {
|
|
110478
110478
|
return !!(info2.candidates || info2.contraCandidates || hasTypeParameterDefault(info2.typeParameter));
|
|
110479
110479
|
}
|
|
110480
|
-
function hasOverlappingInferences(a2,
|
|
110480
|
+
function hasOverlappingInferences(a2, b2) {
|
|
110481
110481
|
for (let i = 0; i < a2.length; i++) {
|
|
110482
|
-
if (hasInferenceCandidates(a2[i]) && hasInferenceCandidates(
|
|
110482
|
+
if (hasInferenceCandidates(a2[i]) && hasInferenceCandidates(b2[i])) {
|
|
110483
110483
|
return true;
|
|
110484
110484
|
}
|
|
110485
110485
|
}
|
|
@@ -114666,8 +114666,8 @@ ${lanes.join("\n")}
|
|
|
114666
114666
|
} else if (seenDefault) {
|
|
114667
114667
|
error22(node, Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters);
|
|
114668
114668
|
}
|
|
114669
|
-
for (let
|
|
114670
|
-
if (typeParameterDeclarations[
|
|
114669
|
+
for (let j = 0; j < i; j++) {
|
|
114670
|
+
if (typeParameterDeclarations[j].symbol === node.symbol) {
|
|
114671
114671
|
error22(node.name, Diagnostics.Duplicate_identifier_0, declarationNameToString(node.name));
|
|
114672
114672
|
}
|
|
114673
114673
|
}
|
|
@@ -115775,7 +115775,7 @@ ${lanes.join("\n")}
|
|
|
115775
115775
|
}
|
|
115776
115776
|
if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 308 && host.getEmitModuleFormatOfFile(node.parent) === 1) {
|
|
115777
115777
|
const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find(
|
|
115778
|
-
(
|
|
115778
|
+
(m) => m.kind === 95
|
|
115779
115779
|
/* ExportKeyword */
|
|
115780
115780
|
);
|
|
115781
115781
|
if (exportModifier) {
|
|
@@ -123459,7 +123459,7 @@ ${lanes.join("\n")}
|
|
|
123459
123459
|
return indices;
|
|
123460
123460
|
}
|
|
123461
123461
|
function getProperties(node, requireInitializer, isStatic2) {
|
|
123462
|
-
return filter(node.members, (
|
|
123462
|
+
return filter(node.members, (m) => isInitializedOrStaticProperty(m, requireInitializer, isStatic2));
|
|
123463
123463
|
}
|
|
123464
123464
|
function isStaticPropertyDeclarationOrClassStaticBlockDeclaration(element) {
|
|
123465
123465
|
return isStaticPropertyDeclaration(element) || isClassStaticBlockDeclaration(element);
|
|
@@ -126690,7 +126690,7 @@ ${lanes.join("\n")}
|
|
|
126690
126690
|
factory2.createAssignment(
|
|
126691
126691
|
functionName,
|
|
126692
126692
|
factory2.createFunctionExpression(
|
|
126693
|
-
filter(node.modifiers, (
|
|
126693
|
+
filter(node.modifiers, (m) => isModifier(m) && !isStaticModifier(m) && !isAccessorModifier(m)),
|
|
126694
126694
|
node.asteriskToken,
|
|
126695
126695
|
functionName,
|
|
126696
126696
|
/*typeParameters*/
|
|
@@ -129422,7 +129422,7 @@ ${lanes.join("\n")}
|
|
|
129422
129422
|
) && isStaticElement === isStatic(member);
|
|
129423
129423
|
}
|
|
129424
129424
|
function getDecoratedClassElements(node, isStatic2) {
|
|
129425
|
-
return filter(node.members, (
|
|
129425
|
+
return filter(node.members, (m) => isDecoratedClassElement(m, isStatic2, node));
|
|
129426
129426
|
}
|
|
129427
129427
|
function generateClassElementDecorationExpressions(node, isStatic2) {
|
|
129428
129428
|
const members = getDecoratedClassElements(node, isStatic2);
|
|
@@ -141113,8 +141113,8 @@ ${lanes.join("\n")}
|
|
|
141113
141113
|
return block.kind === 3;
|
|
141114
141114
|
}
|
|
141115
141115
|
function hasImmediateContainingLabeledBlock(labelText, start) {
|
|
141116
|
-
for (let
|
|
141117
|
-
const containingBlock = blockStack[
|
|
141116
|
+
for (let j = start; j >= 0; j--) {
|
|
141117
|
+
const containingBlock = blockStack[j];
|
|
141118
141118
|
if (supportsLabeledBreakOrContinue(containingBlock)) {
|
|
141119
141119
|
if (containingBlock.labelText === labelText) {
|
|
141120
141120
|
return true;
|
|
@@ -144059,7 +144059,7 @@ ${lanes.join("\n")}
|
|
|
144059
144059
|
}
|
|
144060
144060
|
function createExportStarFunction(localNames) {
|
|
144061
144061
|
const exportStarFunction = factory2.createUniqueName("exportStar");
|
|
144062
|
-
const
|
|
144062
|
+
const m = factory2.createIdentifier("m");
|
|
144063
144063
|
const n = factory2.createIdentifier("n");
|
|
144064
144064
|
const exports22 = factory2.createIdentifier("exports");
|
|
144065
144065
|
let condition = factory2.createStrictInequality(n, factory2.createStringLiteral("default"));
|
|
@@ -144089,7 +144089,7 @@ ${lanes.join("\n")}
|
|
|
144089
144089
|
void 0,
|
|
144090
144090
|
/*dotDotDotToken*/
|
|
144091
144091
|
void 0,
|
|
144092
|
-
|
|
144092
|
+
m
|
|
144093
144093
|
)],
|
|
144094
144094
|
/*type*/
|
|
144095
144095
|
void 0,
|
|
@@ -144113,7 +144113,7 @@ ${lanes.join("\n")}
|
|
|
144113
144113
|
factory2.createVariableDeclarationList([
|
|
144114
144114
|
factory2.createVariableDeclaration(n)
|
|
144115
144115
|
]),
|
|
144116
|
-
|
|
144116
|
+
m,
|
|
144117
144117
|
factory2.createBlock([
|
|
144118
144118
|
setEmitFlags(
|
|
144119
144119
|
factory2.createIfStatement(
|
|
@@ -144121,7 +144121,7 @@ ${lanes.join("\n")}
|
|
|
144121
144121
|
factory2.createExpressionStatement(
|
|
144122
144122
|
factory2.createAssignment(
|
|
144123
144123
|
factory2.createElementAccessExpression(exports22, n),
|
|
144124
|
-
factory2.createElementAccessExpression(
|
|
144124
|
+
factory2.createElementAccessExpression(m, n)
|
|
144125
144125
|
)
|
|
144126
144126
|
)
|
|
144127
144127
|
),
|
|
@@ -146791,7 +146791,7 @@ ${lanes.join("\n")}
|
|
|
146791
146791
|
tryGetResolutionModeOverride(decl.attributes)
|
|
146792
146792
|
) : void 0;
|
|
146793
146793
|
}
|
|
146794
|
-
const bindingList = mapDefined(decl.importClause.namedBindings.elements, (
|
|
146794
|
+
const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b2) => resolver.isDeclarationVisible(b2) ? b2 : void 0);
|
|
146795
146795
|
if (bindingList && bindingList.length || visibleDefaultBinding) {
|
|
146796
146796
|
return factory2.updateImportDeclaration(
|
|
146797
146797
|
decl,
|
|
@@ -147664,16 +147664,16 @@ ${lanes.join("\n")}
|
|
|
147664
147664
|
input,
|
|
147665
147665
|
factory2.createNodeArray(ensureModifiers(input)),
|
|
147666
147666
|
input.name,
|
|
147667
|
-
factory2.createNodeArray(mapDefined(input.members, (
|
|
147668
|
-
if (shouldStripInternal(
|
|
147669
|
-
const enumValue = resolver.getEnumMemberValue(
|
|
147667
|
+
factory2.createNodeArray(mapDefined(input.members, (m) => {
|
|
147668
|
+
if (shouldStripInternal(m)) return;
|
|
147669
|
+
const enumValue = resolver.getEnumMemberValue(m);
|
|
147670
147670
|
const constValue = enumValue == null ? void 0 : enumValue.value;
|
|
147671
|
-
if (isolatedDeclarations &&
|
|
147672
|
-
!isComputedPropertyName(
|
|
147673
|
-
context.addDiagnostic(createDiagnosticForNode(
|
|
147671
|
+
if (isolatedDeclarations && m.initializer && (enumValue == null ? void 0 : enumValue.hasExternalReferences) && // This will be its own compiler error instead, so don't report.
|
|
147672
|
+
!isComputedPropertyName(m.name)) {
|
|
147673
|
+
context.addDiagnostic(createDiagnosticForNode(m, Diagnostics.Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations));
|
|
147674
147674
|
}
|
|
147675
147675
|
const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41, factory2.createNumericLiteral(-constValue)) : factory2.createNumericLiteral(constValue);
|
|
147676
|
-
return preserveJsDoc(factory2.updateEnumMember(
|
|
147676
|
+
return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
|
|
147677
147677
|
}))
|
|
147678
147678
|
));
|
|
147679
147679
|
}
|
|
@@ -155506,8 +155506,8 @@ ${lanes.join("\n")}
|
|
|
155506
155506
|
const realDeclarationPath = toPath3(host.realpath(file.originalFileName));
|
|
155507
155507
|
return realDeclarationPath === file.path ? void 0 : (_b2 = getRedirectFromOutput(realDeclarationPath)) == null ? void 0 : _b2.resolvedRef;
|
|
155508
155508
|
}
|
|
155509
|
-
function compareDefaultLibFiles(a2,
|
|
155510
|
-
return compareValues(getDefaultLibFilePriority(a2), getDefaultLibFilePriority(
|
|
155509
|
+
function compareDefaultLibFiles(a2, b2) {
|
|
155510
|
+
return compareValues(getDefaultLibFilePriority(a2), getDefaultLibFilePriority(b2));
|
|
155511
155511
|
}
|
|
155512
155512
|
function getDefaultLibFilePriority(a2) {
|
|
155513
155513
|
if (containsPath(
|
|
@@ -156471,11 +156471,11 @@ ${lanes.join("\n")}
|
|
|
156471
156471
|
reason
|
|
156472
156472
|
);
|
|
156473
156473
|
}
|
|
156474
|
-
function fileReferenceIsEqualTo(a2,
|
|
156475
|
-
return a2.fileName ===
|
|
156474
|
+
function fileReferenceIsEqualTo(a2, b2) {
|
|
156475
|
+
return a2.fileName === b2.fileName;
|
|
156476
156476
|
}
|
|
156477
|
-
function moduleNameIsEqualTo(a2,
|
|
156478
|
-
return a2.kind === 80 ?
|
|
156477
|
+
function moduleNameIsEqualTo(a2, b2) {
|
|
156478
|
+
return a2.kind === 80 ? b2.kind === 80 && a2.escapedText === b2.escapedText : b2.kind === 11 && a2.text === b2.text;
|
|
156479
156479
|
}
|
|
156480
156480
|
function createSyntheticImport(text, file) {
|
|
156481
156481
|
const externalHelpersModuleReference = factory.createStringLiteral(text);
|
|
@@ -158402,31 +158402,31 @@ ${lanes.join("\n")}
|
|
|
158402
158402
|
function create2(forward, reverse, deleted) {
|
|
158403
158403
|
const map2 = {
|
|
158404
158404
|
getKeys: (v2) => reverse.get(v2),
|
|
158405
|
-
getValues: (
|
|
158405
|
+
getValues: (k) => forward.get(k),
|
|
158406
158406
|
keys: () => forward.keys(),
|
|
158407
158407
|
size: () => forward.size,
|
|
158408
|
-
deleteKey: (
|
|
158409
|
-
(deleted || (deleted = /* @__PURE__ */ new Set())).add(
|
|
158410
|
-
const set = forward.get(
|
|
158408
|
+
deleteKey: (k) => {
|
|
158409
|
+
(deleted || (deleted = /* @__PURE__ */ new Set())).add(k);
|
|
158410
|
+
const set = forward.get(k);
|
|
158411
158411
|
if (!set) {
|
|
158412
158412
|
return false;
|
|
158413
158413
|
}
|
|
158414
|
-
set.forEach((v2) => deleteFromMultimap(reverse, v2,
|
|
158415
|
-
forward.delete(
|
|
158414
|
+
set.forEach((v2) => deleteFromMultimap(reverse, v2, k));
|
|
158415
|
+
forward.delete(k);
|
|
158416
158416
|
return true;
|
|
158417
158417
|
},
|
|
158418
|
-
set: (
|
|
158419
|
-
deleted == null ? void 0 : deleted.delete(
|
|
158420
|
-
const existingVSet = forward.get(
|
|
158421
|
-
forward.set(
|
|
158418
|
+
set: (k, vSet) => {
|
|
158419
|
+
deleted == null ? void 0 : deleted.delete(k);
|
|
158420
|
+
const existingVSet = forward.get(k);
|
|
158421
|
+
forward.set(k, vSet);
|
|
158422
158422
|
existingVSet == null ? void 0 : existingVSet.forEach((v2) => {
|
|
158423
158423
|
if (!vSet.has(v2)) {
|
|
158424
|
-
deleteFromMultimap(reverse, v2,
|
|
158424
|
+
deleteFromMultimap(reverse, v2, k);
|
|
158425
158425
|
}
|
|
158426
158426
|
});
|
|
158427
158427
|
vSet.forEach((v2) => {
|
|
158428
158428
|
if (!(existingVSet == null ? void 0 : existingVSet.has(v2))) {
|
|
158429
|
-
addToMultimap(reverse, v2,
|
|
158429
|
+
addToMultimap(reverse, v2, k);
|
|
158430
158430
|
}
|
|
158431
158431
|
});
|
|
158432
158432
|
return map2;
|
|
@@ -158442,19 +158442,19 @@ ${lanes.join("\n")}
|
|
|
158442
158442
|
);
|
|
158443
158443
|
}
|
|
158444
158444
|
BuilderState2.createManyToManyPathMap = createManyToManyPathMap;
|
|
158445
|
-
function addToMultimap(map2,
|
|
158446
|
-
let set = map2.get(
|
|
158445
|
+
function addToMultimap(map2, k, v2) {
|
|
158446
|
+
let set = map2.get(k);
|
|
158447
158447
|
if (!set) {
|
|
158448
158448
|
set = /* @__PURE__ */ new Set();
|
|
158449
|
-
map2.set(
|
|
158449
|
+
map2.set(k, set);
|
|
158450
158450
|
}
|
|
158451
158451
|
set.add(v2);
|
|
158452
158452
|
}
|
|
158453
|
-
function deleteFromMultimap(map2,
|
|
158454
|
-
const set = map2.get(
|
|
158453
|
+
function deleteFromMultimap(map2, k, v2) {
|
|
158454
|
+
const set = map2.get(k);
|
|
158455
158455
|
if (set == null ? void 0 : set.delete(v2)) {
|
|
158456
158456
|
if (!set.size) {
|
|
158457
|
-
map2.delete(
|
|
158457
|
+
map2.delete(k);
|
|
158458
158458
|
}
|
|
158459
158459
|
return true;
|
|
158460
158460
|
}
|
|
@@ -164772,7 +164772,7 @@ ${lanes.join("\n")}
|
|
|
164772
164772
|
return options.pretty;
|
|
164773
164773
|
}
|
|
164774
164774
|
function getOptionsForHelp(commandLine) {
|
|
164775
|
-
return !!commandLine.options.all ? toSorted(optionDeclarations.concat(tscBuildOption), (a2,
|
|
164775
|
+
return !!commandLine.options.all ? toSorted(optionDeclarations.concat(tscBuildOption), (a2, b2) => compareStringsCaseInsensitive(a2.name, b2.name)) : filter(optionDeclarations.concat(tscBuildOption), (v2) => !!v2.showInSimplifiedHelpView);
|
|
164776
164776
|
}
|
|
164777
164777
|
function printVersion(sys2) {
|
|
164778
164778
|
sys2.write(getDiagnosticText(Diagnostics.Version_0, version) + sys2.newLine);
|
|
@@ -166978,7 +166978,7 @@ ${lanes.join("\n")}
|
|
|
166978
166978
|
const { node: tpName } = resolver.trackExistingEntityName(context, tp.name);
|
|
166979
166979
|
return factory.updateTypeParameterDeclaration(
|
|
166980
166980
|
tp,
|
|
166981
|
-
(_a = tp.modifiers) == null ? void 0 : _a.map((
|
|
166981
|
+
(_a = tp.modifiers) == null ? void 0 : _a.map((m) => reuseNode(context, m)),
|
|
166982
166982
|
tpName,
|
|
166983
166983
|
serializeExistingTypeNodeWithFallback(tp.constraint, context),
|
|
166984
166984
|
serializeExistingTypeNodeWithFallback(tp.default, context)
|
|
@@ -167370,9 +167370,9 @@ ${lanes.join("\n")}
|
|
|
167370
167370
|
addInferredTypings(packageNames, " Found package names");
|
|
167371
167371
|
}
|
|
167372
167372
|
function getTypingNamesFromSourceFileNames(fileNames2) {
|
|
167373
|
-
const fromFileNames = mapDefined(fileNames2, (
|
|
167374
|
-
if (!hasJSFileExtension(
|
|
167375
|
-
const inferredTypingName = removeFileExtension(toFileNameLowerCase(getBaseFileName(
|
|
167373
|
+
const fromFileNames = mapDefined(fileNames2, (j) => {
|
|
167374
|
+
if (!hasJSFileExtension(j)) return void 0;
|
|
167375
|
+
const inferredTypingName = removeFileExtension(toFileNameLowerCase(getBaseFileName(j)));
|
|
167376
167376
|
const cleanedTypingName = removeMinAndVersionNumbers(inferredTypingName);
|
|
167377
167377
|
return safeList.get(cleanedTypingName);
|
|
167378
167378
|
});
|
|
@@ -169364,7 +169364,7 @@ ${lanes.join("\n")}
|
|
|
169364
169364
|
return textSpanContainsPosition(span, node.getStart(file)) && node.getEnd() <= textSpanEnd(span);
|
|
169365
169365
|
}
|
|
169366
169366
|
function findModifier(node, kind) {
|
|
169367
|
-
return canHaveModifiers(node) ? find(node.modifiers, (
|
|
169367
|
+
return canHaveModifiers(node) ? find(node.modifiers, (m) => m.kind === kind) : void 0;
|
|
169368
169368
|
}
|
|
169369
169369
|
function insertImports(changes, sourceFile, imports, blankLineBetween, preferences) {
|
|
169370
169370
|
var _a;
|
|
@@ -169372,7 +169372,7 @@ ${lanes.join("\n")}
|
|
|
169372
169372
|
const importKindPredicate = decl.kind === 244 ? isRequireVariableStatement : isAnyImportSyntax;
|
|
169373
169373
|
const existingImportStatements = filter(sourceFile.statements, importKindPredicate);
|
|
169374
169374
|
const { comparer, isSorted } = ts_OrganizeImports_exports.getOrganizeImportsStringComparerWithDetection(existingImportStatements, preferences);
|
|
169375
|
-
const sortedNewImports = isArray(imports) ? toSorted(imports, (a2,
|
|
169375
|
+
const sortedNewImports = isArray(imports) ? toSorted(imports, (a2, b2) => ts_OrganizeImports_exports.compareImportsOrRequireStatements(a2, b2, comparer)) : [imports];
|
|
169376
169376
|
if (!(existingImportStatements == null ? void 0 : existingImportStatements.length)) {
|
|
169377
169377
|
if (isFullSourceFile(sourceFile)) {
|
|
169378
169378
|
changes.insertNodesAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween);
|
|
@@ -169415,14 +169415,14 @@ ${lanes.join("\n")}
|
|
|
169415
169415
|
Debug.assert(importClause.isTypeOnly);
|
|
169416
169416
|
return cast(importClause.getChildAt(0, sourceFile), isTypeKeywordToken);
|
|
169417
169417
|
}
|
|
169418
|
-
function textSpansEqual(a2,
|
|
169419
|
-
return !!a2 && !!
|
|
169418
|
+
function textSpansEqual(a2, b2) {
|
|
169419
|
+
return !!a2 && !!b2 && a2.start === b2.start && a2.length === b2.length;
|
|
169420
169420
|
}
|
|
169421
|
-
function documentSpansEqual(a2,
|
|
169422
|
-
return (useCaseSensitiveFileNames2 ? equateStringsCaseSensitive : equateStringsCaseInsensitive)(a2.fileName,
|
|
169421
|
+
function documentSpansEqual(a2, b2, useCaseSensitiveFileNames2) {
|
|
169422
|
+
return (useCaseSensitiveFileNames2 ? equateStringsCaseSensitive : equateStringsCaseInsensitive)(a2.fileName, b2.fileName) && textSpansEqual(a2.textSpan, b2.textSpan);
|
|
169423
169423
|
}
|
|
169424
169424
|
function getDocumentSpansEqualityComparer(useCaseSensitiveFileNames2) {
|
|
169425
|
-
return (a2,
|
|
169425
|
+
return (a2, b2) => documentSpansEqual(a2, b2, useCaseSensitiveFileNames2);
|
|
169426
169426
|
}
|
|
169427
169427
|
function forEachUnique(array, callback) {
|
|
169428
169428
|
if (array) {
|
|
@@ -172546,8 +172546,8 @@ ${lanes.join("\n")}
|
|
|
172546
172546
|
const elseKeyword = keywords[i];
|
|
172547
172547
|
const ifKeyword = keywords[i + 1];
|
|
172548
172548
|
let shouldCombineElseAndIf = true;
|
|
172549
|
-
for (let
|
|
172550
|
-
if (!isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(
|
|
172549
|
+
for (let j = ifKeyword.getStart(sourceFile) - 1; j >= elseKeyword.end; j--) {
|
|
172550
|
+
if (!isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) {
|
|
172551
172551
|
shouldCombineElseAndIf = false;
|
|
172552
172552
|
break;
|
|
172553
172553
|
}
|
|
@@ -172625,7 +172625,7 @@ ${lanes.join("\n")}
|
|
|
172625
172625
|
entry.forEach((value, scriptKind) => sourceFiles.push({ name: name2, scriptKind, refCount: value.languageServiceRefCount }));
|
|
172626
172626
|
}
|
|
172627
172627
|
});
|
|
172628
|
-
sourceFiles.sort((x,
|
|
172628
|
+
sourceFiles.sort((x, y2) => y2.refCount - x.refCount);
|
|
172629
172629
|
return {
|
|
172630
172630
|
bucket: name,
|
|
172631
172631
|
sourceFiles
|
|
@@ -173035,8 +173035,8 @@ ${lanes.join("\n")}
|
|
|
173035
173035
|
return void 0;
|
|
173036
173036
|
}
|
|
173037
173037
|
let bestMatch;
|
|
173038
|
-
for (let i = dotSeparatedSegments.length - 2,
|
|
173039
|
-
bestMatch = betterMatch(bestMatch, matchSegment(candidateContainers[
|
|
173038
|
+
for (let i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1; i >= 0; i -= 1, j -= 1) {
|
|
173039
|
+
bestMatch = betterMatch(bestMatch, matchSegment(candidateContainers[j], dotSeparatedSegments[i], stringToWordSpans));
|
|
173040
173040
|
}
|
|
173041
173041
|
return bestMatch;
|
|
173042
173042
|
}
|
|
@@ -173132,11 +173132,11 @@ ${lanes.join("\n")}
|
|
|
173132
173132
|
}
|
|
173133
173133
|
return bestMatch;
|
|
173134
173134
|
}
|
|
173135
|
-
function betterMatch(a2,
|
|
173136
|
-
return min([a2,
|
|
173135
|
+
function betterMatch(a2, b2) {
|
|
173136
|
+
return min([a2, b2], compareMatches);
|
|
173137
173137
|
}
|
|
173138
|
-
function compareMatches(a2,
|
|
173139
|
-
return a2 === void 0 ? 1 :
|
|
173138
|
+
function compareMatches(a2, b2) {
|
|
173139
|
+
return a2 === void 0 ? 1 : b2 === void 0 ? -1 : compareValues(a2.kind, b2.kind) || compareBooleans(!a2.isCaseSensitive, !b2.isCaseSensitive);
|
|
173140
173140
|
}
|
|
173141
173141
|
function partStartsWith(candidate, candidateSpan, pattern, ignoreCase, patternSpan = { start: 0, length: pattern.length }) {
|
|
173142
173142
|
return patternSpan.length <= candidateSpan.length && everyInRange(0, patternSpan.length, (i) => equalChars(pattern.charCodeAt(patternSpan.start + i), candidate.charCodeAt(candidateSpan.start + i), ignoreCase));
|
|
@@ -174753,16 +174753,16 @@ interface Symbol {
|
|
|
174753
174753
|
/* ThisProperty */
|
|
174754
174754
|
]: false
|
|
174755
174755
|
};
|
|
174756
|
-
function tryMergeEs5Class(a2,
|
|
174756
|
+
function tryMergeEs5Class(a2, b2, bIndex, parent2) {
|
|
174757
174757
|
function isPossibleConstructor(node) {
|
|
174758
174758
|
return isFunctionExpression(node) || isFunctionDeclaration(node) || isVariableDeclaration(node);
|
|
174759
174759
|
}
|
|
174760
|
-
const bAssignmentDeclarationKind = isBinaryExpression(
|
|
174760
|
+
const bAssignmentDeclarationKind = isBinaryExpression(b2.node) || isCallExpression(b2.node) ? getAssignmentDeclarationKind(b2.node) : 0;
|
|
174761
174761
|
const aAssignmentDeclarationKind = isBinaryExpression(a2.node) || isCallExpression(a2.node) ? getAssignmentDeclarationKind(a2.node) : 0;
|
|
174762
|
-
if (isEs5ClassMember[bAssignmentDeclarationKind] && isEs5ClassMember[aAssignmentDeclarationKind] || isPossibleConstructor(a2.node) && isEs5ClassMember[bAssignmentDeclarationKind] || isPossibleConstructor(
|
|
174762
|
+
if (isEs5ClassMember[bAssignmentDeclarationKind] && isEs5ClassMember[aAssignmentDeclarationKind] || isPossibleConstructor(a2.node) && isEs5ClassMember[bAssignmentDeclarationKind] || isPossibleConstructor(b2.node) && isEs5ClassMember[aAssignmentDeclarationKind] || isClassDeclaration(a2.node) && isSynthesized(a2.node) && isEs5ClassMember[bAssignmentDeclarationKind] || isClassDeclaration(b2.node) && isEs5ClassMember[aAssignmentDeclarationKind] || isClassDeclaration(a2.node) && isSynthesized(a2.node) && isPossibleConstructor(b2.node) || isClassDeclaration(b2.node) && isPossibleConstructor(a2.node) && isSynthesized(a2.node)) {
|
|
174763
174763
|
let lastANode = a2.additionalNodes && lastOrUndefined(a2.additionalNodes) || a2.node;
|
|
174764
|
-
if (!isClassDeclaration(a2.node) && !isClassDeclaration(
|
|
174765
|
-
const ctorFunction = isPossibleConstructor(a2.node) ? a2.node : isPossibleConstructor(
|
|
174764
|
+
if (!isClassDeclaration(a2.node) && !isClassDeclaration(b2.node) || isPossibleConstructor(a2.node) || isPossibleConstructor(b2.node)) {
|
|
174765
|
+
const ctorFunction = isPossibleConstructor(a2.node) ? a2.node : isPossibleConstructor(b2.node) ? b2.node : void 0;
|
|
174766
174766
|
if (ctorFunction !== void 0) {
|
|
174767
174767
|
const ctorNode = setTextRange(
|
|
174768
174768
|
factory.createConstructorDeclaration(
|
|
@@ -174776,11 +174776,11 @@ interface Symbol {
|
|
|
174776
174776
|
);
|
|
174777
174777
|
const ctor = emptyNavigationBarNode(ctorNode);
|
|
174778
174778
|
ctor.indent = a2.indent + 1;
|
|
174779
|
-
ctor.children = a2.node === ctorFunction ? a2.children :
|
|
174780
|
-
a2.children = a2.node === ctorFunction ? concatenate([ctor],
|
|
174779
|
+
ctor.children = a2.node === ctorFunction ? a2.children : b2.children;
|
|
174780
|
+
a2.children = a2.node === ctorFunction ? concatenate([ctor], b2.children || [b2]) : concatenate(a2.children || [{ ...a2 }], [ctor]);
|
|
174781
174781
|
} else {
|
|
174782
|
-
if (a2.children ||
|
|
174783
|
-
a2.children = concatenate(a2.children || [{ ...a2 }],
|
|
174782
|
+
if (a2.children || b2.children) {
|
|
174783
|
+
a2.children = concatenate(a2.children || [{ ...a2 }], b2.children || [b2]);
|
|
174784
174784
|
if (a2.children) {
|
|
174785
174785
|
mergeChildren(a2.children, a2);
|
|
174786
174786
|
sortChildren(a2.children);
|
|
@@ -174801,12 +174801,12 @@ interface Symbol {
|
|
|
174801
174801
|
a2.node
|
|
174802
174802
|
);
|
|
174803
174803
|
} else {
|
|
174804
|
-
a2.children = concatenate(a2.children,
|
|
174804
|
+
a2.children = concatenate(a2.children, b2.children);
|
|
174805
174805
|
if (a2.children) {
|
|
174806
174806
|
mergeChildren(a2.children, a2);
|
|
174807
174807
|
}
|
|
174808
174808
|
}
|
|
174809
|
-
const bNode =
|
|
174809
|
+
const bNode = b2.node;
|
|
174810
174810
|
if (parent2.children[bIndex - 1].node.end === lastANode.end) {
|
|
174811
174811
|
setTextRange(lastANode, { pos: lastANode.pos, end: bNode.end });
|
|
174812
174812
|
} else {
|
|
@@ -174822,25 +174822,25 @@ interface Symbol {
|
|
|
174822
174822
|
void 0,
|
|
174823
174823
|
[]
|
|
174824
174824
|
),
|
|
174825
|
-
|
|
174825
|
+
b2.node
|
|
174826
174826
|
));
|
|
174827
174827
|
}
|
|
174828
174828
|
return true;
|
|
174829
174829
|
}
|
|
174830
174830
|
return bAssignmentDeclarationKind === 0 ? false : true;
|
|
174831
174831
|
}
|
|
174832
|
-
function tryMerge(a2,
|
|
174833
|
-
if (tryMergeEs5Class(a2,
|
|
174832
|
+
function tryMerge(a2, b2, bIndex, parent2) {
|
|
174833
|
+
if (tryMergeEs5Class(a2, b2, bIndex, parent2)) {
|
|
174834
174834
|
return true;
|
|
174835
174835
|
}
|
|
174836
|
-
if (shouldReallyMerge(a2.node,
|
|
174837
|
-
merge(a2,
|
|
174836
|
+
if (shouldReallyMerge(a2.node, b2.node, parent2)) {
|
|
174837
|
+
merge(a2, b2);
|
|
174838
174838
|
return true;
|
|
174839
174839
|
}
|
|
174840
174840
|
return false;
|
|
174841
174841
|
}
|
|
174842
|
-
function shouldReallyMerge(a2,
|
|
174843
|
-
if (a2.kind !==
|
|
174842
|
+
function shouldReallyMerge(a2, b2, parent2) {
|
|
174843
|
+
if (a2.kind !== b2.kind || a2.parent !== b2.parent && !(isOwnChild(a2, parent2) && isOwnChild(b2, parent2))) {
|
|
174844
174844
|
return false;
|
|
174845
174845
|
}
|
|
174846
174846
|
switch (a2.kind) {
|
|
@@ -174848,9 +174848,9 @@ interface Symbol {
|
|
|
174848
174848
|
case 175:
|
|
174849
174849
|
case 178:
|
|
174850
174850
|
case 179:
|
|
174851
|
-
return isStatic(a2) === isStatic(
|
|
174851
|
+
return isStatic(a2) === isStatic(b2);
|
|
174852
174852
|
case 268:
|
|
174853
|
-
return areSameModule(a2,
|
|
174853
|
+
return areSameModule(a2, b2) && getFullyQualifiedModuleName(a2) === getFullyQualifiedModuleName(b2);
|
|
174854
174854
|
default:
|
|
174855
174855
|
return true;
|
|
174856
174856
|
}
|
|
@@ -174863,11 +174863,11 @@ interface Symbol {
|
|
|
174863
174863
|
const par = isModuleBlock(n.parent) ? n.parent.parent : n.parent;
|
|
174864
174864
|
return par === parent2.node || contains(parent2.additionalNodes, par);
|
|
174865
174865
|
}
|
|
174866
|
-
function areSameModule(a2,
|
|
174867
|
-
if (!a2.body || !
|
|
174868
|
-
return a2.body ===
|
|
174866
|
+
function areSameModule(a2, b2) {
|
|
174867
|
+
if (!a2.body || !b2.body) {
|
|
174868
|
+
return a2.body === b2.body;
|
|
174869
174869
|
}
|
|
174870
|
-
return a2.body.kind ===
|
|
174870
|
+
return a2.body.kind === b2.body.kind && (a2.body.kind !== 268 || areSameModule(a2.body, b2.body));
|
|
174871
174871
|
}
|
|
174872
174872
|
function merge(target, source) {
|
|
174873
174873
|
target.additionalNodes = target.additionalNodes || [];
|
|
@@ -177246,7 +177246,7 @@ interface Symbol {
|
|
|
177246
177246
|
const members = map(decl.parameters, convertParameterToNamedTupleMember);
|
|
177247
177247
|
return setEmitFlags(
|
|
177248
177248
|
factory.createTupleTypeNode(members),
|
|
177249
|
-
some(members, (
|
|
177249
|
+
some(members, (m) => !!length(getSyntheticLeadingComments(m))) ? 0 : 1
|
|
177250
177250
|
/* SingleLine */
|
|
177251
177251
|
);
|
|
177252
177252
|
}
|
|
@@ -177732,7 +177732,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
177732
177732
|
const functionCalls = sortAndDeduplicate(
|
|
177733
177733
|
groupedReferences.functionCalls,
|
|
177734
177734
|
/*comparer*/
|
|
177735
|
-
(a2,
|
|
177735
|
+
(a2, b2) => compareValues(a2.pos, b2.pos)
|
|
177736
177736
|
);
|
|
177737
177737
|
for (const call of functionCalls) {
|
|
177738
177738
|
if (call.arguments && call.arguments.length) {
|
|
@@ -178363,7 +178363,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
178363
178363
|
}
|
|
178364
178364
|
};
|
|
178365
178365
|
function escapeRawStringForTemplate(s) {
|
|
178366
|
-
return s.replace(/\\.|[$`]/g, (
|
|
178366
|
+
return s.replace(/\\.|[$`]/g, (m) => m[0] === "\\" ? m : "\\" + m);
|
|
178367
178367
|
}
|
|
178368
178368
|
function getRawTextOfTemplate(node) {
|
|
178369
178369
|
const rightShaving = isTemplateHead(node) || isTemplateMiddle(node) ? -2 : -1;
|
|
@@ -180036,7 +180036,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
180036
180036
|
}
|
|
180037
180037
|
function getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes) {
|
|
180038
180038
|
const variableAssignments = map(exposedVariableDeclarations, (v2) => factory.createShorthandPropertyAssignment(v2.symbol.name));
|
|
180039
|
-
const writeAssignments = map(writes, (
|
|
180039
|
+
const writeAssignments = map(writes, (w) => factory.createShorthandPropertyAssignment(w.symbol.name));
|
|
180040
180040
|
return variableAssignments === void 0 ? writeAssignments : writeAssignments === void 0 ? variableAssignments : variableAssignments.concat(writeAssignments);
|
|
180041
180041
|
}
|
|
180042
180042
|
function isReadonlyArray(v2) {
|
|
@@ -182520,7 +182520,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
182520
182520
|
const token = getTouchingToken(sourceFile, position);
|
|
182521
182521
|
const matchKind = token.getStart(sourceFile) === position ? braceMatching.get(token.kind.toString()) : void 0;
|
|
182522
182522
|
const match = matchKind && findChildOfKind(token.parent, matchKind, sourceFile);
|
|
182523
|
-
return match ? [createTextSpanFromNode(token, sourceFile), createTextSpanFromNode(match, sourceFile)].sort((a2,
|
|
182523
|
+
return match ? [createTextSpanFromNode(token, sourceFile), createTextSpanFromNode(match, sourceFile)].sort((a2, b2) => a2.start - b2.start) : emptyArray;
|
|
182524
182524
|
}
|
|
182525
182525
|
function getIndentationAtPosition(fileName, position, editorOptions) {
|
|
182526
182526
|
let start = timestamp();
|
|
@@ -183864,7 +183864,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
183864
183864
|
if (symbol && symbol.declarations) {
|
|
183865
183865
|
const indices = indicesOf(symbol.declarations);
|
|
183866
183866
|
const keys = map(symbol.declarations, (decl) => ({ file: decl.getSourceFile().fileName, pos: decl.pos }));
|
|
183867
|
-
indices.sort((a2,
|
|
183867
|
+
indices.sort((a2, b2) => compareStringsCaseSensitive(keys[a2].file, keys[b2].file) || keys[a2].pos - keys[b2].pos);
|
|
183868
183868
|
const sortedDeclarations = map(indices, (i) => symbol.declarations[i]);
|
|
183869
183869
|
let lastDecl;
|
|
183870
183870
|
for (const decl of sortedDeclarations) {
|
|
@@ -185335,8 +185335,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
185335
185335
|
if (!shouldConvertDeclaration(memberDeclaration, assignmentExpr)) {
|
|
185336
185336
|
return;
|
|
185337
185337
|
}
|
|
185338
|
-
if (some(members, (
|
|
185339
|
-
const name = getNameOfDeclaration(
|
|
185338
|
+
if (some(members, (m) => {
|
|
185339
|
+
const name = getNameOfDeclaration(m);
|
|
185340
185340
|
if (name && isIdentifier(name) && idText(name) === symbolName(symbol2)) {
|
|
185341
185341
|
return true;
|
|
185342
185342
|
}
|
|
@@ -186838,9 +186838,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
186838
186838
|
},
|
|
186839
186839
|
fixIds: [fixId12],
|
|
186840
186840
|
getAllCodeActions: (context) => codeFixAll(context, errorCodes13, (changes, diag2) => {
|
|
186841
|
-
const
|
|
186842
|
-
if (
|
|
186843
|
-
doChange10(changes, diag2.file,
|
|
186841
|
+
const q2 = getQualifiedName(diag2.file, diag2.start);
|
|
186842
|
+
if (q2) {
|
|
186843
|
+
doChange10(changes, diag2.file, q2);
|
|
186844
186844
|
}
|
|
186845
186845
|
})
|
|
186846
186846
|
});
|
|
@@ -187363,7 +187363,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
187363
187363
|
const implementedTypeSymbols = checker.getPropertiesOfType(implementedType);
|
|
187364
187364
|
const nonPrivateAndNotExistedInHeritageClauseMembers = implementedTypeSymbols.filter(and(symbolPointsToNonPrivateMember, (symbol) => !maybeHeritageClauseSymbol.has(symbol.escapedName)));
|
|
187365
187365
|
const classType = checker.getTypeAtLocation(classDeclaration);
|
|
187366
|
-
const constructor = find(classDeclaration.members, (
|
|
187366
|
+
const constructor = find(classDeclaration.members, (m) => isConstructorDeclaration(m));
|
|
187367
187367
|
if (!classType.getNumberIndexType()) {
|
|
187368
187368
|
createMissingIndexSignatureDeclaration(
|
|
187369
187369
|
implementedType,
|
|
@@ -188398,7 +188398,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
188398
188398
|
}
|
|
188399
188399
|
function sortFixInfo(fixes, sourceFile, program, packageJsonImportFilter, host, preferences) {
|
|
188400
188400
|
const _toPath = (fileName) => toPath(fileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
|
|
188401
|
-
return toSorted(fixes, (a2,
|
|
188401
|
+
return toSorted(fixes, (a2, b2) => compareBooleans(!!a2.isJsxNamespaceFix, !!b2.isJsxNamespaceFix) || compareValues(a2.fix.kind, b2.fix.kind) || compareModuleSpecifiers(a2.fix, b2.fix, sourceFile, program, preferences, packageJsonImportFilter.allowsImportingSpecifier, _toPath));
|
|
188402
188402
|
}
|
|
188403
188403
|
function getFixInfosWithoutDiagnostic(context, symbolToken, useAutoImportProvider) {
|
|
188404
188404
|
const info2 = getFixesInfoForNonUMDImport(context, symbolToken, useAutoImportProvider);
|
|
@@ -188425,21 +188425,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
188425
188425
|
)
|
|
188426
188426
|
);
|
|
188427
188427
|
}
|
|
188428
|
-
function compareModuleSpecifiers(a2,
|
|
188429
|
-
if (a2.kind !== 0 &&
|
|
188428
|
+
function compareModuleSpecifiers(a2, b2, importingFile, program, preferences, allowsImportingSpecifier, toPath3) {
|
|
188429
|
+
if (a2.kind !== 0 && b2.kind !== 0) {
|
|
188430
188430
|
return compareBooleans(
|
|
188431
|
-
|
|
188431
|
+
b2.moduleSpecifierKind !== "node_modules" || allowsImportingSpecifier(b2.moduleSpecifier),
|
|
188432
188432
|
a2.moduleSpecifierKind !== "node_modules" || allowsImportingSpecifier(a2.moduleSpecifier)
|
|
188433
|
-
) || compareModuleSpecifierRelativity(a2,
|
|
188433
|
+
) || compareModuleSpecifierRelativity(a2, b2, preferences) || compareNodeCoreModuleSpecifiers(a2.moduleSpecifier, b2.moduleSpecifier, importingFile, program) || compareBooleans(
|
|
188434
188434
|
isFixPossiblyReExportingImportingFile(a2, importingFile.path, toPath3),
|
|
188435
|
-
isFixPossiblyReExportingImportingFile(
|
|
188436
|
-
) || compareNumberOfDirectorySeparators(a2.moduleSpecifier,
|
|
188435
|
+
isFixPossiblyReExportingImportingFile(b2, importingFile.path, toPath3)
|
|
188436
|
+
) || compareNumberOfDirectorySeparators(a2.moduleSpecifier, b2.moduleSpecifier);
|
|
188437
188437
|
}
|
|
188438
188438
|
return 0;
|
|
188439
188439
|
}
|
|
188440
|
-
function compareModuleSpecifierRelativity(a2,
|
|
188440
|
+
function compareModuleSpecifierRelativity(a2, b2, preferences) {
|
|
188441
188441
|
if (preferences.importModuleSpecifierPreference === "non-relative" || preferences.importModuleSpecifierPreference === "project-relative") {
|
|
188442
|
-
return compareBooleans(a2.moduleSpecifierKind === "relative",
|
|
188442
|
+
return compareBooleans(a2.moduleSpecifierKind === "relative", b2.moduleSpecifierKind === "relative");
|
|
188443
188443
|
}
|
|
188444
188444
|
return 0;
|
|
188445
188445
|
}
|
|
@@ -188459,9 +188459,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
188459
188459
|
true
|
|
188460
188460
|
) === "index";
|
|
188461
188461
|
}
|
|
188462
|
-
function compareNodeCoreModuleSpecifiers(a2,
|
|
188463
|
-
if (startsWith(a2, "node:") && !startsWith(
|
|
188464
|
-
if (startsWith(
|
|
188462
|
+
function compareNodeCoreModuleSpecifiers(a2, b2, importingFile, program) {
|
|
188463
|
+
if (startsWith(a2, "node:") && !startsWith(b2, "node:")) return shouldUseUriStyleNodeCoreModules(importingFile, program) ? -1 : 1;
|
|
188464
|
+
if (startsWith(b2, "node:") && !startsWith(a2, "node:")) return shouldUseUriStyleNodeCoreModules(importingFile, program) ? 1 : -1;
|
|
188465
188465
|
return 0;
|
|
188466
188466
|
}
|
|
188467
188467
|
function getFixesInfoForUMDImport({ sourceFile, program, host, preferences }, token) {
|
|
@@ -189262,7 +189262,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
189262
189262
|
const modifiers = classElement.modifiers || emptyArray;
|
|
189263
189263
|
const staticModifier = find(modifiers, isStaticModifier);
|
|
189264
189264
|
const abstractModifier = find(modifiers, isAbstractModifier);
|
|
189265
|
-
const accessibilityModifier = find(modifiers, (
|
|
189265
|
+
const accessibilityModifier = find(modifiers, (m) => isAccessibilityModifier(m.kind));
|
|
189266
189266
|
const lastDecorator = findLast(modifiers, isDecorator);
|
|
189267
189267
|
const modifierPos = abstractModifier ? abstractModifier.end : staticModifier ? staticModifier.end : accessibilityModifier ? accessibilityModifier.end : lastDecorator ? skipTrivia(sourceFile.text, lastDecorator.end) : classElement.getStart(sourceFile);
|
|
189268
189268
|
const options = accessibilityModifier || staticModifier || abstractModifier ? { prefix: " " } : { suffix: " " };
|
|
@@ -197691,7 +197691,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
197691
197691
|
{ ...formatContext, options: formatOptions }
|
|
197692
197692
|
);
|
|
197693
197693
|
});
|
|
197694
|
-
const allChanges = escapes ? toSorted(concatenate(changes, escapes), (a2,
|
|
197694
|
+
const allChanges = escapes ? toSorted(concatenate(changes, escapes), (a2, b2) => compareTextSpans(a2.span, b2.span)) : changes;
|
|
197695
197695
|
return ts_textChanges_exports.applyChanges(syntheticFile.text, allChanges);
|
|
197696
197696
|
}
|
|
197697
197697
|
function printNode(hint, node, sourceFile) {
|
|
@@ -197727,7 +197727,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
197727
197727
|
0,
|
|
197728
197728
|
{ ...formatContext, options: formatOptions }
|
|
197729
197729
|
);
|
|
197730
|
-
const allChanges = escapes ? toSorted(concatenate(changes, escapes), (a2,
|
|
197730
|
+
const allChanges = escapes ? toSorted(concatenate(changes, escapes), (a2, b2) => compareTextSpans(a2.span, b2.span)) : changes;
|
|
197731
197731
|
return ts_textChanges_exports.applyChanges(syntheticFile.text, allChanges);
|
|
197732
197732
|
}
|
|
197733
197733
|
}
|
|
@@ -199651,29 +199651,29 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
199651
199651
|
}
|
|
199652
199652
|
const membersDeclaredBySpreadAssignment = /* @__PURE__ */ new Set();
|
|
199653
199653
|
const existingMemberNames = /* @__PURE__ */ new Set();
|
|
199654
|
-
for (const
|
|
199655
|
-
if (
|
|
199654
|
+
for (const m of existingMembers) {
|
|
199655
|
+
if (m.kind !== 304 && m.kind !== 305 && m.kind !== 209 && m.kind !== 175 && m.kind !== 178 && m.kind !== 179 && m.kind !== 306) {
|
|
199656
199656
|
continue;
|
|
199657
199657
|
}
|
|
199658
|
-
if (isCurrentlyEditingNode(
|
|
199658
|
+
if (isCurrentlyEditingNode(m)) {
|
|
199659
199659
|
continue;
|
|
199660
199660
|
}
|
|
199661
199661
|
let existingName;
|
|
199662
|
-
if (isSpreadAssignment(
|
|
199663
|
-
setMembersDeclaredBySpreadAssignment(
|
|
199664
|
-
} else if (isBindingElement(
|
|
199665
|
-
if (
|
|
199666
|
-
existingName =
|
|
199662
|
+
if (isSpreadAssignment(m)) {
|
|
199663
|
+
setMembersDeclaredBySpreadAssignment(m, membersDeclaredBySpreadAssignment);
|
|
199664
|
+
} else if (isBindingElement(m) && m.propertyName) {
|
|
199665
|
+
if (m.propertyName.kind === 80) {
|
|
199666
|
+
existingName = m.propertyName.escapedText;
|
|
199667
199667
|
}
|
|
199668
199668
|
} else {
|
|
199669
|
-
const name = getNameOfDeclaration(
|
|
199669
|
+
const name = getNameOfDeclaration(m);
|
|
199670
199670
|
existingName = name && isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0;
|
|
199671
199671
|
}
|
|
199672
199672
|
if (existingName !== void 0) {
|
|
199673
199673
|
existingMemberNames.add(existingName);
|
|
199674
199674
|
}
|
|
199675
199675
|
}
|
|
199676
|
-
const filteredSymbols = contextualMemberSymbols.filter((
|
|
199676
|
+
const filteredSymbols = contextualMemberSymbols.filter((m) => !existingMemberNames.has(m.escapedName));
|
|
199677
199677
|
setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, filteredSymbols);
|
|
199678
199678
|
return filteredSymbols;
|
|
199679
199679
|
}
|
|
@@ -199689,9 +199689,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
199689
199689
|
}
|
|
199690
199690
|
}
|
|
199691
199691
|
function setSortTextToOptionalMember() {
|
|
199692
|
-
symbols.forEach((
|
|
199693
|
-
if (
|
|
199694
|
-
const symbolId = getSymbolId(
|
|
199692
|
+
symbols.forEach((m) => {
|
|
199693
|
+
if (m.flags & 16777216) {
|
|
199694
|
+
const symbolId = getSymbolId(m);
|
|
199695
199695
|
symbolToSortTextMap[symbolId] = symbolToSortTextMap[symbolId] ?? SortText.OptionalMember;
|
|
199696
199696
|
}
|
|
199697
199697
|
});
|
|
@@ -199729,24 +199729,24 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
199729
199729
|
}
|
|
199730
199730
|
function filterClassMembersList(baseSymbols, existingMembers, currentClassElementModifierFlags) {
|
|
199731
199731
|
const existingMemberNames = /* @__PURE__ */ new Set();
|
|
199732
|
-
for (const
|
|
199733
|
-
if (
|
|
199732
|
+
for (const m of existingMembers) {
|
|
199733
|
+
if (m.kind !== 173 && m.kind !== 175 && m.kind !== 178 && m.kind !== 179) {
|
|
199734
199734
|
continue;
|
|
199735
199735
|
}
|
|
199736
|
-
if (isCurrentlyEditingNode(
|
|
199736
|
+
if (isCurrentlyEditingNode(m)) {
|
|
199737
199737
|
continue;
|
|
199738
199738
|
}
|
|
199739
199739
|
if (hasEffectiveModifier(
|
|
199740
|
-
|
|
199740
|
+
m,
|
|
199741
199741
|
2
|
|
199742
199742
|
/* Private */
|
|
199743
199743
|
)) {
|
|
199744
199744
|
continue;
|
|
199745
199745
|
}
|
|
199746
|
-
if (isStatic(
|
|
199746
|
+
if (isStatic(m) !== !!(currentClassElementModifierFlags & 256)) {
|
|
199747
199747
|
continue;
|
|
199748
199748
|
}
|
|
199749
|
-
const existingName = getPropertyNameForPropertyNameNode(
|
|
199749
|
+
const existingName = getPropertyNameForPropertyNameNode(m.name);
|
|
199750
199750
|
if (existingName) {
|
|
199751
199751
|
existingMemberNames.add(existingName);
|
|
199752
199752
|
}
|
|
@@ -200981,11 +200981,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
200981
200981
|
}
|
|
200982
200982
|
function addCompletionEntriesFromPaths(result, fragment, baseDirectory, extensionOptions, program, host, moduleSpecifierResolutionHost, paths) {
|
|
200983
200983
|
const getPatternsForKey = (key) => paths[key];
|
|
200984
|
-
const comparePaths2 = (a2,
|
|
200984
|
+
const comparePaths2 = (a2, b2) => {
|
|
200985
200985
|
const patternA = tryParsePattern(a2);
|
|
200986
|
-
const patternB = tryParsePattern(
|
|
200986
|
+
const patternB = tryParsePattern(b2);
|
|
200987
200987
|
const lengthA = typeof patternA === "object" ? patternA.prefix.length : a2.length;
|
|
200988
|
-
const lengthB = typeof patternB === "object" ? patternB.prefix.length :
|
|
200988
|
+
const lengthB = typeof patternB === "object" ? patternB.prefix.length : b2.length;
|
|
200989
200989
|
return compareValues(lengthB, lengthA);
|
|
200990
200990
|
};
|
|
200991
200991
|
return addCompletionEntriesFromPathsOrExportsOrImports(
|
|
@@ -205905,7 +205905,7 @@ ${content}
|
|
|
205905
205905
|
}
|
|
205906
205906
|
}
|
|
205907
205907
|
parsedNodes.sort(
|
|
205908
|
-
(a2,
|
|
205908
|
+
(a2, b2) => a2.sourceFile.parseDiagnostics.length - b2.sourceFile.parseDiagnostics.length
|
|
205909
205909
|
);
|
|
205910
205910
|
const { body } = parsedNodes[0];
|
|
205911
205911
|
return body;
|
|
@@ -206010,33 +206010,33 @@ ${content}
|
|
|
206010
206010
|
changes
|
|
206011
206011
|
);
|
|
206012
206012
|
}
|
|
206013
|
-
function matchNode(a2,
|
|
206013
|
+
function matchNode(a2, b2) {
|
|
206014
206014
|
var _a, _b, _c, _d, _e, _f;
|
|
206015
|
-
if (a2.kind !==
|
|
206015
|
+
if (a2.kind !== b2.kind) {
|
|
206016
206016
|
return false;
|
|
206017
206017
|
}
|
|
206018
206018
|
if (a2.kind === 177) {
|
|
206019
|
-
return a2.kind ===
|
|
206019
|
+
return a2.kind === b2.kind;
|
|
206020
206020
|
}
|
|
206021
|
-
if (isNamedDeclaration(a2) && isNamedDeclaration(
|
|
206022
|
-
return a2.name.getText() ===
|
|
206021
|
+
if (isNamedDeclaration(a2) && isNamedDeclaration(b2)) {
|
|
206022
|
+
return a2.name.getText() === b2.name.getText();
|
|
206023
206023
|
}
|
|
206024
|
-
if (isIfStatement(a2) && isIfStatement(
|
|
206025
|
-
return a2.expression.getText() ===
|
|
206024
|
+
if (isIfStatement(a2) && isIfStatement(b2)) {
|
|
206025
|
+
return a2.expression.getText() === b2.expression.getText();
|
|
206026
206026
|
}
|
|
206027
|
-
if (isWhileStatement(a2) && isWhileStatement(
|
|
206028
|
-
return a2.expression.getText() ===
|
|
206027
|
+
if (isWhileStatement(a2) && isWhileStatement(b2)) {
|
|
206028
|
+
return a2.expression.getText() === b2.expression.getText();
|
|
206029
206029
|
}
|
|
206030
|
-
if (isForStatement(a2) && isForStatement(
|
|
206031
|
-
return ((_a = a2.initializer) == null ? void 0 : _a.getText()) === ((_b =
|
|
206030
|
+
if (isForStatement(a2) && isForStatement(b2)) {
|
|
206031
|
+
return ((_a = a2.initializer) == null ? void 0 : _a.getText()) === ((_b = b2.initializer) == null ? void 0 : _b.getText()) && ((_c = a2.incrementor) == null ? void 0 : _c.getText()) === ((_d = b2.incrementor) == null ? void 0 : _d.getText()) && ((_e = a2.condition) == null ? void 0 : _e.getText()) === ((_f = b2.condition) == null ? void 0 : _f.getText());
|
|
206032
206032
|
}
|
|
206033
|
-
if (isForInOrOfStatement(a2) && isForInOrOfStatement(
|
|
206034
|
-
return a2.expression.getText() ===
|
|
206033
|
+
if (isForInOrOfStatement(a2) && isForInOrOfStatement(b2)) {
|
|
206034
|
+
return a2.expression.getText() === b2.expression.getText() && a2.initializer.getText() === b2.initializer.getText();
|
|
206035
206035
|
}
|
|
206036
|
-
if (isLabeledStatement(a2) && isLabeledStatement(
|
|
206037
|
-
return a2.label.getText() ===
|
|
206036
|
+
if (isLabeledStatement(a2) && isLabeledStatement(b2)) {
|
|
206037
|
+
return a2.label.getText() === b2.label.getText();
|
|
206038
206038
|
}
|
|
206039
|
-
if (a2.getText() ===
|
|
206039
|
+
if (a2.getText() === b2.getText()) {
|
|
206040
206040
|
return true;
|
|
206041
206041
|
}
|
|
206042
206042
|
return false;
|
|
@@ -206322,7 +206322,7 @@ ${content}
|
|
|
206322
206322
|
const importGroupsByAttributes = groupBy(importGroup, (decl) => {
|
|
206323
206323
|
if (decl.attributes) {
|
|
206324
206324
|
let attrs = decl.attributes.token + " ";
|
|
206325
|
-
for (const x of toSorted(decl.attributes.elements, (x2,
|
|
206325
|
+
for (const x of toSorted(decl.attributes.elements, (x2, y2) => compareStringsCaseSensitive(x2.name.text, y2.name.text))) {
|
|
206326
206326
|
attrs += x.name.text + ":";
|
|
206327
206327
|
attrs += isStringLiteralLike(x.value) ? `"${x.value.text}"` : x.value.getText() + " ";
|
|
206328
206328
|
}
|
|
@@ -206584,8 +206584,8 @@ ${content}
|
|
|
206584
206584
|
}
|
|
206585
206585
|
function measureSortedness(arr, comparer) {
|
|
206586
206586
|
let i = 0;
|
|
206587
|
-
for (let
|
|
206588
|
-
if (comparer(arr[
|
|
206587
|
+
for (let j = 0; j < arr.length - 1; j++) {
|
|
206588
|
+
if (comparer(arr[j], arr[j + 1]) > 0) {
|
|
206589
206589
|
i++;
|
|
206590
206590
|
}
|
|
206591
206591
|
}
|
|
@@ -206687,7 +206687,7 @@ ${content}
|
|
|
206687
206687
|
return { specifierComparer, isSorted };
|
|
206688
206688
|
}
|
|
206689
206689
|
function getImportDeclarationInsertionIndex(sortedImports, newImport, comparer) {
|
|
206690
|
-
const index = binarySearch(sortedImports, newImport, identity, (a2,
|
|
206690
|
+
const index = binarySearch(sortedImports, newImport, identity, (a2, b2) => compareImportsOrRequireStatements(a2, b2, comparer));
|
|
206691
206691
|
return index < 0 ? ~index : index;
|
|
206692
206692
|
}
|
|
206693
206693
|
function getImportSpecifierInsertionIndex(sortedImports, newImport, comparer) {
|
|
@@ -207481,11 +207481,11 @@ ${content}
|
|
|
207481
207481
|
function getImmediatelyContainingArgumentOrContextualParameterInfo(node, position, sourceFile, checker) {
|
|
207482
207482
|
return tryGetParameterInfo(node, position, sourceFile, checker) || getImmediatelyContainingArgumentInfo(node, position, sourceFile, checker);
|
|
207483
207483
|
}
|
|
207484
|
-
function getHighestBinary(
|
|
207485
|
-
return isBinaryExpression(
|
|
207484
|
+
function getHighestBinary(b2) {
|
|
207485
|
+
return isBinaryExpression(b2.parent) ? getHighestBinary(b2.parent) : b2;
|
|
207486
207486
|
}
|
|
207487
|
-
function countBinaryExpressionParameters(
|
|
207488
|
-
return isBinaryExpression(
|
|
207487
|
+
function countBinaryExpressionParameters(b2) {
|
|
207488
|
+
return isBinaryExpression(b2.left) ? countBinaryExpressionParameters(b2.left) + 1 : 2;
|
|
207489
207489
|
}
|
|
207490
207490
|
function tryGetParameterInfo(startingToken, position, sourceFile, checker) {
|
|
207491
207491
|
const node = getAdjustedNode(startingToken);
|
|
@@ -209415,7 +209415,7 @@ ${content}
|
|
|
209415
209415
|
this.insertJsdocCommentBefore(sourceFile, updateJSDocHost(node), factory.createJSDocComment(this.createJSDocText(sourceFile, node), factory.createNodeArray(tags)));
|
|
209416
209416
|
}
|
|
209417
209417
|
addJSDocTags(sourceFile, parent2, newTags) {
|
|
209418
|
-
const oldTags = flatMapToMutable(parent2.jsDoc, (
|
|
209418
|
+
const oldTags = flatMapToMutable(parent2.jsDoc, (j) => j.tags);
|
|
209419
209419
|
const unmergedNewTags = newTags.filter(
|
|
209420
209420
|
(newTag) => !oldTags.some((tag, i) => {
|
|
209421
209421
|
const merged = tryMergeJsdocTags(tag, newTag);
|
|
@@ -209426,7 +209426,7 @@ ${content}
|
|
|
209426
209426
|
this.replaceJSDocComment(sourceFile, parent2, [...oldTags, ...unmergedNewTags]);
|
|
209427
209427
|
}
|
|
209428
209428
|
filterJSDocTags(sourceFile, parent2, predicate) {
|
|
209429
|
-
this.replaceJSDocComment(sourceFile, parent2, filter(flatMapToMutable(parent2.jsDoc, (
|
|
209429
|
+
this.replaceJSDocComment(sourceFile, parent2, filter(flatMapToMutable(parent2.jsDoc, (j) => j.tags), predicate));
|
|
209430
209430
|
}
|
|
209431
209431
|
replaceRangeWithText(sourceFile, range, text) {
|
|
209432
209432
|
this.changes.push({ kind: 3, sourceFile, range, text });
|
|
@@ -209886,7 +209886,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
209886
209886
|
function getTextChangesFromChanges(changes, newLineCharacter, formatContext, validate) {
|
|
209887
209887
|
return mapDefined(group(changes, (c) => c.sourceFile.path), (changesInFile) => {
|
|
209888
209888
|
const sourceFile = changesInFile[0].sourceFile;
|
|
209889
|
-
const normalized = toSorted(changesInFile, (a2,
|
|
209889
|
+
const normalized = toSorted(changesInFile, (a2, b2) => a2.range.pos - b2.range.pos || a2.range.end - b2.range.end);
|
|
209890
209890
|
for (let i = 0; i < normalized.length - 1; i++) {
|
|
209891
209891
|
Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", () => `${JSON.stringify(normalized[i].range)} and ${JSON.stringify(normalized[i + 1].range)}`);
|
|
209892
209892
|
}
|
|
@@ -210278,8 +210278,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
210278
210278
|
function isValidLocationToAddComment(sourceFile, position) {
|
|
210279
210279
|
return !isInComment(sourceFile, position) && !isInString(sourceFile, position) && !isInTemplateString(sourceFile, position) && !isInJSXText(sourceFile, position);
|
|
210280
210280
|
}
|
|
210281
|
-
function needSemicolonBetween(a2,
|
|
210282
|
-
return (isPropertySignature(a2) || isPropertyDeclaration(a2)) && isClassOrTypeElement(
|
|
210281
|
+
function needSemicolonBetween(a2, b2) {
|
|
210282
|
+
return (isPropertySignature(a2) || isPropertyDeclaration(a2)) && isClassOrTypeElement(b2) && b2.name.kind === 168 || isStatementButNotDeclaration(a2) && isStatementButNotDeclaration(b2);
|
|
210283
210283
|
}
|
|
210284
210284
|
var deleteDeclaration;
|
|
210285
210285
|
((_deleteDeclaration) => {
|
|
@@ -219798,10 +219798,10 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
219798
219798
|
};
|
|
219799
219799
|
const pluginModule = pluginModuleFactory({ typescript: ts_exports2 });
|
|
219800
219800
|
const newLS = pluginModule.create(info2);
|
|
219801
|
-
for (const
|
|
219802
|
-
if (!(
|
|
219803
|
-
this.projectService.logger.info(`Plugin activation warning: Missing proxied method ${
|
|
219804
|
-
newLS[
|
|
219801
|
+
for (const k of Object.keys(this.languageService)) {
|
|
219802
|
+
if (!(k in newLS)) {
|
|
219803
|
+
this.projectService.logger.info(`Plugin activation warning: Missing proxied method ${k} in created LS. Patching.`);
|
|
219804
|
+
newLS[k] = this.languageService[k];
|
|
219805
219805
|
}
|
|
219806
219806
|
}
|
|
219807
219807
|
this.projectService.logger.info(`Plugin validation succeeded`);
|
|
@@ -219993,7 +219993,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
219993
219993
|
return getOrUpdate(cachedUnresolvedImportsPerFile, file.path, () => {
|
|
219994
219994
|
let unresolvedImports;
|
|
219995
219995
|
program.forEachResolvedModule(({ resolvedModule }, name) => {
|
|
219996
|
-
if ((!resolvedModule || !resolutionExtensionIsTSOrJson(resolvedModule.extension)) && !isExternalModuleNameRelative(name) && !ambientModules.some((
|
|
219996
|
+
if ((!resolvedModule || !resolutionExtensionIsTSOrJson(resolvedModule.extension)) && !isExternalModuleNameRelative(name) && !ambientModules.some((m) => m === name)) {
|
|
219997
219997
|
unresolvedImports = append(unresolvedImports, parsePackageName(name).packageName);
|
|
219998
219998
|
}
|
|
219999
219999
|
}, file);
|
|
@@ -221323,8 +221323,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
221323
221323
|
return;
|
|
221324
221324
|
}
|
|
221325
221325
|
const raw = JSON.parse(fileContent);
|
|
221326
|
-
for (const
|
|
221327
|
-
raw.typesMap[
|
|
221326
|
+
for (const k of Object.keys(raw.typesMap)) {
|
|
221327
|
+
raw.typesMap[k].match = new RegExp(raw.typesMap[k].match, "i");
|
|
221328
221328
|
}
|
|
221329
221329
|
this.safelist = raw.typesMap;
|
|
221330
221330
|
for (const key in raw.simpleMap) {
|
|
@@ -222275,7 +222275,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
222275
222275
|
}
|
|
222276
222276
|
totalNonTsFileSize += this.host.getFileSize(fileName);
|
|
222277
222277
|
if (totalNonTsFileSize > maxProgramSizeForNonTsFiles || totalNonTsFileSize > availableSpace) {
|
|
222278
|
-
const top5LargestFiles = fileNames.map((f2) => propertyReader.getFileName(f2)).filter((name2) => !hasTSFileExtension(name2)).map((name2) => ({ name: name2, size: this.host.getFileSize(name2) })).sort((a2,
|
|
222278
|
+
const top5LargestFiles = fileNames.map((f2) => propertyReader.getFileName(f2)).filter((name2) => !hasTSFileExtension(name2)).map((name2) => ({ name: name2, size: this.host.getFileSize(name2) })).sort((a2, b2) => b2.size - a2.size).slice(0, 5);
|
|
222279
222279
|
this.logger.info(`Non TS file size exceeded limit (${totalNonTsFileSize}). Largest files: ${top5LargestFiles.map((file) => `${file.name}:${file.size}`).join(", ")}`);
|
|
222280
222280
|
return fileName;
|
|
222281
222281
|
}
|
|
@@ -227974,14 +227974,14 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
227974
227974
|
seen.push(item);
|
|
227975
227975
|
return true;
|
|
227976
227976
|
}
|
|
227977
|
-
function navigateToItemIsEqualTo(a2,
|
|
227978
|
-
if (a2 ===
|
|
227977
|
+
function navigateToItemIsEqualTo(a2, b2) {
|
|
227978
|
+
if (a2 === b2) {
|
|
227979
227979
|
return true;
|
|
227980
227980
|
}
|
|
227981
|
-
if (!a2 || !
|
|
227981
|
+
if (!a2 || !b2) {
|
|
227982
227982
|
return false;
|
|
227983
227983
|
}
|
|
227984
|
-
return a2.containerKind ===
|
|
227984
|
+
return a2.containerKind === b2.containerKind && a2.containerName === b2.containerName && a2.fileName === b2.fileName && a2.isCaseSensitive === b2.isCaseSensitive && a2.kind === b2.kind && a2.kindModifiers === b2.kindModifiers && a2.matchKind === b2.matchKind && a2.name === b2.name && a2.textSpan.start === b2.textSpan.start && a2.textSpan.length === b2.textSpan.length;
|
|
227985
227985
|
}
|
|
227986
227986
|
}
|
|
227987
227987
|
getSupportedCodeFixes(args) {
|
|
@@ -228703,12 +228703,12 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
228703
228703
|
}
|
|
228704
228704
|
let branchParent;
|
|
228705
228705
|
let lastZeroCount;
|
|
228706
|
-
for (let
|
|
228707
|
-
this.endBranch[
|
|
228708
|
-
if (this.endBranch[
|
|
228709
|
-
lastZeroCount = this.endBranch[
|
|
228710
|
-
if (
|
|
228711
|
-
branchParent = this.endBranch[
|
|
228706
|
+
for (let k = this.endBranch.length - 1; k >= 0; k--) {
|
|
228707
|
+
this.endBranch[k].updateCounts();
|
|
228708
|
+
if (this.endBranch[k].charCount() === 0) {
|
|
228709
|
+
lastZeroCount = this.endBranch[k];
|
|
228710
|
+
if (k > 0) {
|
|
228711
|
+
branchParent = this.endBranch[k - 1];
|
|
228712
228712
|
} else {
|
|
228713
228713
|
branchParent = this.branchNode;
|
|
228714
228714
|
}
|
|
@@ -228743,15 +228743,15 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
228743
228743
|
}
|
|
228744
228744
|
this.lineIndex.root.updateCounts();
|
|
228745
228745
|
} else {
|
|
228746
|
-
for (let
|
|
228747
|
-
this.startPath[
|
|
228746
|
+
for (let j = this.startPath.length - 2; j >= 0; j--) {
|
|
228747
|
+
this.startPath[j].updateCounts();
|
|
228748
228748
|
}
|
|
228749
228749
|
}
|
|
228750
228750
|
} else {
|
|
228751
228751
|
const insertionNode = this.startPath[this.startPath.length - 2];
|
|
228752
228752
|
insertionNode.remove(leafNode);
|
|
228753
|
-
for (let
|
|
228754
|
-
this.startPath[
|
|
228753
|
+
for (let j = this.startPath.length - 2; j >= 0; j--) {
|
|
228754
|
+
this.startPath[j].updateCounts();
|
|
228755
228755
|
}
|
|
228756
228756
|
}
|
|
228757
228757
|
return this.lineIndex;
|
|
@@ -229871,13 +229871,13 @@ var HttpResponseRetryCodes = [
|
|
|
229871
229871
|
// ../../node_modules/.pnpm/@actions+core@3.0.1/node_modules/@actions/core/lib/summary.js
|
|
229872
229872
|
var import_os = require("os");
|
|
229873
229873
|
var import_fs = require("fs");
|
|
229874
|
-
var __awaiter = function(thisArg, _arguments,
|
|
229874
|
+
var __awaiter = function(thisArg, _arguments, P2, generator) {
|
|
229875
229875
|
function adopt(value) {
|
|
229876
|
-
return value instanceof
|
|
229876
|
+
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
229877
229877
|
resolve(value);
|
|
229878
229878
|
});
|
|
229879
229879
|
}
|
|
229880
|
-
return new (
|
|
229880
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject) {
|
|
229881
229881
|
function fulfilled(value) {
|
|
229882
229882
|
try {
|
|
229883
229883
|
step(generator.next(value));
|
|
@@ -230375,7 +230375,7 @@ var import_path3 = __toESM(require("path"), 1);
|
|
|
230375
230375
|
var import_typescript2 = __toESM(require_typescript(), 1);
|
|
230376
230376
|
var import_fs5 = require("fs");
|
|
230377
230377
|
var import_path4 = __toESM(require("path"), 1);
|
|
230378
|
-
async function
|
|
230378
|
+
async function Q(e, t) {
|
|
230379
230379
|
if (!t) return /* @__PURE__ */ new Set();
|
|
230380
230380
|
let i = await import_fs3.promises.readFile(import_path2.default.resolve(e, t), "utf8").catch(() => {
|
|
230381
230381
|
});
|
|
@@ -230383,9 +230383,9 @@ async function Y(e, t) {
|
|
|
230383
230383
|
let n = JSON.parse(i);
|
|
230384
230384
|
return new Set(n.findings ?? []);
|
|
230385
230385
|
}
|
|
230386
|
-
var
|
|
230387
|
-
var
|
|
230388
|
-
var
|
|
230386
|
+
var W = ["local", "ci", "strict"];
|
|
230387
|
+
var Ve = [".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"];
|
|
230388
|
+
var ee = class {
|
|
230389
230389
|
constructor(t, i = /* @__PURE__ */ new Map()) {
|
|
230390
230390
|
this.modules = t;
|
|
230391
230391
|
for (let n of t.keys()) this.forward.set(n, new Set(t.get(n)?.dependencies)), this.reverse.set(n, /* @__PURE__ */ new Set());
|
|
@@ -230400,9 +230400,9 @@ var Z = class {
|
|
|
230400
230400
|
reverse = /* @__PURE__ */ new Map();
|
|
230401
230401
|
unresolved = /* @__PURE__ */ new Map();
|
|
230402
230402
|
impactedFiles(t) {
|
|
230403
|
-
let i = /* @__PURE__ */ new Set(), n = Array.from(t).filter((r) => this.modules.has(
|
|
230403
|
+
let i = /* @__PURE__ */ new Set(), n = Array.from(t).filter((r) => this.modules.has(y(r)));
|
|
230404
230404
|
for (; n.length > 0; ) {
|
|
230405
|
-
let r =
|
|
230405
|
+
let r = y(n.shift());
|
|
230406
230406
|
if (!i.has(r)) {
|
|
230407
230407
|
i.add(r);
|
|
230408
230408
|
for (let o of [...this.forward.get(r) ?? [], ...this.reverse.get(r) ?? []]) i.has(o) || n.push(o);
|
|
@@ -230411,7 +230411,7 @@ var Z = class {
|
|
|
230411
230411
|
return i;
|
|
230412
230412
|
}
|
|
230413
230413
|
linkedBindings(t, i, n) {
|
|
230414
|
-
let r = /* @__PURE__ */ new Set(), o = this.modules.get(
|
|
230414
|
+
let r = /* @__PURE__ */ new Set(), o = this.modules.get(y(t));
|
|
230415
230415
|
if (!o || n.length === 0) return r;
|
|
230416
230416
|
let s = new Set(n);
|
|
230417
230417
|
for (let f of o.imports) {
|
|
@@ -230422,18 +230422,18 @@ var Z = class {
|
|
|
230422
230422
|
return r;
|
|
230423
230423
|
}
|
|
230424
230424
|
hasUnresolvedImport(t) {
|
|
230425
|
-
return (this.unresolved.get(
|
|
230425
|
+
return (this.unresolved.get(y(t))?.size ?? 0) > 0;
|
|
230426
230426
|
}
|
|
230427
230427
|
resolveDependency(t, i) {
|
|
230428
|
-
return this.modules.get(
|
|
230428
|
+
return this.modules.get(y(t))?.resolvedSpecifiers.get(i);
|
|
230429
230429
|
}
|
|
230430
230430
|
exportReaches(t, i, n, r, o) {
|
|
230431
230431
|
let s = `${t}:${i}`;
|
|
230432
230432
|
if (o.has(s)) return false;
|
|
230433
230433
|
o.add(s);
|
|
230434
|
-
let f =
|
|
230435
|
-
if (
|
|
230436
|
-
let l = this.modules.get(
|
|
230434
|
+
let f = y(n);
|
|
230435
|
+
if (y(t) === f && r.has(i)) return true;
|
|
230436
|
+
let l = this.modules.get(y(t));
|
|
230437
230437
|
if (!l) return false;
|
|
230438
230438
|
let c = l.localExports.get(i);
|
|
230439
230439
|
if (c) {
|
|
@@ -230454,24 +230454,24 @@ var Z = class {
|
|
|
230454
230454
|
return t.resolvedSpecifiers.get(i);
|
|
230455
230455
|
}
|
|
230456
230456
|
};
|
|
230457
|
-
async function
|
|
230458
|
-
let n = new Set(t.map((c) =>
|
|
230457
|
+
async function we(e, t, i) {
|
|
230458
|
+
let n = new Set(t.map((c) => y(c.relativePath))), r = await He(e, i), o = await Xe(e, r), s = await qe(e, i, r), f = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
230459
230459
|
for (let c of t) {
|
|
230460
|
-
let u =
|
|
230461
|
-
for (let
|
|
230462
|
-
let
|
|
230463
|
-
if (
|
|
230464
|
-
else if (
|
|
230465
|
-
let
|
|
230466
|
-
|
|
230460
|
+
let u = y(c.relativePath), d = Je(u, c.source), m = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Set([...d.imports.map((p) => p.specifier), ...d.reExports.map((p) => p.specifier)]);
|
|
230461
|
+
for (let p of S) {
|
|
230462
|
+
let x = Ye(e, u, p, n, o, s);
|
|
230463
|
+
if (x) m.add(x), C.set(p, x);
|
|
230464
|
+
else if (Ze(p, o, s)) {
|
|
230465
|
+
let h = l.get(u) ?? /* @__PURE__ */ new Set();
|
|
230466
|
+
h.add(p), l.set(u, h);
|
|
230467
230467
|
}
|
|
230468
230468
|
}
|
|
230469
|
-
d.dependencies =
|
|
230469
|
+
d.dependencies = m, d.resolvedSpecifiers = C, f.set(u, d);
|
|
230470
230470
|
}
|
|
230471
|
-
return new
|
|
230471
|
+
return new ee(f, l);
|
|
230472
230472
|
}
|
|
230473
|
-
function
|
|
230474
|
-
let i = import_typescript2.default.createSourceFile(e, t, import_typescript2.default.ScriptTarget.Latest, true,
|
|
230473
|
+
function Je(e, t) {
|
|
230474
|
+
let i = import_typescript2.default.createSourceFile(e, t, import_typescript2.default.ScriptTarget.Latest, true, tt(e)), n = [], r = /* @__PURE__ */ new Map(), o = [];
|
|
230475
230475
|
for (let s of i.statements) {
|
|
230476
230476
|
if (import_typescript2.default.isImportDeclaration(s) && import_typescript2.default.isStringLiteral(s.moduleSpecifier)) {
|
|
230477
230477
|
let l = s.moduleSpecifier.text;
|
|
@@ -230498,9 +230498,9 @@ function Ve(e, t) {
|
|
|
230498
230498
|
}
|
|
230499
230499
|
return { imports: n, localExports: r, reExports: o, dependencies: /* @__PURE__ */ new Set(), resolvedSpecifiers: /* @__PURE__ */ new Map() };
|
|
230500
230500
|
}
|
|
230501
|
-
async function
|
|
230502
|
-
if (t?.roots) return
|
|
230503
|
-
let i = /* @__PURE__ */ new Set(), r = (await
|
|
230501
|
+
async function He(e, t) {
|
|
230502
|
+
if (t?.roots) return ie(t.roots, e, "workspace.roots");
|
|
230503
|
+
let i = /* @__PURE__ */ new Set(), r = (await be(import_path3.default.join(e, "package.json"), true))?.workspaces;
|
|
230504
230504
|
if (Array.isArray(r)) for (let f of r) typeof f == "string" && i.add(f);
|
|
230505
230505
|
if (r && typeof r == "object" && !Array.isArray(r)) {
|
|
230506
230506
|
let f = r.packages;
|
|
@@ -230509,7 +230509,7 @@ async function Je(e, t) {
|
|
|
230509
230509
|
let o = import_path3.default.join(e, "pnpm-workspace.yaml"), s = await import_fs4.promises.readFile(o, "utf8").catch(() => {
|
|
230510
230510
|
});
|
|
230511
230511
|
if (s !== void 0) for (let f of Ge(s)) i.add(f);
|
|
230512
|
-
return
|
|
230512
|
+
return ie(Array.from(i), e, "workspace roots");
|
|
230513
230513
|
}
|
|
230514
230514
|
function Ge(e) {
|
|
230515
230515
|
let t = e.split(/\r?\n/), i = [], n = false, r = -1;
|
|
@@ -230520,12 +230520,12 @@ function Ge(e) {
|
|
|
230520
230520
|
if (!n) {
|
|
230521
230521
|
let d = l.match(/^packages\s*:\s*\[(.*)\]\s*$/);
|
|
230522
230522
|
if (d) {
|
|
230523
|
-
let
|
|
230524
|
-
if (!
|
|
230525
|
-
for (let
|
|
230526
|
-
let
|
|
230527
|
-
if (!
|
|
230528
|
-
i.push(
|
|
230523
|
+
let m = d[1].trim();
|
|
230524
|
+
if (!m) return i;
|
|
230525
|
+
for (let C of m.split(",")) {
|
|
230526
|
+
let S = C.trim().replace(/^(?:'([^']*)'|"([^"]*)")$/, "$1$2");
|
|
230527
|
+
if (!S || ["[", "]", "{", "}", ":"].some((p) => S.includes(p))) throw new Error("pnpm-workspace.yaml packages must contain plain string paths.");
|
|
230528
|
+
i.push(S);
|
|
230529
230529
|
}
|
|
230530
230530
|
return i;
|
|
230531
230531
|
}
|
|
@@ -230543,11 +230543,11 @@ function Ge(e) {
|
|
|
230543
230543
|
return n ? i : [];
|
|
230544
230544
|
}
|
|
230545
230545
|
async function Xe(e, t) {
|
|
230546
|
-
let i = await
|
|
230546
|
+
let i = await et(e, "package.json"), n = t.filter((f) => !f.startsWith("!")).map(re), r = t.filter((f) => f.startsWith("!")).map((f) => re(f.slice(1))), o = [], s = /* @__PURE__ */ new Map();
|
|
230547
230547
|
for (let f of i) {
|
|
230548
|
-
let l =
|
|
230548
|
+
let l = y(import_path3.default.relative(e, import_path3.default.dirname(f))) || ".";
|
|
230549
230549
|
if (l !== "." && (n.length === 0 || !n.some((d) => d.test(l)) || r.some((d) => d.test(l)))) continue;
|
|
230550
|
-
let c = await
|
|
230550
|
+
let c = await be(f, true);
|
|
230551
230551
|
if (typeof c?.name != "string") continue;
|
|
230552
230552
|
let u = s.get(c.name);
|
|
230553
230553
|
if (u && u !== l) throw new Error(`Duplicate workspace package name ${c.name}: ${u}, ${l}.`);
|
|
@@ -230555,68 +230555,68 @@ async function Xe(e, t) {
|
|
|
230555
230555
|
}
|
|
230556
230556
|
return o.sort((f, l) => l.name.length - f.name.length);
|
|
230557
230557
|
}
|
|
230558
|
-
async function
|
|
230558
|
+
async function qe(e, t, i) {
|
|
230559
230559
|
let n;
|
|
230560
230560
|
if (t?.tsconfig) {
|
|
230561
|
-
let s =
|
|
230562
|
-
n = f.filter((c) => l.some((u) => u.test(
|
|
230563
|
-
} else n = await
|
|
230561
|
+
let s = ie(t.tsconfig, e, "workspace.tsconfig"), f = await Se(e), l = s.map(re);
|
|
230562
|
+
n = f.filter((c) => l.some((u) => u.test(y(import_path3.default.relative(e, c)))));
|
|
230563
|
+
} else n = await Se(e);
|
|
230564
230564
|
let r = [], o = /* @__PURE__ */ new Set();
|
|
230565
230565
|
for (let s = 0; s < n.length; s += 1) {
|
|
230566
|
-
let f = n[s], l =
|
|
230566
|
+
let f = n[s], l = y(f);
|
|
230567
230567
|
if (o.has(l)) continue;
|
|
230568
230568
|
o.add(l);
|
|
230569
|
-
let c = await import_fs4.promises.readFile(f, "utf8"), u = import_typescript2.default.parseConfigFileTextToJson(
|
|
230570
|
-
if (u.error) throw new Error(`Invalid tsconfig ${
|
|
230569
|
+
let c = await import_fs4.promises.readFile(f, "utf8"), u = import_typescript2.default.parseConfigFileTextToJson(y(f), c);
|
|
230570
|
+
if (u.error) throw new Error(`Invalid tsconfig ${y(import_path3.default.relative(e, f))}.`);
|
|
230571
230571
|
let d = u.config?.references;
|
|
230572
|
-
if (Array.isArray(d)) for (let
|
|
230573
|
-
let
|
|
230574
|
-
if (typeof
|
|
230575
|
-
let
|
|
230576
|
-
if (!
|
|
230577
|
-
await import_fs4.promises.stat(
|
|
230572
|
+
if (Array.isArray(d)) for (let x of d) {
|
|
230573
|
+
let h = x && typeof x == "object" ? x.path : void 0;
|
|
230574
|
+
if (typeof h != "string") throw new Error(`${y(import_path3.default.relative(e, f))} references must contain string paths.`);
|
|
230575
|
+
let O = import_path3.default.resolve(import_path3.default.dirname(f), h), F = import_path3.default.extname(O) ? O : import_path3.default.join(O, "tsconfig.json");
|
|
230576
|
+
if (!ye(e, F)) throw new Error("tsconfig references must stay inside the scan root.");
|
|
230577
|
+
await import_fs4.promises.stat(F).then((B) => B.isFile(), () => false) && n.push(F);
|
|
230578
230578
|
}
|
|
230579
|
-
let
|
|
230580
|
-
if (!
|
|
230581
|
-
let
|
|
230582
|
-
if (!(!
|
|
230583
|
-
if (!Array.isArray(
|
|
230584
|
-
r.push({ baseDirectory:
|
|
230579
|
+
let m = u.config?.compilerOptions;
|
|
230580
|
+
if (!m || typeof m != "object") continue;
|
|
230581
|
+
let C = import_path3.default.dirname(f), S = import_path3.default.resolve(C, typeof m.baseUrl == "string" ? m.baseUrl : "."), p = m.paths;
|
|
230582
|
+
if (!(!p || typeof p != "object" || Array.isArray(p))) for (let [x, h] of Object.entries(p)) {
|
|
230583
|
+
if (!Array.isArray(h) || !h.every((O) => typeof O == "string")) throw new Error(`${y(import_path3.default.relative(e, f))} compilerOptions.paths.${x} must be an array of strings.`);
|
|
230584
|
+
r.push({ baseDirectory: S, configDirectory: C, pattern: x, targets: h });
|
|
230585
230585
|
}
|
|
230586
230586
|
}
|
|
230587
230587
|
return r.sort((s, f) => f.configDirectory.length - s.configDirectory.length);
|
|
230588
230588
|
}
|
|
230589
|
-
function
|
|
230590
|
-
if (i.startsWith(".")) return
|
|
230589
|
+
function Ye(e, t, i, n, r, o) {
|
|
230590
|
+
if (i.startsWith(".")) return Z(import_path3.default.posix.join(import_path3.default.posix.dirname(t), i), n);
|
|
230591
230591
|
for (let c of o) {
|
|
230592
230592
|
let u = import_path3.default.dirname(import_path3.default.resolve(e, t)), d = import_path3.default.relative(c.configDirectory, u);
|
|
230593
230593
|
if (c.configDirectory !== e && (d.startsWith("..") || import_path3.default.isAbsolute(d))) continue;
|
|
230594
|
-
let
|
|
230595
|
-
if (
|
|
230596
|
-
let
|
|
230597
|
-
if (
|
|
230598
|
-
let
|
|
230599
|
-
if (
|
|
230594
|
+
let m = ne(c.pattern, i);
|
|
230595
|
+
if (m !== void 0) for (let C of c.targets) {
|
|
230596
|
+
let S = C.replace("*", m), p = y(import_path3.default.relative(e, import_path3.default.resolve(c.baseDirectory, S)));
|
|
230597
|
+
if (p.startsWith("../") || import_path3.default.isAbsolute(p)) continue;
|
|
230598
|
+
let x = Z(p, n);
|
|
230599
|
+
if (x) return x;
|
|
230600
230600
|
}
|
|
230601
230601
|
}
|
|
230602
230602
|
let s = r.find((c) => i === c.name || i.startsWith(`${c.name}/`));
|
|
230603
230603
|
if (!s) return;
|
|
230604
|
-
let f = i === s.name ? "" : i.slice(s.name.length + 1), l =
|
|
230604
|
+
let f = i === s.name ? "" : i.slice(s.name.length + 1), l = Qe(s, f);
|
|
230605
230605
|
for (let c of l) {
|
|
230606
|
-
let u =
|
|
230606
|
+
let u = Z(c, n);
|
|
230607
230607
|
if (u) return u;
|
|
230608
230608
|
}
|
|
230609
230609
|
}
|
|
230610
|
-
function
|
|
230610
|
+
function Qe(e, t) {
|
|
230611
230611
|
let i = e.directory === "." ? "" : `${e.directory}/`, n = /* @__PURE__ */ new Set(), r = (o) => {
|
|
230612
230612
|
let s = o.replace(/^\.\//, "");
|
|
230613
230613
|
n.add(`${i}${s}`), s.startsWith("dist/") && n.add(`${i}src/${s.slice(5)}`);
|
|
230614
230614
|
};
|
|
230615
|
-
return
|
|
230615
|
+
return M(e.exports, t ? `./${t}` : ".", r), t ? (r(`src/${t}`), r(t)) : (r("src/index"), r("index")), Array.from(n);
|
|
230616
230616
|
}
|
|
230617
|
-
function
|
|
230617
|
+
function M(e, t, i) {
|
|
230618
230618
|
if (Array.isArray(e)) {
|
|
230619
|
-
for (let r of e)
|
|
230619
|
+
for (let r of e) M(r, t, i);
|
|
230620
230620
|
return;
|
|
230621
230621
|
}
|
|
230622
230622
|
if (typeof e == "string") {
|
|
@@ -230625,36 +230625,36 @@ function _(e, t, i) {
|
|
|
230625
230625
|
}
|
|
230626
230626
|
if (!e || typeof e != "object" || Array.isArray(e)) return;
|
|
230627
230627
|
let n = e;
|
|
230628
|
-
n[t] !== void 0 &&
|
|
230628
|
+
n[t] !== void 0 && M(n[t], ".", i);
|
|
230629
230629
|
for (let [r, o] of Object.entries(n)) {
|
|
230630
|
-
let s =
|
|
230631
|
-
s === void 0 || !r.includes("*") ||
|
|
230630
|
+
let s = ne(r, t);
|
|
230631
|
+
s === void 0 || !r.includes("*") || M(te(o, s), ".", i);
|
|
230632
230632
|
}
|
|
230633
|
-
for (let r of ["source", "types", "import", "default", "node", "require"]) n[r] !== void 0 &&
|
|
230633
|
+
for (let r of ["source", "types", "import", "default", "node", "require"]) n[r] !== void 0 && M(n[r], ".", i);
|
|
230634
230634
|
}
|
|
230635
|
-
function
|
|
230636
|
-
return typeof e == "string" ? e.replaceAll("*", t) : Array.isArray(e) ? e.map((i) =>
|
|
230635
|
+
function te(e, t) {
|
|
230636
|
+
return typeof e == "string" ? e.replaceAll("*", t) : Array.isArray(e) ? e.map((i) => te(i, t)) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([i, n]) => [i, te(n, t)]));
|
|
230637
230637
|
}
|
|
230638
|
-
function
|
|
230639
|
-
let i =
|
|
230638
|
+
function Z(e, t) {
|
|
230639
|
+
let i = y(import_path3.default.posix.normalize(e)).replace(/^\.\//, ""), n = i.replace(/\.(?:[cm]?[jt]sx?)$/, ""), r = [i, n];
|
|
230640
230640
|
for (let o of r) {
|
|
230641
230641
|
if (t.has(o)) return o;
|
|
230642
|
-
for (let s of
|
|
230642
|
+
for (let s of Ve) {
|
|
230643
230643
|
if (t.has(`${o}${s}`)) return `${o}${s}`;
|
|
230644
230644
|
if (t.has(`${o}/index${s}`)) return `${o}/index${s}`;
|
|
230645
230645
|
}
|
|
230646
230646
|
}
|
|
230647
230647
|
}
|
|
230648
|
-
function
|
|
230649
|
-
return e.startsWith(".") || t.some((n) => e === n.name || e.startsWith(`${n.name}/`)) || i.some((n) =>
|
|
230648
|
+
function Ze(e, t, i) {
|
|
230649
|
+
return e.startsWith(".") || t.some((n) => e === n.name || e.startsWith(`${n.name}/`)) || i.some((n) => ne(n.pattern, e) !== void 0);
|
|
230650
230650
|
}
|
|
230651
|
-
function
|
|
230651
|
+
function ne(e, t) {
|
|
230652
230652
|
let i = e.indexOf("*");
|
|
230653
230653
|
if (i < 0) return e === t ? "" : void 0;
|
|
230654
230654
|
let n = e.slice(0, i), r = e.slice(i + 1);
|
|
230655
230655
|
return t.startsWith(n) && t.endsWith(r) ? t.slice(n.length, t.length - r.length) : void 0;
|
|
230656
230656
|
}
|
|
230657
|
-
async function
|
|
230657
|
+
async function et(e, t) {
|
|
230658
230658
|
let i = [];
|
|
230659
230659
|
async function n(r) {
|
|
230660
230660
|
let o = await import_fs4.promises.readdir(r, { withFileTypes: true });
|
|
@@ -230666,7 +230666,7 @@ async function Ze(e, t) {
|
|
|
230666
230666
|
}
|
|
230667
230667
|
return await n(e), i.sort();
|
|
230668
230668
|
}
|
|
230669
|
-
async function
|
|
230669
|
+
async function Se(e) {
|
|
230670
230670
|
let t = [];
|
|
230671
230671
|
async function i(n) {
|
|
230672
230672
|
let r = await import_fs4.promises.readdir(n, { withFileTypes: true });
|
|
@@ -230678,30 +230678,30 @@ async function ge(e) {
|
|
|
230678
230678
|
}
|
|
230679
230679
|
return await i(e), t.sort();
|
|
230680
230680
|
}
|
|
230681
|
-
async function
|
|
230681
|
+
async function be(e, t) {
|
|
230682
230682
|
let i = await import_fs4.promises.readFile(e, "utf8").catch(() => {
|
|
230683
230683
|
});
|
|
230684
230684
|
if (i !== void 0) try {
|
|
230685
230685
|
return JSON.parse(i);
|
|
230686
230686
|
} catch (n) {
|
|
230687
230687
|
if (!t) return;
|
|
230688
|
-
throw new Error(`${
|
|
230688
|
+
throw new Error(`${y(e)} is invalid JSON: ${n instanceof Error ? n.message : n}`);
|
|
230689
230689
|
}
|
|
230690
230690
|
}
|
|
230691
|
-
function
|
|
230691
|
+
function ie(e, t, i) {
|
|
230692
230692
|
return e.map((n) => {
|
|
230693
230693
|
let r = n.startsWith("!") ? n.slice(1) : n;
|
|
230694
|
-
if (!r || import_path3.default.isAbsolute(r) ||
|
|
230694
|
+
if (!r || import_path3.default.isAbsolute(r) || y(r).split("/").includes("..")) throw new Error(`${i} entries must be relative paths inside the scan root.`);
|
|
230695
230695
|
let o = import_path3.default.resolve(t, r.replace(/[?*].*$/, ""));
|
|
230696
|
-
if (!
|
|
230697
|
-
return
|
|
230696
|
+
if (!ye(t, o)) throw new Error(`${i} entries must stay inside the scan root.`);
|
|
230697
|
+
return y(n).replace(/^\.\//, "").replace(/\/$/, "");
|
|
230698
230698
|
});
|
|
230699
230699
|
}
|
|
230700
|
-
function
|
|
230700
|
+
function ye(e, t) {
|
|
230701
230701
|
let i = import_path3.default.relative(e, t);
|
|
230702
230702
|
return i === "" || !i.startsWith("..") && !import_path3.default.isAbsolute(i);
|
|
230703
230703
|
}
|
|
230704
|
-
function
|
|
230704
|
+
function re(e) {
|
|
230705
230705
|
let t = "^";
|
|
230706
230706
|
for (let i = 0; i < e.length; i += 1) {
|
|
230707
230707
|
let n = e[i], r = e[i + 1];
|
|
@@ -230709,117 +230709,121 @@ function ie(e) {
|
|
|
230709
230709
|
}
|
|
230710
230710
|
return new RegExp(`${t}$`);
|
|
230711
230711
|
}
|
|
230712
|
-
function
|
|
230712
|
+
function y(e) {
|
|
230713
230713
|
return e.replaceAll("\\", "/").replace(/^\.\//, "");
|
|
230714
230714
|
}
|
|
230715
|
-
function
|
|
230715
|
+
function tt(e) {
|
|
230716
230716
|
return e.endsWith(".tsx") ? import_typescript2.default.ScriptKind.TSX : e.endsWith(".jsx") ? import_typescript2.default.ScriptKind.JSX : e.endsWith(".js") || e.endsWith(".mjs") || e.endsWith(".cjs") ? import_typescript2.default.ScriptKind.JS : import_typescript2.default.ScriptKind.TS;
|
|
230717
230717
|
}
|
|
230718
|
-
var
|
|
230719
|
-
var
|
|
230720
|
-
var
|
|
230721
|
-
var
|
|
230722
|
-
var
|
|
230718
|
+
var ot = (0, import_util.promisify)(import_child_process.execFile);
|
|
230719
|
+
var oe = /* @__PURE__ */ new Set([".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"]);
|
|
230720
|
+
var Ce = 5e3;
|
|
230721
|
+
var at = 2 * 1024 * 1024;
|
|
230722
|
+
var ct = 50 * 1024 * 1024;
|
|
230723
230723
|
var K = 16;
|
|
230724
|
-
var
|
|
230725
|
-
var
|
|
230726
|
-
var
|
|
230727
|
-
async function
|
|
230724
|
+
var ft = /* @__PURE__ */ new Set([".git", ".next", ".turbo", "coverage", "dist", "node_modules"]);
|
|
230725
|
+
var fe = /\b(?:appendDataSuffix|attributeSendCalls|attributeUserOperation|Attribution\.toDataSuffix|BuilderCodeClientExtension|builderCodeDataSuffix|createAttributionProvider|createAttributionSigner|createDataSuffix|dataSuffix|declareBuilderCodeExtension|ethersBuilderCodeDataSuffix|sendAttributedCalls|useAttributionSuffix|validateUserOperationAttribution|withAttributionSuffix|withDataSuffixCapability|withEthersAttribution|withUserOperationAttribution|withViemDataSuffix)\b/;
|
|
230726
|
+
var Pe = /\b(?:agentTransactionTool|executeTransaction|onchainAction|sendTransactionTool|transactionTool)\b/;
|
|
230727
|
+
async function lt(e) {
|
|
230728
230728
|
De(e.builderCodes);
|
|
230729
|
-
let t = import_path.default.resolve(e.root), i =
|
|
230729
|
+
let t = import_path.default.resolve(e.root), i = ue(e.profile), n = await Q(t, e.baseline), r = await Dt(t, e), o = await Tt(t, r), s = await we(t, o, e.workspace), f = e.changedSince ? Nt(o, s.impactedFiles(await Ft(t, e.changedSince))) : o, l = kt(o, e.builderCodes), c = f.flatMap((d) => Be(d.source, { baseline: n, builderCodes: e.builderCodes, globalEvidence: l, profile: i, relativePath: d.relativePath, rules: e.rules, workspaceGraph: s })), u = jt(c);
|
|
230730
230730
|
return { ok: u.errors === 0, root: t, profile: i, frameworks: Array.from(new Set(f.flatMap((d) => d.frameworks))).sort(), checkedFiles: f.length, transactionPaths: c, summary: u };
|
|
230731
230731
|
}
|
|
230732
|
-
function
|
|
230732
|
+
function Be(e, t) {
|
|
230733
230733
|
De(t.builderCodes);
|
|
230734
|
-
let i = t.relativePath ?? "source.ts", n =
|
|
230734
|
+
let i = t.relativePath ?? "source.ts", n = ue(t.profile), r = import_typescript.default.createSourceFile(i, e, import_typescript.default.ScriptTarget.Latest, true, Te(i)), o = le(e), s = ut(r, e, o), f = /* @__PURE__ */ new Map();
|
|
230735
230735
|
return s.map((l) => {
|
|
230736
|
-
let c = [l.family, l.marker,
|
|
230737
|
-
return f.set(c, u),
|
|
230736
|
+
let c = [l.family, l.marker, Ne(l.node.getText(r))].join(":"), u = (f.get(c) ?? 0) + 1;
|
|
230737
|
+
return f.set(c, u), pt(r, e, l, u, { ...t, profile: n, relativePath: i });
|
|
230738
230738
|
});
|
|
230739
230739
|
}
|
|
230740
|
-
function
|
|
230740
|
+
function le(e) {
|
|
230741
230741
|
let t = /* @__PURE__ */ new Set();
|
|
230742
|
-
return /from\s+["']@privy-io\/react-auth["']|@privy-io\/react-auth/.test(e) && t.add("privy"), /from\s+["']wagmi["']|from\s+["']wagmi\//.test(e) && t.add("wagmi"), /from\s+["']viem["']|from\s+["']viem\//.test(e) && t.add("viem"), /from\s+["']ethers["']|from\s+["']ethers\//.test(e) && t.add("ethers"), /@x402\//.test(e) && t.add("x402"), /\b(?:createAttributionProvider|eth_sendUserOperation|sendAttributedCalls|sendCalls|sendUserOperation|wallet_getCapabilities|wallet_sendCalls|useSendCalls|withDataSuffixCapability|withUserOperationAttribution)\b/.test(e) && t.add("smart-wallet"), /\b(?:window\.ethereum|eth_sendTransaction)\b/.test(e) && t.add("raw-rpc"),
|
|
230742
|
+
return /from\s+["']@privy-io\/react-auth["']|@privy-io\/react-auth/.test(e) && t.add("privy"), /from\s+["']wagmi["']|from\s+["']wagmi\//.test(e) && t.add("wagmi"), /from\s+["']viem["']|from\s+["']viem\//.test(e) && t.add("viem"), /from\s+["']ethers["']|from\s+["']ethers\//.test(e) && t.add("ethers"), /@x402\//.test(e) && t.add("x402"), /\b(?:createAttributionProvider|eth_sendUserOperation|sendAttributedCalls|sendCalls|sendUserOperation|wallet_getCapabilities|wallet_sendCalls|useSendCalls|withDataSuffixCapability|withUserOperationAttribution)\b/.test(e) && t.add("smart-wallet"), /\b(?:window\.ethereum|eth_sendTransaction)\b/.test(e) && t.add("raw-rpc"), Pe.test(e) && t.add("agent"), Array.from(t).sort();
|
|
230743
230743
|
}
|
|
230744
|
-
function
|
|
230744
|
+
function ue(e) {
|
|
230745
230745
|
if (!e) return "ci";
|
|
230746
|
-
if (
|
|
230746
|
+
if (W.includes(e)) return e;
|
|
230747
230747
|
throw new Error(`Unknown scan profile: ${e}`);
|
|
230748
230748
|
}
|
|
230749
|
-
function
|
|
230749
|
+
function ut(e, t, i) {
|
|
230750
230750
|
let n = [], r = /* @__PURE__ */ new Set();
|
|
230751
230751
|
function o(f) {
|
|
230752
230752
|
let l = `${f.node.pos}:${f.marker}:${f.family}`;
|
|
230753
230753
|
r.has(l) || (r.add(l), n.push(f));
|
|
230754
230754
|
}
|
|
230755
230755
|
function s(f) {
|
|
230756
|
-
if (import_typescript.default.isNewExpression(f) &&
|
|
230757
|
-
let l =
|
|
230758
|
-
d && u && o({ family: d, marker: u, node: f, confidence:
|
|
230756
|
+
if (import_typescript.default.isNewExpression(f) && P(f.expression) === "x402Client" && o({ family: "x402", marker: "x402Client", node: f, confidence: "high" }), import_typescript.default.isCallExpression(f)) {
|
|
230757
|
+
let l = Oe(e, f.expression), c = l === "request" ? Mt(f) : void 0, u = c ?? l, d = dt(l, c, t, i);
|
|
230758
|
+
d && u && o({ family: d, marker: u, node: f, confidence: _t(d, i) });
|
|
230759
230759
|
}
|
|
230760
230760
|
import_typescript.default.forEachChild(f, s);
|
|
230761
230761
|
}
|
|
230762
230762
|
return s(e), n.sort((f, l) => f.node.getStart(e) - l.node.getStart(e));
|
|
230763
230763
|
}
|
|
230764
|
-
function
|
|
230764
|
+
function dt(e, t, i, n) {
|
|
230765
230765
|
if (t === "wallet_sendCalls" || t === "eth_sendUserOperation") return "wallet";
|
|
230766
230766
|
if (t === "eth_sendTransaction") return "rpc";
|
|
230767
230767
|
if (e === "paymentMiddleware" || e === "wrapFetchWithPayment") return "x402";
|
|
230768
230768
|
if (e === "sendCalls" || e === "useSendCalls" || e === "sendAttributedCalls" || e === "sendUserOperation") return "wallet";
|
|
230769
|
-
if (!(!e || !["sendTransaction", "writeContract", "prepareTransactionRequest", "sendRawTransaction"].includes(e))) return
|
|
230769
|
+
if (!(!e || !["sendTransaction", "writeContract", "prepareTransactionRequest", "sendRawTransaction"].includes(e))) return Pe.test(i) ? "agent" : n.includes("privy") ? "privy" : n.includes("ethers") ? "ethers" : n.includes("wagmi") ? "wagmi" : n.includes("raw-rpc") ? "rpc" : "viem";
|
|
230770
230770
|
}
|
|
230771
|
-
function
|
|
230772
|
-
let o = e.getLineAndCharacterOfPosition(i.node.getStart(e)), s = i.node.getText(e), f =
|
|
230773
|
-
for (let
|
|
230774
|
-
let d = r.builderCodes.map((
|
|
230775
|
-
|
|
230776
|
-
let
|
|
230777
|
-
|
|
230778
|
-
let
|
|
230779
|
-
return { file: r.relativePath, line: o.line + 1, column: o.character + 1, family: i.family, marker: i.marker, status:
|
|
230771
|
+
function pt(e, t, i, n, r) {
|
|
230772
|
+
let o = e.getLineAndCharacterOfPosition(i.node.getStart(e)), s = i.node.getText(e), f = ht(i), l = z(e, f, false), c = z(e, f, true), u = i.family === "x402" ? xt(e, i) : { found: false, literals: /* @__PURE__ */ new Set() };
|
|
230773
|
+
for (let w of u.literals) c.literals.add(w);
|
|
230774
|
+
let d = r.builderCodes.map((w) => createDataSuffix({ codes: [w] }).slice(2).toLowerCase()), m = ce(l.literals), C = ce(c.literals), S = r.builderCodes.some((w) => l.literals.has(w)), p = r.builderCodes.some((w) => c.literals.has(w)), x = d.some((w) => Array.from(c.literals).some((_e) => _e.toLowerCase().replace(/^0x/, "").endsWith(w))), h = m.find((w) => !r.builderCodes.includes(w)), O = C.find((w) => !r.builderCodes.includes(w)), F = c.untrustedHelper, B = mt(i, s, t, u.found), U = r.globalEvidence?.filter((w) => w.family === i.family) ?? [], pe = U.find((w) => Ae(e, i, w, r.builderCodes, r.workspaceGraph)), We = U.find((w) => w.expected && Ae(e, i, w, r.builderCodes, r.workspaceGraph)), L = pe ?? U.find((w) => w.expected) ?? U[0], Y = [];
|
|
230775
|
+
B ? Y.push({ kind: B.kind, detail: B.detail, file: r.relativePath, line: o.line + 1 }) : L && Y.push(L.evidence);
|
|
230776
|
+
let k, $, R, j, D = i.confidence, me = h ?? (B ? O : void 0) ?? pe?.wrongCode;
|
|
230777
|
+
F ? (k = "unresolved", $ = "BAO003", R = `${i.marker} uses a locally implemented attribution helper whose output cannot be verified statically.`, j = "Use an imported attribution helper or supply a verifiable encoded suffix.", D = "medium") : me && !S && !x ? (k = "wrong-code", $ = "BAO002", R = `${i.marker} uses ${me}, which is not configured for this project.`, j = "Replace it with a Builder Code from bao.config.json.") : B && (S || p || x) ? (k = "protected", R = `${i.marker} is protected by Builder Code attribution.`, D = S ? "high" : "medium") : We || L?.expected && i.family === "privy" && r.profile !== "strict" ? (k = "protected", R = `${i.marker} is covered by statically linked project-level attribution evidence.`, D = "medium") : L?.expected ? (k = "unresolved", $ = "BAO004", R = `${i.marker} has project-level Builder Code configuration, but this call site is not statically linked to it.`, j = "Pass dataSuffix at this call site or expose an import path the scanner can verify.", D = "medium") : B || L?.dynamic ? (k = "unresolved", $ = "BAO003", R = `${i.marker} uses dynamic attribution that cannot be matched to a configured Builder Code.`, j = "Expose the configured Builder Code to CI or use strict-verifiable configuration.", D = "medium") : (k = "missing", $ = $t(i.family), R = Rt(i), j = It(i.family));
|
|
230778
|
+
let Me = Ot(k, $, r.profile, r.rules), ge = Ut($ ?? "protected", r.relativePath, i.family, i.marker, Ne(s), n), ze = r.baseline?.has(ge) ?? false;
|
|
230779
|
+
return { file: r.relativePath, line: o.line + 1, column: o.character + 1, family: i.family, marker: i.marker, status: k, ruleId: $, message: R, suggestion: j, evidence: Y, confidence: D, severity: Me, fingerprint: ge, baseline: ze };
|
|
230780
230780
|
}
|
|
230781
|
-
function
|
|
230781
|
+
function mt(e, t, i, n = false) {
|
|
230782
230782
|
if (e.family === "x402") {
|
|
230783
230783
|
let r = (e.marker === "x402Client" || e.marker === "wrapFetchWithPayment") && n, o = e.marker === "paymentMiddleware" && /\bdeclareBuilderCodeExtension\s*\(/.test(i);
|
|
230784
230784
|
return r || o ? { kind: "helper", detail: "official x402 Builder Code extension" } : void 0;
|
|
230785
230785
|
}
|
|
230786
|
-
if (e.family === "wallet") return /\b(?:attributeUserOperation|sendAttributedCalls|withDataSuffixCapability|withUserOperationAttribution)\b/.test(t) || /\b(?:attributeUserOperation|createAttributionProvider|withDataSuffixCapability|withUserOperationAttribution)\b/.test(i) ? { kind: "helper", detail: "Smart Wallet Attribution Kit middleware" } : /\bcapabilities\b[\s\S]*\bdataSuffix\b/.test(t) && /\bwallet_getCapabilities\b/.test(i) &&
|
|
230786
|
+
if (e.family === "wallet") return /\b(?:attributeUserOperation|sendAttributedCalls|withDataSuffixCapability|withUserOperationAttribution)\b/.test(t) || /\b(?:attributeUserOperation|createAttributionProvider|withDataSuffixCapability|withUserOperationAttribution)\b/.test(i) ? { kind: "helper", detail: "Smart Wallet Attribution Kit middleware" } : /\bcapabilities\b[\s\S]*\bdataSuffix\b/.test(t) && /\bwallet_getCapabilities\b/.test(i) && zt(e.node) ? { kind: "config", detail: "negotiated EIP-5792 dataSuffix capability" } : void 0;
|
|
230787
230787
|
if (/\bdataSuffix\b/.test(t)) return { kind: "config", detail: "transaction dataSuffix" };
|
|
230788
|
-
if (
|
|
230788
|
+
if (fe.test(t)) return { kind: "helper", detail: "Builder Code attribution helper" };
|
|
230789
230789
|
if (/\bdata\b\s*:\s*[^,}\n]+(?:suffix|Suffix|DATA_SUFFIX)/.test(t)) return { kind: "suffix", detail: "suffix appended to transaction calldata" };
|
|
230790
230790
|
}
|
|
230791
|
-
function
|
|
230792
|
-
let i = { identifiers: /* @__PURE__ */ new Set(), literals: /* @__PURE__ */ new Set(), memberAccesses: /* @__PURE__ */ new Set() }, n =
|
|
230791
|
+
function ae(e, t) {
|
|
230792
|
+
let i = { identifiers: /* @__PURE__ */ new Set(), literals: /* @__PURE__ */ new Set(), memberAccesses: /* @__PURE__ */ new Set() }, n = _(e), r = /* @__PURE__ */ new Set();
|
|
230793
230793
|
function o(s) {
|
|
230794
|
-
if (
|
|
230794
|
+
if ($e(s) && i.literals.add(s.text), import_typescript.default.isIdentifier(s) && H(s)) {
|
|
230795
230795
|
i.identifiers.add(s.text);
|
|
230796
|
-
let f =
|
|
230796
|
+
let f = I(n, s.text, s.getStart(e)), l = f ? J(f.node) : void 0;
|
|
230797
230797
|
l && !r.has(l) && (r.add(l), o(l));
|
|
230798
230798
|
}
|
|
230799
230799
|
import_typescript.default.isPropertyAccessExpression(s) && i.memberAccesses.add(s.getText(e)), import_typescript.default.forEachChild(s, o);
|
|
230800
230800
|
}
|
|
230801
230801
|
return o(t), i;
|
|
230802
230802
|
}
|
|
230803
|
-
function
|
|
230804
|
-
let n = { identifiers: /* @__PURE__ */ new Set(), literals: /* @__PURE__ */ new Set(), memberAccesses: /* @__PURE__ */ new Set() }, r =
|
|
230803
|
+
function z(e, t, i) {
|
|
230804
|
+
let n = { identifiers: /* @__PURE__ */ new Set(), literals: /* @__PURE__ */ new Set(), memberAccesses: /* @__PURE__ */ new Set() }, r = _(e), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(["appDataSuffix", "capabilities", "codes", "dataSuffix", "value", "walletCodes"]);
|
|
230805
230805
|
function f(l) {
|
|
230806
|
-
if (
|
|
230806
|
+
if ($e(l) && n.literals.add(l.text), import_typescript.default.isPropertyAccessExpression(l) && n.memberAccesses.add(l.getText(e)), import_typescript.default.isIdentifier(l) && H(l)) {
|
|
230807
230807
|
if (n.identifiers.add(l.text), i) {
|
|
230808
|
-
let c =
|
|
230808
|
+
let c = I(r, l.text, l.getStart(e)), u = c ? J(c.node) : void 0;
|
|
230809
230809
|
u && !o.has(u) && (o.add(u), f(u));
|
|
230810
230810
|
}
|
|
230811
230811
|
return;
|
|
230812
230812
|
}
|
|
230813
230813
|
if (import_typescript.default.isObjectLiteralExpression(l)) {
|
|
230814
230814
|
for (let c of l.properties) {
|
|
230815
|
-
let u = import_typescript.default.isPropertyAssignment(c) || import_typescript.default.isShorthandPropertyAssignment(c) ?
|
|
230815
|
+
let u = import_typescript.default.isPropertyAssignment(c) || import_typescript.default.isShorthandPropertyAssignment(c) ? A(c.name) : void 0;
|
|
230816
230816
|
!u || !s.has(u) || (import_typescript.default.isPropertyAssignment(c) ? f(c.initializer) : import_typescript.default.isShorthandPropertyAssignment(c) && f(c.name));
|
|
230817
230817
|
}
|
|
230818
230818
|
return;
|
|
230819
230819
|
}
|
|
230820
230820
|
if (import_typescript.default.isCallExpression(l) || import_typescript.default.isNewExpression(l)) {
|
|
230821
|
-
let c =
|
|
230822
|
-
|
|
230821
|
+
let c = P(l.expression);
|
|
230822
|
+
if (c && (fe.test(c) || c === "toDataSuffix") && V(l.expression, r)) {
|
|
230823
|
+
n.untrustedHelper = true;
|
|
230824
|
+
return;
|
|
230825
|
+
}
|
|
230826
|
+
for (let u of gt(c, l.arguments ?? [])) f(u);
|
|
230823
230827
|
return;
|
|
230824
230828
|
}
|
|
230825
230829
|
import_typescript.default.forEachChild(l, f);
|
|
@@ -230827,7 +230831,7 @@ function N(e, t, i) {
|
|
|
230827
230831
|
for (let l of t) f(l);
|
|
230828
230832
|
return n;
|
|
230829
230833
|
}
|
|
230830
|
-
function
|
|
230834
|
+
function gt(e, t) {
|
|
230831
230835
|
switch (e) {
|
|
230832
230836
|
case "appendDataSuffix":
|
|
230833
230837
|
case "attributeSendCalls":
|
|
@@ -230858,26 +230862,26 @@ function mt(e, t) {
|
|
|
230858
230862
|
return [];
|
|
230859
230863
|
}
|
|
230860
230864
|
}
|
|
230861
|
-
function
|
|
230862
|
-
let t = [], i = /* @__PURE__ */ new Set(), n = e.node.getSourceFile(), r =
|
|
230865
|
+
function ht(e) {
|
|
230866
|
+
let t = [], i = /* @__PURE__ */ new Set(), n = e.node.getSourceFile(), r = _(n), o = /* @__PURE__ */ new Set();
|
|
230863
230867
|
function s(c) {
|
|
230864
230868
|
i.has(c) || (i.add(c), t.push(c));
|
|
230865
230869
|
}
|
|
230866
230870
|
if (e.marker === "sendAttributedCalls") return s(e.node), t;
|
|
230867
230871
|
function f(c) {
|
|
230868
|
-
if (import_typescript.default.isCallExpression(c) &&
|
|
230872
|
+
if (import_typescript.default.isCallExpression(c) && P(c.expression) === "declareBuilderCodeExtension") {
|
|
230869
230873
|
s(c);
|
|
230870
230874
|
return;
|
|
230871
230875
|
}
|
|
230872
230876
|
import_typescript.default.forEachChild(c, f);
|
|
230873
230877
|
}
|
|
230874
230878
|
function l(c) {
|
|
230875
|
-
if (import_typescript.default.isIdentifier(c) &&
|
|
230876
|
-
let u =
|
|
230879
|
+
if (import_typescript.default.isIdentifier(c) && H(c)) {
|
|
230880
|
+
let u = I(r, c.text, c.getStart(n)), d = u ? J(u.node) : void 0;
|
|
230877
230881
|
d && !o.has(d) && (o.add(d), l(d));
|
|
230878
230882
|
return;
|
|
230879
230883
|
}
|
|
230880
|
-
if (import_typescript.default.isPropertyAssignment(c) &&
|
|
230884
|
+
if (import_typescript.default.isPropertyAssignment(c) && A(c.name) === "dataSuffix") {
|
|
230881
230885
|
s(c.initializer);
|
|
230882
230886
|
return;
|
|
230883
230887
|
}
|
|
@@ -230885,19 +230889,19 @@ function gt(e) {
|
|
|
230885
230889
|
s(c.name);
|
|
230886
230890
|
return;
|
|
230887
230891
|
}
|
|
230888
|
-
if (e.family === "x402" && import_typescript.default.isPropertyAssignment(c) &&
|
|
230892
|
+
if (e.family === "x402" && import_typescript.default.isPropertyAssignment(c) && A(c.name) === "extensions") {
|
|
230889
230893
|
f(c.initializer);
|
|
230890
230894
|
return;
|
|
230891
230895
|
}
|
|
230892
|
-
if (e.marker === "eth_sendUserOperation" && import_typescript.default.isPropertyAssignment(c) &&
|
|
230896
|
+
if (e.marker === "eth_sendUserOperation" && import_typescript.default.isPropertyAssignment(c) && A(c.name) === "params" && import_typescript.default.isArrayLiteralExpression(c.initializer) && c.initializer.elements[0]) {
|
|
230893
230897
|
s(c.initializer.elements[0]);
|
|
230894
230898
|
return;
|
|
230895
230899
|
}
|
|
230896
|
-
if (import_typescript.default.isPropertyAssignment(c) &&
|
|
230900
|
+
if (import_typescript.default.isPropertyAssignment(c) && A(c.name) === "data" && /(?:suffix|Suffix|DATA_SUFFIX)/.test(c.initializer.getText())) {
|
|
230897
230901
|
s(c.initializer);
|
|
230898
230902
|
return;
|
|
230899
230903
|
}
|
|
230900
|
-
if (import_typescript.default.isPropertyAssignment(c) && (
|
|
230904
|
+
if (import_typescript.default.isPropertyAssignment(c) && (A(c.name) === "capabilities" || A(c.name) === "params")) {
|
|
230901
230905
|
l(c.initializer);
|
|
230902
230906
|
return;
|
|
230903
230907
|
}
|
|
@@ -230906,8 +230910,8 @@ function gt(e) {
|
|
|
230906
230910
|
return;
|
|
230907
230911
|
}
|
|
230908
230912
|
if (import_typescript.default.isCallExpression(c) && c !== e.node) {
|
|
230909
|
-
let u =
|
|
230910
|
-
u &&
|
|
230913
|
+
let u = P(c.expression);
|
|
230914
|
+
u && fe.test(u) && s(c);
|
|
230911
230915
|
return;
|
|
230912
230916
|
}
|
|
230913
230917
|
if (import_typescript.default.isObjectLiteralExpression(c)) {
|
|
@@ -230919,27 +230923,27 @@ function gt(e) {
|
|
|
230919
230923
|
if (import_typescript.default.isCallExpression(e.node)) for (let c of e.node.arguments) l(c);
|
|
230920
230924
|
return t;
|
|
230921
230925
|
}
|
|
230922
|
-
function
|
|
230926
|
+
function _(e) {
|
|
230923
230927
|
let t = [];
|
|
230924
230928
|
function i(r, o) {
|
|
230925
230929
|
if (import_typescript.default.isIdentifier(r)) {
|
|
230926
|
-
t.push({ name: r.text, node: o, scope:
|
|
230930
|
+
t.push({ name: r.text, node: o, scope: Ee(o, e) });
|
|
230927
230931
|
return;
|
|
230928
230932
|
}
|
|
230929
230933
|
for (let s of r.elements) import_typescript.default.isBindingElement(s) && i(s.name, o);
|
|
230930
230934
|
}
|
|
230931
230935
|
function n(r) {
|
|
230932
|
-
import_typescript.default.isVariableDeclaration(r) || import_typescript.default.isParameter(r) ? i(r.name, r) : import_typescript.default.isFunctionDeclaration(r) && r.name ? t.push({ name: r.name.text, node: r, scope:
|
|
230936
|
+
import_typescript.default.isVariableDeclaration(r) || import_typescript.default.isParameter(r) ? i(r.name, r) : (import_typescript.default.isFunctionDeclaration(r) || import_typescript.default.isClassDeclaration(r)) && r.name ? t.push({ name: r.name.text, node: r, scope: Ee(r, e) }) : import_typescript.default.isImportClause(r) && r.name ? t.push({ name: r.name.text, node: r, scope: e }) : import_typescript.default.isImportSpecifier(r) ? t.push({ name: r.name.text, node: r, scope: e }) : import_typescript.default.isNamespaceImport(r) && t.push({ name: r.name.text, node: r, scope: e }), import_typescript.default.forEachChild(r, n);
|
|
230933
230937
|
}
|
|
230934
230938
|
return n(e), t;
|
|
230935
230939
|
}
|
|
230936
|
-
function
|
|
230940
|
+
function I(e, t, i) {
|
|
230937
230941
|
return e.filter((n) => {
|
|
230938
230942
|
let r = n.scope.getStart(), o = n.scope.getEnd(), s = import_typescript.default.isFunctionDeclaration(n.node) || import_typescript.default.isImportClause(n.node) || import_typescript.default.isImportSpecifier(n.node) || import_typescript.default.isNamespaceImport(n.node);
|
|
230939
230943
|
return n.name === t && r <= i && i <= o && (s || n.node.getStart() <= i);
|
|
230940
230944
|
}).sort((n, r) => n.scope.getEnd() - n.scope.getStart() - (r.scope.getEnd() - r.scope.getStart()) || r.node.getStart() - n.node.getStart())[0];
|
|
230941
230945
|
}
|
|
230942
|
-
function
|
|
230946
|
+
function Ee(e, t) {
|
|
230943
230947
|
let i = e.parent;
|
|
230944
230948
|
for (; i && i !== t; ) {
|
|
230945
230949
|
if (import_typescript.default.isBlock(i) || import_typescript.default.isFunctionLike(i) || import_typescript.default.isModuleBlock(i)) return i;
|
|
@@ -230947,47 +230951,47 @@ function we(e, t) {
|
|
|
230947
230951
|
}
|
|
230948
230952
|
return t;
|
|
230949
230953
|
}
|
|
230950
|
-
function
|
|
230954
|
+
function J(e) {
|
|
230951
230955
|
if (import_typescript.default.isVariableDeclaration(e) || import_typescript.default.isParameter(e)) return e.initializer;
|
|
230952
230956
|
if (import_typescript.default.isFunctionDeclaration(e)) return e.body;
|
|
230953
230957
|
}
|
|
230954
|
-
function
|
|
230958
|
+
function H(e) {
|
|
230955
230959
|
let t = e.parent;
|
|
230956
230960
|
return !(import_typescript.default.isPropertyAccessExpression(t) && t.name === e || import_typescript.default.isPropertyAssignment(t) && t.name === e || import_typescript.default.isMethodDeclaration(t) && t.name === e || import_typescript.default.isVariableDeclaration(t) && t.name === e || import_typescript.default.isParameter(t) && t.name === e || import_typescript.default.isBindingElement(t) && t.name === e || import_typescript.default.isFunctionDeclaration(t) && t.name === e || import_typescript.default.isImportClause(t) || import_typescript.default.isImportSpecifier(t) || import_typescript.default.isNamespaceImport(t) || import_typescript.default.isJsxAttribute(t) && t.name === e);
|
|
230957
230961
|
}
|
|
230958
|
-
function
|
|
230962
|
+
function $e(e) {
|
|
230959
230963
|
if (!import_typescript.default.isStringLiteral(e) && !import_typescript.default.isNoSubstitutionTemplateLiteral(e)) return false;
|
|
230960
230964
|
let t = e.parent;
|
|
230961
230965
|
return !(import_typescript.default.isPropertyAssignment(t) && t.name === e || import_typescript.default.isMethodDeclaration(t) && t.name === e || import_typescript.default.isImportDeclaration(t) && t.moduleSpecifier === e || import_typescript.default.isExportDeclaration(t) && t.moduleSpecifier === e);
|
|
230962
230966
|
}
|
|
230963
|
-
function
|
|
230964
|
-
let i = /* @__PURE__ */ new Set(), n = false, r =
|
|
230967
|
+
function xt(e, t) {
|
|
230968
|
+
let i = /* @__PURE__ */ new Set(), n = false, r = _(e), o = /* @__PURE__ */ new Set(), s = t.node;
|
|
230965
230969
|
for (; s && s !== e; ) {
|
|
230966
230970
|
if (import_typescript.default.isVariableDeclaration(s) && import_typescript.default.isIdentifier(s.name)) {
|
|
230967
|
-
import_typescript.default.isNewExpression(t.node) &&
|
|
230971
|
+
import_typescript.default.isNewExpression(t.node) && P(t.node.expression) === "x402Client" && o.add(s);
|
|
230968
230972
|
break;
|
|
230969
230973
|
}
|
|
230970
230974
|
s = s.parent;
|
|
230971
230975
|
}
|
|
230972
230976
|
function f(u, d = []) {
|
|
230973
230977
|
if (d.includes(u.node)) return false;
|
|
230974
|
-
let
|
|
230975
|
-
if (
|
|
230976
|
-
for (let
|
|
230978
|
+
let m = J(u.node), C = [...d, u.node];
|
|
230979
|
+
if (m && import_typescript.default.isNewExpression(m) && P(m.expression) === "x402Client") {
|
|
230980
|
+
for (let S of C) o.add(S);
|
|
230977
230981
|
return true;
|
|
230978
230982
|
}
|
|
230979
|
-
if (
|
|
230980
|
-
let
|
|
230981
|
-
if (
|
|
230982
|
-
for (let
|
|
230983
|
+
if (m && import_typescript.default.isIdentifier(m)) {
|
|
230984
|
+
let S = I(r, m.text, m.getStart(e));
|
|
230985
|
+
if (S && f(S, C)) {
|
|
230986
|
+
for (let p of C) o.add(p);
|
|
230983
230987
|
return true;
|
|
230984
230988
|
}
|
|
230985
230989
|
}
|
|
230986
230990
|
return false;
|
|
230987
230991
|
}
|
|
230988
230992
|
function l(u) {
|
|
230989
|
-
if (import_typescript.default.isIdentifier(u) &&
|
|
230990
|
-
let d =
|
|
230993
|
+
if (import_typescript.default.isIdentifier(u) && H(u)) {
|
|
230994
|
+
let d = I(r, u.text, u.getStart(e));
|
|
230991
230995
|
d && f(d);
|
|
230992
230996
|
}
|
|
230993
230997
|
import_typescript.default.forEachChild(u, l);
|
|
@@ -230995,28 +230999,28 @@ function ht(e, t) {
|
|
|
230995
230999
|
l(t.node);
|
|
230996
231000
|
function c(u) {
|
|
230997
231001
|
if (import_typescript.default.isCallExpression(u) && import_typescript.default.isPropertyAccessExpression(u.expression) && u.expression.name.text === "registerExtension" && import_typescript.default.isIdentifier(u.expression.expression)) {
|
|
230998
|
-
let d =
|
|
231002
|
+
let d = I(r, u.expression.expression.text, u.expression.expression.getStart(e));
|
|
230999
231003
|
if (d && o.has(d.node)) {
|
|
231000
231004
|
n = true;
|
|
231001
|
-
for (let
|
|
231005
|
+
for (let m of z(e, [u], true).literals) i.add(m);
|
|
231002
231006
|
}
|
|
231003
231007
|
}
|
|
231004
231008
|
import_typescript.default.forEachChild(u, c);
|
|
231005
231009
|
}
|
|
231006
231010
|
return c(e), { found: n, literals: i };
|
|
231007
231011
|
}
|
|
231008
|
-
function
|
|
231012
|
+
function St(e) {
|
|
231009
231013
|
let t = [], i = /* @__PURE__ */ new Set(["attributeUserOperation", "builderCodeDataSuffix", "createAttributionProvider", "createAttributionSigner", "dataSuffix", "declareBuilderCodeExtension", "registerExtension", "withDataSuffixCapability", "withUserOperationAttribution", "withAttributionSuffix", "withViemDataSuffix"]);
|
|
231010
231014
|
function n(r) {
|
|
231011
231015
|
if (import_typescript.default.isCallExpression(r)) {
|
|
231012
|
-
let o =
|
|
231016
|
+
let o = P(r.expression);
|
|
231013
231017
|
(o && i.has(o) || (o === "createWalletClient" || o === "createConfig") && /\bdataSuffix\b/.test(r.getText(e))) && t.push(r);
|
|
231014
|
-
} else import_typescript.default.isNewExpression(r) &&
|
|
231018
|
+
} else import_typescript.default.isNewExpression(r) && P(r.expression) === "BuilderCodeClientExtension" && t.push(r);
|
|
231015
231019
|
import_typescript.default.forEachChild(r, n);
|
|
231016
231020
|
}
|
|
231017
231021
|
return n(e), t.sort((r, o) => r.getStart(e) - o.getStart(e));
|
|
231018
231022
|
}
|
|
231019
|
-
function
|
|
231023
|
+
function se(e) {
|
|
231020
231024
|
let t = e;
|
|
231021
231025
|
for (; t; ) {
|
|
231022
231026
|
if (import_typescript.default.isVariableDeclaration(t) && import_typescript.default.isIdentifier(t.name)) {
|
|
@@ -231030,16 +231034,16 @@ function bt(e) {
|
|
|
231030
231034
|
}
|
|
231031
231035
|
return [];
|
|
231032
231036
|
}
|
|
231033
|
-
function
|
|
231034
|
-
if (t.family === "privy" &&
|
|
231037
|
+
function Ae(e, t, i, n, r) {
|
|
231038
|
+
if (t.family === "privy" && wt(e, t, i, n, r)) return true;
|
|
231035
231039
|
if (!r) return false;
|
|
231036
|
-
let o =
|
|
231040
|
+
let o = ae(e, t.node), s = r.linkedBindings(e.fileName, i.evidence.file, i.exportedBindings);
|
|
231037
231041
|
return Array.from(s).some((f) => f.includes(".") ? o.memberAccesses.has(f) : o.identifiers.has(f));
|
|
231038
231042
|
}
|
|
231039
|
-
function
|
|
231040
|
-
let o =
|
|
231041
|
-
if (!
|
|
231042
|
-
let s =
|
|
231043
|
+
function wt(e, t, i, n, r) {
|
|
231044
|
+
let o = ae(e, t.node);
|
|
231045
|
+
if (!At(e, o)) return false;
|
|
231046
|
+
let s = bt(t.node), f = Et(e, i);
|
|
231043
231047
|
for (let u of r?.linkedBindings(e.fileName, i.evidence.file, i.exportedBindings) ?? []) f.add(u);
|
|
231044
231048
|
let l = false;
|
|
231045
231049
|
function c(u) {
|
|
@@ -231047,17 +231051,17 @@ function St(e, t, i, n, r) {
|
|
|
231047
231051
|
import_typescript.default.forEachChild(u, c);
|
|
231048
231052
|
return;
|
|
231049
231053
|
}
|
|
231050
|
-
let d = u.openingElement.attributes.properties.find((
|
|
231051
|
-
if (!
|
|
231054
|
+
let d = u.openingElement.attributes.properties.find((h) => import_typescript.default.isJsxAttribute(h) && h.name.getText(e) === "config"), m = d?.initializer && import_typescript.default.isJsxExpression(d.initializer) ? d.initializer.expression : void 0;
|
|
231055
|
+
if (!m) {
|
|
231052
231056
|
import_typescript.default.forEachChild(u, c);
|
|
231053
231057
|
return;
|
|
231054
231058
|
}
|
|
231055
|
-
let
|
|
231056
|
-
l =
|
|
231059
|
+
let C = ae(e, m), S = z(e, [m], true), p = v(i.evidence.file) === v(e.fileName) && n.some((h) => S.literals.has(h)) || Array.from(f).some((h) => h.includes(".") ? C.memberAccesses.has(h) : C.identifiers.has(h)), x = t.node.getStart(e) >= u.getStart(e) && t.node.getEnd() <= u.getEnd() || (s ? yt(u, s, e) : false);
|
|
231060
|
+
l = p && x, l || import_typescript.default.forEachChild(u, c);
|
|
231057
231061
|
}
|
|
231058
231062
|
return c(e), l;
|
|
231059
231063
|
}
|
|
231060
|
-
function
|
|
231064
|
+
function bt(e) {
|
|
231061
231065
|
let t = e.parent;
|
|
231062
231066
|
for (; t; ) {
|
|
231063
231067
|
if (import_typescript.default.isFunctionDeclaration(t) && t.name) return t.name.text;
|
|
@@ -231082,10 +231086,10 @@ function yt(e, t, i) {
|
|
|
231082
231086
|
function Ct(e) {
|
|
231083
231087
|
return import_typescript.default.isIdentifier(e.tagName) ? e.tagName.text : e.tagName.getText();
|
|
231084
231088
|
}
|
|
231085
|
-
function
|
|
231089
|
+
function Et(e, t) {
|
|
231086
231090
|
let i = /* @__PURE__ */ new Set(), n = new Set(t.exportedBindings);
|
|
231087
231091
|
for (let r of e.statements) {
|
|
231088
|
-
if (!import_typescript.default.isImportDeclaration(r) || !import_typescript.default.isStringLiteral(r.moduleSpecifier) || !r.importClause || !
|
|
231092
|
+
if (!import_typescript.default.isImportDeclaration(r) || !import_typescript.default.isStringLiteral(r.moduleSpecifier) || !r.importClause || !vt(e.fileName, r.moduleSpecifier.text, t.evidence.file)) continue;
|
|
231089
231093
|
r.importClause.name && n.has("default") && i.add(r.importClause.name.text);
|
|
231090
231094
|
let o = r.importClause.namedBindings;
|
|
231091
231095
|
if (o && import_typescript.default.isNamespaceImport(o)) for (let s of n) s !== "default" && i.add(`${o.name.text}.${s}`);
|
|
@@ -231096,7 +231100,7 @@ function At(e, t) {
|
|
|
231096
231100
|
}
|
|
231097
231101
|
return i;
|
|
231098
231102
|
}
|
|
231099
|
-
function
|
|
231103
|
+
function At(e, t) {
|
|
231100
231104
|
let i = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
231101
231105
|
for (let r of e.statements) {
|
|
231102
231106
|
if (!import_typescript.default.isImportDeclaration(r) || !import_typescript.default.isStringLiteral(r.moduleSpecifier) || r.moduleSpecifier.text !== "@privy-io/react-auth" || !r.importClause?.namedBindings) continue;
|
|
@@ -231112,25 +231116,22 @@ function vt(e, t) {
|
|
|
231112
231116
|
}
|
|
231113
231117
|
return Array.from(i).some((r) => t.identifiers.has(r)) || Array.from(n).some((r) => t.memberAccesses.has(r));
|
|
231114
231118
|
}
|
|
231115
|
-
function
|
|
231119
|
+
function vt(e, t, i) {
|
|
231116
231120
|
if (!t.startsWith(".")) return false;
|
|
231117
|
-
let n =
|
|
231118
|
-
return
|
|
231121
|
+
let n = v(import_path.default.posix.normalize(import_path.default.posix.join(import_path.default.posix.dirname(v(e)), t)));
|
|
231122
|
+
return ve(n) === ve(v(i));
|
|
231119
231123
|
}
|
|
231120
|
-
function
|
|
231124
|
+
function ve(e) {
|
|
231121
231125
|
return e.replace(/\.(?:[cm]?[jt]sx?)$/, "").replace(/\/index$/, "");
|
|
231122
231126
|
}
|
|
231123
231127
|
function kt(e, t) {
|
|
231124
231128
|
let i = [];
|
|
231125
231129
|
for (let n of e) {
|
|
231126
231130
|
if (!Bt(n.source)) continue;
|
|
231127
|
-
let r = import_typescript.default.createSourceFile(n.relativePath, n.source, import_typescript.default.ScriptTarget.Latest, true,
|
|
231131
|
+
let r = import_typescript.default.createSourceFile(n.relativePath, n.source, import_typescript.default.ScriptTarget.Latest, true, Te(n.relativePath)), o = St(r);
|
|
231128
231132
|
if (o.length === 0) continue;
|
|
231129
|
-
let
|
|
231130
|
-
|
|
231131
|
-
return t.some((h) => x.has(h));
|
|
231132
|
-
}).length > 0, c = Array.from(new Set(o.flatMap((g) => oe(N(r, [g], true).literals)))).find((g) => !t.includes(g)), u = Array.from(new Set(o.flatMap((g) => bt(g)))), d = r.getLineAndCharacterOfPosition(o[0].getStart(r)).line + 1, p = Pt(n);
|
|
231133
|
-
for (let g of p) i.push({ family: g, expected: f, dynamic: !f, exportedBindings: u, wrongCode: c, evidence: { kind: "config", detail: "project-level attribution configuration", file: n.relativePath, line: d } });
|
|
231133
|
+
let s = o.map((p) => ({ node: p, syntax: z(r, [p], true) })), f = new Set(s.flatMap(({ node: p, syntax: x }) => x.untrustedHelper ? se(p) : [])), l = s.filter(({ node: p, syntax: x }) => !x.untrustedHelper && !se(p).some((h) => f.has(h)) && t.some((h) => x.literals.has(h))).map(({ node: p }) => p), c = l.length > 0, d = Array.from(new Set(s.flatMap(({ syntax: p }) => ce(p.literals)))).find((p) => !t.includes(p)), m = Array.from(new Set((c ? l : o).flatMap((p) => se(p)))), C = r.getLineAndCharacterOfPosition(o[0].getStart(r)).line + 1, S = Pt(n);
|
|
231134
|
+
for (let p of S) i.push({ family: p, expected: c, dynamic: !c, exportedBindings: m, wrongCode: d, evidence: { kind: "config", detail: "project-level attribution configuration", file: n.relativePath, line: C } });
|
|
231134
231135
|
}
|
|
231135
231136
|
return i;
|
|
231136
231137
|
}
|
|
@@ -231147,7 +231148,7 @@ function $t(e) {
|
|
|
231147
231148
|
function Rt(e) {
|
|
231148
231149
|
return e.family === "wallet" ? `${e.marker} is missing the EIP-5792 dataSuffix capability.` : e.family === "x402" ? `${e.marker} is missing the official x402 Builder Code extension.` : `${e.marker} does not have Builder Code attribution evidence.`;
|
|
231149
231150
|
}
|
|
231150
|
-
function
|
|
231151
|
+
function It(e) {
|
|
231151
231152
|
switch (e) {
|
|
231152
231153
|
case "wallet":
|
|
231153
231154
|
return "Use Smart Wallet Attribution Kit middleware or negotiate wallet_getCapabilities before adding capabilities.dataSuffix.";
|
|
@@ -231161,16 +231162,16 @@ function Ot(e) {
|
|
|
231161
231162
|
return "Add a BAO SDK helper or dataSuffix configuration to this transaction path.";
|
|
231162
231163
|
}
|
|
231163
231164
|
}
|
|
231164
|
-
function
|
|
231165
|
+
function Ot(e, t, i, n) {
|
|
231165
231166
|
if (e === "protected") return "off";
|
|
231166
231167
|
let r = t === "BAO004" ? n?.["ambiguous-path"] : e === "missing" ? n?.["missing-attribution"] : e === "wrong-code" ? n?.["wrong-builder-code"] : n?.["dynamic-attribution"];
|
|
231167
231168
|
return r || (i === "local" ? "warning" : i === "strict" ? "error" : e === "unresolved" ? "warning" : "error");
|
|
231168
231169
|
}
|
|
231169
|
-
function
|
|
231170
|
+
function jt(e) {
|
|
231170
231171
|
let t = e.filter((n) => n.status === "protected").length, i = e.filter((n) => n.baseline).length;
|
|
231171
231172
|
return { total: e.length, protected: t, missing: e.filter((n) => n.status === "missing").length, wrongCode: e.filter((n) => n.status === "wrong-code").length, unresolved: e.filter((n) => n.status === "unresolved").length, errors: e.filter((n) => n.severity === "error" && !n.baseline).length, warnings: e.filter((n) => n.severity === "warning" && !n.baseline).length, baseline: i, coverage: e.length === 0 ? 100 : Math.round(t / e.length * 100) };
|
|
231172
231173
|
}
|
|
231173
|
-
async function
|
|
231174
|
+
async function Dt(e, t) {
|
|
231174
231175
|
let i;
|
|
231175
231176
|
if (t.files && t.files.length > 0) {
|
|
231176
231177
|
i = t.files.map((n) => import_path.default.resolve(e, n));
|
|
@@ -231180,21 +231181,21 @@ async function It(e, t) {
|
|
|
231180
231181
|
let o = await import_fs2.promises.realpath(n), s = await import_fs2.promises.realpath(e), f = import_path.default.relative(s, o);
|
|
231181
231182
|
if (f.startsWith("..") || import_path.default.isAbsolute(f)) throw new Error("Explicit source files must not resolve outside the scan root.");
|
|
231182
231183
|
}
|
|
231183
|
-
} else i = await
|
|
231184
|
-
return Array.from(new Set(i)).filter((n) =>
|
|
231184
|
+
} else i = await Re(e);
|
|
231185
|
+
return Array.from(new Set(i)).filter((n) => oe.has(import_path.default.extname(n))).filter((n) => Lt(v(import_path.default.relative(e, n)), t.include)).filter((n) => !Wt(v(import_path.default.relative(e, n)), t.exclude)).sort();
|
|
231185
231186
|
}
|
|
231186
231187
|
function Nt(e, t) {
|
|
231187
231188
|
return e.filter((i) => t.has(i.relativePath));
|
|
231188
231189
|
}
|
|
231189
231190
|
async function Tt(e, t) {
|
|
231190
|
-
if (t.length >
|
|
231191
|
+
if (t.length > Ce) throw new Error(`Source scan exceeds the ${Ce} file limit.`);
|
|
231191
231192
|
let i = 0;
|
|
231192
231193
|
for (let r = 0; r < t.length; r += K) {
|
|
231193
231194
|
let o = t.slice(r, r + K), s = await Promise.all(o.map((f) => import_fs2.promises.stat(f)));
|
|
231194
231195
|
for (let f = 0; f < o.length; f += 1) {
|
|
231195
231196
|
let l = s[f].size;
|
|
231196
|
-
if (l >
|
|
231197
|
-
if (i += l, i >
|
|
231197
|
+
if (l > at) throw new Error(`${v(import_path.default.relative(e, o[f]))} exceeds the 2 MiB source file limit.`);
|
|
231198
|
+
if (i += l, i > ct) throw new Error("Source scan exceeds the 50 MiB aggregate limit.");
|
|
231198
231199
|
}
|
|
231199
231200
|
}
|
|
231200
231201
|
let n = [];
|
|
@@ -231202,36 +231203,36 @@ async function Tt(e, t) {
|
|
|
231202
231203
|
let o = t.slice(r, r + K);
|
|
231203
231204
|
n.push(...await Promise.all(o.map(async (s) => {
|
|
231204
231205
|
let f = await import_fs2.promises.readFile(s, "utf8");
|
|
231205
|
-
return { absolutePath: s, relativePath:
|
|
231206
|
+
return { absolutePath: s, relativePath: v(import_path.default.relative(e, s)), source: f, frameworks: le(f) };
|
|
231206
231207
|
})));
|
|
231207
231208
|
}
|
|
231208
231209
|
return n;
|
|
231209
231210
|
}
|
|
231210
|
-
async function
|
|
231211
|
+
async function Re(e) {
|
|
231211
231212
|
let t = await import_fs2.promises.stat(e).catch(() => {
|
|
231212
231213
|
});
|
|
231213
231214
|
if (!t) return [];
|
|
231214
|
-
if (t.isFile()) return
|
|
231215
|
+
if (t.isFile()) return oe.has(import_path.default.extname(e)) ? [e] : [];
|
|
231215
231216
|
let i = await import_fs2.promises.readdir(e, { withFileTypes: true }), n = [];
|
|
231216
231217
|
for (let r of i) {
|
|
231217
|
-
if (r.isDirectory() &&
|
|
231218
|
+
if (r.isDirectory() && ft.has(r.name)) continue;
|
|
231218
231219
|
let o = import_path.default.join(e, r.name);
|
|
231219
|
-
r.isDirectory() ? n.push(...await
|
|
231220
|
+
r.isDirectory() ? n.push(...await Re(o)) : r.isFile() && oe.has(import_path.default.extname(r.name)) && n.push(o);
|
|
231220
231221
|
}
|
|
231221
231222
|
return n;
|
|
231222
231223
|
}
|
|
231223
231224
|
async function Ft(e, t) {
|
|
231224
|
-
let { stdout: i } = await
|
|
231225
|
-
return new Set(i.split(/\r?\n/).map((n) =>
|
|
231225
|
+
let { stdout: i } = await ot("git", ["diff", "--name-only", "--end-of-options", `${t}...HEAD`, "--"], { cwd: e });
|
|
231226
|
+
return new Set(i.split(/\r?\n/).map((n) => v(n.trim())).filter(Boolean));
|
|
231226
231227
|
}
|
|
231227
231228
|
function Lt(e, t) {
|
|
231228
|
-
return !t || t.length === 0 ? true : t.some((i) =>
|
|
231229
|
+
return !t || t.length === 0 ? true : t.some((i) => Ie(e, i));
|
|
231229
231230
|
}
|
|
231230
231231
|
function Wt(e, t) {
|
|
231231
|
-
return t?.some((i) =>
|
|
231232
|
+
return t?.some((i) => Ie(e, i)) ?? false;
|
|
231232
231233
|
}
|
|
231233
|
-
function
|
|
231234
|
-
let i =
|
|
231234
|
+
function Ie(e, t) {
|
|
231235
|
+
let i = v(t).replace(/^\.\//, "").replace(/\/$/, "");
|
|
231235
231236
|
if (!i.includes("*")) return e === i || e.startsWith(`${i}/`);
|
|
231236
231237
|
let n = "";
|
|
231237
231238
|
for (let r = 0; r < i.length; r += 1) {
|
|
@@ -231243,71 +231244,73 @@ function $e(e, t) {
|
|
|
231243
231244
|
function Mt(e) {
|
|
231244
231245
|
let t = e.arguments[0];
|
|
231245
231246
|
if (!(!t || !import_typescript.default.isObjectLiteralExpression(t))) {
|
|
231246
|
-
for (let i of t.properties) if (!(!import_typescript.default.isPropertyAssignment(i) ||
|
|
231247
|
+
for (let i of t.properties) if (!(!import_typescript.default.isPropertyAssignment(i) || A(i.name) !== "method") && import_typescript.default.isStringLiteralLike(i.initializer)) return i.initializer.text;
|
|
231247
231248
|
}
|
|
231248
231249
|
}
|
|
231249
|
-
function
|
|
231250
|
+
function P(e) {
|
|
231250
231251
|
if (import_typescript.default.isIdentifier(e)) return e.text;
|
|
231251
231252
|
if (import_typescript.default.isPropertyAccessExpression(e)) return e.name.text;
|
|
231252
231253
|
if (import_typescript.default.isElementAccessExpression(e) && e.argumentExpression && import_typescript.default.isStringLiteralLike(e.argumentExpression)) return e.argumentExpression.text;
|
|
231253
231254
|
}
|
|
231254
|
-
function
|
|
231255
|
-
let n =
|
|
231255
|
+
function Oe(e, t, i = /* @__PURE__ */ new Set()) {
|
|
231256
|
+
let n = P(t);
|
|
231256
231257
|
if (!import_typescript.default.isIdentifier(t)) return n;
|
|
231257
|
-
let r =
|
|
231258
|
+
let r = _(e), o = I(r, t.text, t.getStart(e));
|
|
231258
231259
|
if (!o || i.has(o.node)) return n;
|
|
231259
231260
|
if (i.add(o.node), import_typescript.default.isImportSpecifier(o.node)) return o.node.propertyName?.text ?? o.node.name.text;
|
|
231260
231261
|
if (import_typescript.default.isVariableDeclaration(o.node)) {
|
|
231261
|
-
let s =
|
|
231262
|
+
let s = je(o.node.name, t.text);
|
|
231262
231263
|
if (s) return s;
|
|
231263
|
-
if (o.node.initializer) return
|
|
231264
|
+
if (o.node.initializer) return Oe(e, o.node.initializer, i) ?? n;
|
|
231264
231265
|
}
|
|
231265
231266
|
return n;
|
|
231266
231267
|
}
|
|
231267
|
-
function
|
|
231268
|
+
function je(e, t) {
|
|
231268
231269
|
if (import_typescript.default.isObjectBindingPattern(e)) for (let i of e.elements) {
|
|
231269
|
-
if (import_typescript.default.isIdentifier(i.name) && i.name.text === t) return
|
|
231270
|
-
let n =
|
|
231270
|
+
if (import_typescript.default.isIdentifier(i.name) && i.name.text === t) return A(i.propertyName ?? i.name);
|
|
231271
|
+
let n = je(i.name, t);
|
|
231271
231272
|
if (n) return n;
|
|
231272
231273
|
}
|
|
231273
231274
|
}
|
|
231274
|
-
function
|
|
231275
|
+
function A(e) {
|
|
231275
231276
|
if (import_typescript.default.isIdentifier(e) || import_typescript.default.isStringLiteralLike(e)) return e.text;
|
|
231276
231277
|
}
|
|
231277
|
-
function
|
|
231278
|
+
function ce(e) {
|
|
231278
231279
|
return Array.from(new Set(Array.from(e).filter((t) => validateBuilderCodes([t]).length === 0)));
|
|
231279
231280
|
}
|
|
231280
|
-
function
|
|
231281
|
+
function zt(e) {
|
|
231281
231282
|
let t = false;
|
|
231282
231283
|
function i(n) {
|
|
231283
|
-
if (import_typescript.default.isPropertyAssignment(n) &&
|
|
231284
|
-
t = n.initializer.properties.some((r) => import_typescript.default.isPropertyAssignment(r) &&
|
|
231284
|
+
if (import_typescript.default.isPropertyAssignment(n) && A(n.name) === "dataSuffix" && import_typescript.default.isObjectLiteralExpression(n.initializer)) {
|
|
231285
|
+
t = n.initializer.properties.some((r) => import_typescript.default.isPropertyAssignment(r) && A(r.name) === "optional" && r.initializer.kind === import_typescript.default.SyntaxKind.FalseKeyword);
|
|
231285
231286
|
return;
|
|
231286
231287
|
}
|
|
231287
231288
|
import_typescript.default.forEachChild(n, i);
|
|
231288
231289
|
}
|
|
231289
231290
|
return i(e), t;
|
|
231290
231291
|
}
|
|
231291
|
-
function
|
|
231292
|
-
|
|
231293
|
-
|
|
231294
|
-
|
|
231295
|
-
|
|
231292
|
+
function V(e, t, i = /* @__PURE__ */ new Set()) {
|
|
231293
|
+
if (import_typescript.default.isPropertyAccessExpression(e) || import_typescript.default.isElementAccessExpression(e) || import_typescript.default.isParenthesizedExpression(e) || import_typescript.default.isAsExpression(e) || import_typescript.default.isSatisfiesExpression(e) || import_typescript.default.isNonNullExpression(e) || import_typescript.default.isTypeAssertionExpression(e)) return V(e.expression, t, i);
|
|
231294
|
+
if (!import_typescript.default.isIdentifier(e)) return true;
|
|
231295
|
+
let n = I(t, e.text, e.getStart());
|
|
231296
|
+
if (!n) return false;
|
|
231297
|
+
let r = n.node;
|
|
231298
|
+
return import_typescript.default.isImportSpecifier(r) || import_typescript.default.isImportClause(r) || import_typescript.default.isNamespaceImport(r) ? false : i.has(r) ? true : (i.add(r), import_typescript.default.isVariableDeclaration(r) && r.initializer ? V(r.initializer, t, i) : true);
|
|
231296
231299
|
}
|
|
231297
231300
|
function De(e) {
|
|
231298
231301
|
let t = validateBuilderCodes(e);
|
|
231299
231302
|
if (t.length > 0) throw new Error(t.join("; "));
|
|
231300
231303
|
}
|
|
231301
|
-
function
|
|
231304
|
+
function Ne(e) {
|
|
231302
231305
|
return e.replace(/\s+/g, " ").trim();
|
|
231303
231306
|
}
|
|
231304
|
-
function
|
|
231307
|
+
function _t(e, t) {
|
|
231305
231308
|
return e === "viem" && !t.includes("viem") ? "low" : "high";
|
|
231306
231309
|
}
|
|
231307
231310
|
function Ut(...e) {
|
|
231308
231311
|
return (0, import_crypto.createHash)("sha256").update(e.join(":"), "utf8").digest("hex").slice(0, 20);
|
|
231309
231312
|
}
|
|
231310
|
-
function
|
|
231313
|
+
function Te(e) {
|
|
231311
231314
|
switch (import_path.default.extname(e)) {
|
|
231312
231315
|
case ".tsx":
|
|
231313
231316
|
return import_typescript.default.ScriptKind.TSX;
|
|
@@ -231321,7 +231324,7 @@ function Ne(e) {
|
|
|
231321
231324
|
return import_typescript.default.ScriptKind.TS;
|
|
231322
231325
|
}
|
|
231323
231326
|
}
|
|
231324
|
-
function
|
|
231327
|
+
function v(e) {
|
|
231325
231328
|
return e.replaceAll("\\", "/");
|
|
231326
231329
|
}
|
|
231327
231330
|
var X = "bao.config.json";
|
|
@@ -231341,29 +231344,29 @@ function Jt(e, t) {
|
|
|
231341
231344
|
if (!e || typeof e != "object" || Array.isArray(e)) throw new Error(`${t} must contain a JSON object.`);
|
|
231342
231345
|
let i = e, n = /* @__PURE__ */ new Set(["$schema", "builderCodes", "profile", "include", "exclude", "rules", "baseline", "workspace"]), r = Object.keys(i).filter((s) => !n.has(s));
|
|
231343
231346
|
if (r.length > 0) throw new Error(`${t} contains unsupported field(s): ${r.join(", ")}.`);
|
|
231344
|
-
if (!Array.isArray(i.builderCodes) || !i.builderCodes.every(
|
|
231347
|
+
if (!Array.isArray(i.builderCodes) || !i.builderCodes.every(Le)) throw new Error(`${t} must define builderCodes as a non-empty string array.`);
|
|
231345
231348
|
let o = validateBuilderCodes(i.builderCodes);
|
|
231346
231349
|
if (o.length > 0) throw new Error(`${t}: ${o.join("; ")}`);
|
|
231347
231350
|
if (i.$schema !== void 0 && typeof i.$schema != "string") throw new Error(`${t}.$schema must be a string.`);
|
|
231348
|
-
if (i.profile !== void 0 && (typeof i.profile != "string" || !
|
|
231349
|
-
if (
|
|
231350
|
-
|
|
231351
|
+
if (i.profile !== void 0 && (typeof i.profile != "string" || !W.some((s) => s === i.profile))) throw new Error(`${t}.profile must be local, ci, or strict.`);
|
|
231352
|
+
if (q(i.include, `${t}.include`), q(i.exclude, `${t}.exclude`), i.baseline !== void 0 && typeof i.baseline != "string") throw new Error(`${t}.baseline must be a string.`);
|
|
231353
|
+
Gt(i.rules, t), Ht(i.workspace, t);
|
|
231351
231354
|
}
|
|
231352
|
-
function
|
|
231355
|
+
function Ht(e, t) {
|
|
231353
231356
|
if (e === void 0) return;
|
|
231354
231357
|
if (!e || typeof e != "object" || Array.isArray(e)) throw new Error(`${t}.workspace must be an object.`);
|
|
231355
231358
|
let i = e, n = Object.keys(i).filter((r) => r !== "roots" && r !== "tsconfig");
|
|
231356
231359
|
if (n.length > 0) throw new Error(`${t}.workspace contains unsupported field(s): ${n.join(", ")}.`);
|
|
231357
|
-
|
|
231360
|
+
q(i.roots, `${t}.workspace.roots`), q(i.tsconfig, `${t}.workspace.tsconfig`);
|
|
231358
231361
|
for (let [r, o] of Object.entries(i)) if (Array.isArray(o)) for (let s of o) {
|
|
231359
231362
|
let f = s.replaceAll("\\", "/");
|
|
231360
231363
|
if (!s || import_path4.default.isAbsolute(s) || f.split("/").includes("..")) throw new Error(`${t}.workspace.${r} entries must be relative paths inside the scan root.`);
|
|
231361
231364
|
}
|
|
231362
231365
|
}
|
|
231363
|
-
function
|
|
231364
|
-
if (e !== void 0 && (!Array.isArray(e) || !e.every(
|
|
231366
|
+
function q(e, t) {
|
|
231367
|
+
if (e !== void 0 && (!Array.isArray(e) || !e.every(Le))) throw new Error(`${t} must be an array of strings.`);
|
|
231365
231368
|
}
|
|
231366
|
-
function
|
|
231369
|
+
function Gt(e, t) {
|
|
231367
231370
|
if (e === void 0) return;
|
|
231368
231371
|
if (!e || typeof e != "object" || Array.isArray(e)) throw new Error(`${t}.rules must be an object.`);
|
|
231369
231372
|
let i = /* @__PURE__ */ new Set(["missing-attribution", "wrong-builder-code", "dynamic-attribution", "ambiguous-path"]);
|
|
@@ -231372,7 +231375,7 @@ function Xt(e, t) {
|
|
|
231372
231375
|
if (!["error", "warning", "off"].includes(String(r))) throw new Error(`${t}.rules.${n} must be error, warning, or off.`);
|
|
231373
231376
|
}
|
|
231374
231377
|
}
|
|
231375
|
-
function
|
|
231378
|
+
function Le(e) {
|
|
231376
231379
|
return typeof e == "string";
|
|
231377
231380
|
}
|
|
231378
231381
|
var qt = { BAO001: { name: "missing-attribution", description: "A transaction path does not include Builder Code attribution." }, BAO002: { name: "wrong-builder-code", description: "A transaction path contains a Builder Code that is not configured for this project." }, BAO003: { name: "dynamic-attribution", description: "Attribution is configured dynamically and cannot be proven statically." }, BAO004: { name: "ambiguous-path", description: "Project-level attribution evidence cannot be linked to a transaction path with high confidence." }, BAO005: { name: "smart-wallet-data-suffix", description: "A smart-wallet call is missing negotiated EIP-5792 or ERC-4337 attribution middleware." }, BAO006: { name: "x402-builder-code-extension", description: "An x402 payment path is missing a Builder Code extension." } };
|
|
@@ -231414,7 +231417,7 @@ async function main() {
|
|
|
231414
231417
|
const changedOnly = getBooleanInput("changed-only");
|
|
231415
231418
|
const changedSince = changedOnly ? resolveBaseRef() : void 0;
|
|
231416
231419
|
const baseline = getInput("baseline") || config?.baseline;
|
|
231417
|
-
const report = await
|
|
231420
|
+
const report = await lt({
|
|
231418
231421
|
root: repoPath,
|
|
231419
231422
|
builderCodes: builderCodes.length ? builderCodes : config?.builderCodes ?? [],
|
|
231420
231423
|
include: paths.length ? paths : config?.include,
|
|
@@ -231465,8 +231468,8 @@ async function writeSummary(report, changedSince) {
|
|
|
231465
231468
|
String(paths.length)
|
|
231466
231469
|
];
|
|
231467
231470
|
});
|
|
231468
|
-
summary.addHeading("
|
|
231469
|
-
`${report.summary.protected}/${report.summary.total} transaction paths protected (${report.summary.coverage}%).`
|
|
231471
|
+
summary.addHeading("BAO Attribution Doctor", 2).addRaw(
|
|
231472
|
+
report.summary.total === 0 ? "Coverage not measured: no supported transaction paths in the configured scope. Check the scope and supported patterns." : `${report.summary.protected}/${report.summary.total} transaction paths protected (${report.summary.coverage}%).`
|
|
231470
231473
|
).addEOL().addRaw(
|
|
231471
231474
|
`Errors: ${report.summary.errors} | Warnings: ${report.summary.warnings} | Baseline: ${report.summary.baseline}`
|
|
231472
231475
|
).addEOL();
|