@typescript-deploys/pr-build 5.3.0-pr-55445-6 → 5.3.0-pr-55278-2
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/SECURITY.md +7 -7
- package/lib/cancellationToken.js +1 -1
- package/lib/lib.decorators.d.ts +6 -3
- package/lib/lib.es2015.collection.d.ts +2 -1
- package/lib/lib.es2015.core.d.ts +1 -1
- package/lib/lib.es2015.iterable.d.ts +5 -4
- package/lib/lib.es2015.promise.d.ts +1 -1
- package/lib/lib.es2015.symbol.d.ts +1 -1
- package/lib/lib.es2016.array.include.d.ts +1 -1
- package/lib/lib.es2016.d.ts +1 -1
- package/lib/lib.es2016.full.d.ts +1 -1
- package/lib/lib.es2017.full.d.ts +1 -1
- package/lib/lib.es2017.intl.d.ts +12 -11
- package/lib/lib.es2017.object.d.ts +3 -3
- package/lib/lib.es2018.asynciterable.d.ts +1 -1
- package/lib/lib.es2018.full.d.ts +1 -1
- package/lib/lib.es2018.intl.d.ts +2 -1
- package/lib/lib.es2018.promise.d.ts +1 -1
- package/lib/lib.es2018.regexp.d.ts +5 -5
- package/lib/lib.es2019.array.d.ts +18 -14
- package/lib/lib.es2019.intl.d.ts +1 -1
- package/lib/lib.es2019.object.d.ts +1 -1
- package/lib/lib.es2020.bigint.d.ts +7 -7
- package/lib/lib.es2020.date.d.ts +1 -1
- package/lib/lib.es2020.intl.d.ts +13 -11
- package/lib/lib.es2020.promise.d.ts +1 -1
- package/lib/lib.es2021.intl.d.ts +6 -5
- package/lib/lib.es2021.promise.d.ts +3 -3
- package/lib/lib.es2021.weakref.d.ts +2 -2
- package/lib/lib.es2022.error.d.ts +2 -2
- package/lib/lib.es2022.intl.d.ts +2 -1
- package/lib/lib.es2022.sharedmemory.d.ts +2 -2
- package/lib/lib.es2023.array.d.ts +61 -61
- package/lib/lib.es5.d.ts +88 -74
- package/lib/lib.esnext.disposable.d.ts +10 -10
- package/lib/lib.esnext.full.d.ts +1 -1
- package/lib/lib.esnext.intl.d.ts +7 -7
- package/lib/lib.scripthost.d.ts +4 -1
- package/lib/lib.webworker.importscripts.d.ts +1 -0
- package/lib/tsc.js +1674 -1522
- package/lib/tsserver.js +2360 -2157
- package/lib/typesMap.json +2 -2
- package/lib/typescript.d.ts +118 -345
- package/lib/typescript.js +2747 -2551
- package/lib/typingsInstaller.js +215 -163
- package/package.json +5 -4
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.3";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20230911`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -569,7 +569,10 @@ function getStringComparer(ignoreCase) {
|
|
|
569
569
|
return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive;
|
|
570
570
|
}
|
|
571
571
|
var createUIStringComparer = (() => {
|
|
572
|
-
|
|
572
|
+
let defaultComparer;
|
|
573
|
+
let enUSComparer;
|
|
574
|
+
const stringComparerFactory = getStringComparerFactory();
|
|
575
|
+
return createStringComparer;
|
|
573
576
|
function compareWithCallback(a, b, comparer) {
|
|
574
577
|
if (a === b)
|
|
575
578
|
return 0 /* EqualTo */;
|
|
@@ -584,6 +587,41 @@ var createUIStringComparer = (() => {
|
|
|
584
587
|
const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant" }).compare;
|
|
585
588
|
return (a, b) => compareWithCallback(a, b, comparer);
|
|
586
589
|
}
|
|
590
|
+
function createLocaleCompareStringComparer(locale) {
|
|
591
|
+
if (locale !== void 0)
|
|
592
|
+
return createFallbackStringComparer();
|
|
593
|
+
return (a, b) => compareWithCallback(a, b, compareStrings);
|
|
594
|
+
function compareStrings(a, b) {
|
|
595
|
+
return a.localeCompare(b);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
function createFallbackStringComparer() {
|
|
599
|
+
return (a, b) => compareWithCallback(a, b, compareDictionaryOrder);
|
|
600
|
+
function compareDictionaryOrder(a, b) {
|
|
601
|
+
return compareStrings(a.toUpperCase(), b.toUpperCase()) || compareStrings(a, b);
|
|
602
|
+
}
|
|
603
|
+
function compareStrings(a, b) {
|
|
604
|
+
return a < b ? -1 /* LessThan */ : a > b ? 1 /* GreaterThan */ : 0 /* EqualTo */;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
function getStringComparerFactory() {
|
|
608
|
+
if (typeof Intl === "object" && typeof Intl.Collator === "function") {
|
|
609
|
+
return createIntlCollatorStringComparer;
|
|
610
|
+
}
|
|
611
|
+
if (typeof String.prototype.localeCompare === "function" && typeof String.prototype.toLocaleUpperCase === "function" && "a".localeCompare("B") < 0) {
|
|
612
|
+
return createLocaleCompareStringComparer;
|
|
613
|
+
}
|
|
614
|
+
return createFallbackStringComparer;
|
|
615
|
+
}
|
|
616
|
+
function createStringComparer(locale) {
|
|
617
|
+
if (locale === void 0) {
|
|
618
|
+
return defaultComparer || (defaultComparer = stringComparerFactory(locale));
|
|
619
|
+
} else if (locale === "en-US") {
|
|
620
|
+
return enUSComparer || (enUSComparer = stringComparerFactory(locale));
|
|
621
|
+
} else {
|
|
622
|
+
return stringComparerFactory(locale);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
587
625
|
})();
|
|
588
626
|
function getSpellingSuggestion(name, candidates, getName) {
|
|
589
627
|
const maximumLengthDifference = Math.max(2, Math.floor(name.length * 0.34));
|
|
@@ -655,6 +693,9 @@ function endsWith(str, suffix) {
|
|
|
655
693
|
const expectedPos = str.length - suffix.length;
|
|
656
694
|
return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos;
|
|
657
695
|
}
|
|
696
|
+
function stringContains(str, substring) {
|
|
697
|
+
return str.indexOf(substring) !== -1;
|
|
698
|
+
}
|
|
658
699
|
function removeMinAndVersionNumbers(fileName) {
|
|
659
700
|
let end = fileName.length;
|
|
660
701
|
for (let pos = end - 1; pos > 0; pos--) {
|
|
@@ -784,6 +825,21 @@ function enumerateInsertsAndDeletes(newItems, oldItems, comparer, inserted, dele
|
|
|
784
825
|
}
|
|
785
826
|
return hasChanges;
|
|
786
827
|
}
|
|
828
|
+
function padLeft(s, length2, padString = " ") {
|
|
829
|
+
return length2 <= s.length ? s : padString.repeat(length2 - s.length) + s;
|
|
830
|
+
}
|
|
831
|
+
var trimString = !!String.prototype.trim ? (s) => s.trim() : (s) => trimStringEnd(trimStringStart(s));
|
|
832
|
+
var trimStringEnd = !!String.prototype.trimEnd ? (s) => s.trimEnd() : trimEndImpl;
|
|
833
|
+
var trimStringStart = !!String.prototype.trimStart ? (s) => s.trimStart() : (s) => s.replace(/^\s+/g, "");
|
|
834
|
+
function trimEndImpl(s) {
|
|
835
|
+
let end = s.length - 1;
|
|
836
|
+
while (end >= 0) {
|
|
837
|
+
if (!isWhiteSpaceLike(s.charCodeAt(end)))
|
|
838
|
+
break;
|
|
839
|
+
end--;
|
|
840
|
+
}
|
|
841
|
+
return s.slice(0, end + 1);
|
|
842
|
+
}
|
|
787
843
|
function isNodeLikeSystem() {
|
|
788
844
|
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module === "object";
|
|
789
845
|
}
|
|
@@ -1224,21 +1280,17 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1224
1280
|
return `${flowHeader}${remainingFlags ? ` (${formatFlowFlags(remainingFlags)})` : ""}`;
|
|
1225
1281
|
}
|
|
1226
1282
|
},
|
|
1227
|
-
__debugFlowFlags: {
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
value() {
|
|
1239
|
-
return formatControlFlowGraph(this);
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1283
|
+
__debugFlowFlags: { get() {
|
|
1284
|
+
return formatEnum(
|
|
1285
|
+
this.flags,
|
|
1286
|
+
FlowFlags,
|
|
1287
|
+
/*isFlags*/
|
|
1288
|
+
true
|
|
1289
|
+
);
|
|
1290
|
+
} },
|
|
1291
|
+
__debugToString: { value() {
|
|
1292
|
+
return formatControlFlowGraph(this);
|
|
1293
|
+
} }
|
|
1242
1294
|
});
|
|
1243
1295
|
}
|
|
1244
1296
|
}
|
|
@@ -1297,11 +1349,9 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1297
1349
|
return `${symbolHeader} '${symbolName(this)}'${remainingSymbolFlags ? ` (${formatSymbolFlags(remainingSymbolFlags)})` : ""}`;
|
|
1298
1350
|
}
|
|
1299
1351
|
},
|
|
1300
|
-
__debugFlags: {
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1352
|
+
__debugFlags: { get() {
|
|
1353
|
+
return formatSymbolFlags(this.flags);
|
|
1354
|
+
} }
|
|
1305
1355
|
});
|
|
1306
1356
|
Object.defineProperties(objectAllocator.getTypeConstructor().prototype, {
|
|
1307
1357
|
// for use with vscode-js-debug's new customDescriptionGenerator in launch.json
|
|
@@ -1312,16 +1362,12 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1312
1362
|
return `${typeHeader}${this.symbol ? ` '${symbolName(this.symbol)}'` : ""}${remainingObjectFlags ? ` (${formatObjectFlags(remainingObjectFlags)})` : ""}`;
|
|
1313
1363
|
}
|
|
1314
1364
|
},
|
|
1315
|
-
__debugFlags: {
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
get() {
|
|
1322
|
-
return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : "";
|
|
1323
|
-
}
|
|
1324
|
-
},
|
|
1365
|
+
__debugFlags: { get() {
|
|
1366
|
+
return formatTypeFlags(this.flags);
|
|
1367
|
+
} },
|
|
1368
|
+
__debugObjectFlags: { get() {
|
|
1369
|
+
return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : "";
|
|
1370
|
+
} },
|
|
1325
1371
|
__debugTypeToString: {
|
|
1326
1372
|
value() {
|
|
1327
1373
|
let text = weakTypeTextMap.get(this);
|
|
@@ -1334,17 +1380,13 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1334
1380
|
}
|
|
1335
1381
|
});
|
|
1336
1382
|
Object.defineProperties(objectAllocator.getSignatureConstructor().prototype, {
|
|
1337
|
-
__debugFlags: {
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
var _a;
|
|
1345
|
-
return (_a = this.checker) == null ? void 0 : _a.signatureToString(this);
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1383
|
+
__debugFlags: { get() {
|
|
1384
|
+
return formatSignatureFlags(this.flags);
|
|
1385
|
+
} },
|
|
1386
|
+
__debugSignatureToString: { value() {
|
|
1387
|
+
var _a;
|
|
1388
|
+
return (_a = this.checker) == null ? void 0 : _a.signatureToString(this);
|
|
1389
|
+
} }
|
|
1348
1390
|
});
|
|
1349
1391
|
const nodeConstructors = [
|
|
1350
1392
|
objectAllocator.getNodeConstructor(),
|
|
@@ -1362,36 +1404,24 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1362
1404
|
return `${nodeHeader}${this.flags ? ` (${formatNodeFlags(this.flags)})` : ""}`;
|
|
1363
1405
|
}
|
|
1364
1406
|
},
|
|
1365
|
-
__debugKind: {
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
},
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
}
|
|
1384
|
-
},
|
|
1385
|
-
__debugIsParseTreeNode: {
|
|
1386
|
-
get() {
|
|
1387
|
-
return isParseTreeNode(this);
|
|
1388
|
-
}
|
|
1389
|
-
},
|
|
1390
|
-
__debugEmitFlags: {
|
|
1391
|
-
get() {
|
|
1392
|
-
return formatEmitFlags(getEmitFlags(this));
|
|
1393
|
-
}
|
|
1394
|
-
},
|
|
1407
|
+
__debugKind: { get() {
|
|
1408
|
+
return formatSyntaxKind(this.kind);
|
|
1409
|
+
} },
|
|
1410
|
+
__debugNodeFlags: { get() {
|
|
1411
|
+
return formatNodeFlags(this.flags);
|
|
1412
|
+
} },
|
|
1413
|
+
__debugModifierFlags: { get() {
|
|
1414
|
+
return formatModifierFlags(getEffectiveModifierFlagsNoCache(this));
|
|
1415
|
+
} },
|
|
1416
|
+
__debugTransformFlags: { get() {
|
|
1417
|
+
return formatTransformFlags(this.transformFlags);
|
|
1418
|
+
} },
|
|
1419
|
+
__debugIsParseTreeNode: { get() {
|
|
1420
|
+
return isParseTreeNode(this);
|
|
1421
|
+
} },
|
|
1422
|
+
__debugEmitFlags: { get() {
|
|
1423
|
+
return formatEmitFlags(getEmitFlags(this));
|
|
1424
|
+
} },
|
|
1395
1425
|
__debugGetText: {
|
|
1396
1426
|
value(includeTrivia) {
|
|
1397
1427
|
if (nodeIsSynthesized(this))
|
|
@@ -1971,18 +2001,18 @@ var hyphenRegExp = /^\s*([a-z0-9-+.*]+)\s+-\s+([a-z0-9-+.*]+)\s*$/i;
|
|
|
1971
2001
|
var rangeRegExp = /^(~|\^|<|<=|>|>=|=)?\s*([a-z0-9-+.*]+)$/i;
|
|
1972
2002
|
function parseRange(text) {
|
|
1973
2003
|
const alternatives = [];
|
|
1974
|
-
for (let range of text
|
|
2004
|
+
for (let range of trimString(text).split(logicalOrRegExp)) {
|
|
1975
2005
|
if (!range)
|
|
1976
2006
|
continue;
|
|
1977
2007
|
const comparators = [];
|
|
1978
|
-
range = range
|
|
2008
|
+
range = trimString(range);
|
|
1979
2009
|
const match = hyphenRegExp.exec(range);
|
|
1980
2010
|
if (match) {
|
|
1981
2011
|
if (!parseHyphen(match[1], match[2], comparators))
|
|
1982
2012
|
return void 0;
|
|
1983
2013
|
} else {
|
|
1984
2014
|
for (const simple of range.split(whitespaceRegExp)) {
|
|
1985
|
-
const match2 = rangeRegExp.exec(simple
|
|
2015
|
+
const match2 = rangeRegExp.exec(trimString(simple));
|
|
1986
2016
|
if (!match2 || !parseComparator(match2[1], match2[2], comparators))
|
|
1987
2017
|
return void 0;
|
|
1988
2018
|
}
|
|
@@ -2031,21 +2061,15 @@ function parseComparator(operator, text, comparators) {
|
|
|
2031
2061
|
switch (operator) {
|
|
2032
2062
|
case "~":
|
|
2033
2063
|
comparators.push(createComparator(">=", version2));
|
|
2034
|
-
comparators.push(createComparator(
|
|
2035
|
-
"
|
|
2036
|
-
|
|
2037
|
-
isWildcard(minor) ? "major" : "minor"
|
|
2038
|
-
)
|
|
2039
|
-
));
|
|
2064
|
+
comparators.push(createComparator("<", version2.increment(
|
|
2065
|
+
isWildcard(minor) ? "major" : "minor"
|
|
2066
|
+
)));
|
|
2040
2067
|
break;
|
|
2041
2068
|
case "^":
|
|
2042
2069
|
comparators.push(createComparator(">=", version2));
|
|
2043
|
-
comparators.push(createComparator(
|
|
2044
|
-
"
|
|
2045
|
-
|
|
2046
|
-
version2.major > 0 || isWildcard(minor) ? "major" : version2.minor > 0 || isWildcard(patch) ? "minor" : "patch"
|
|
2047
|
-
)
|
|
2048
|
-
));
|
|
2070
|
+
comparators.push(createComparator("<", version2.increment(
|
|
2071
|
+
version2.major > 0 || isWildcard(minor) ? "major" : version2.minor > 0 || isWildcard(patch) ? "minor" : "patch"
|
|
2072
|
+
)));
|
|
2049
2073
|
break;
|
|
2050
2074
|
case "<":
|
|
2051
2075
|
case ">=":
|
|
@@ -2241,7 +2265,11 @@ var tracingEnabled;
|
|
|
2241
2265
|
const meta = { cat: "__metadata", ph: "M", ts: 1e3 * timestamp(), pid: 1, tid: 1 };
|
|
2242
2266
|
fs2.writeSync(
|
|
2243
2267
|
traceFd,
|
|
2244
|
-
"[\n" + [
|
|
2268
|
+
"[\n" + [
|
|
2269
|
+
{ name: "process_name", args: { name: "tsc" }, ...meta },
|
|
2270
|
+
{ name: "thread_name", args: { name: "Main" }, ...meta },
|
|
2271
|
+
{ name: "TracingStartedInBrowser", ...meta, cat: "disabled-by-default-devtools.timeline" }
|
|
2272
|
+
].map((v) => JSON.stringify(v)).join(",\n")
|
|
2245
2273
|
);
|
|
2246
2274
|
}
|
|
2247
2275
|
tracingEnabled2.startTracing = startTracing2;
|
|
@@ -3871,11 +3899,11 @@ function createDirectoryWatcherSupportingRecursive({
|
|
|
3871
3899
|
return some(ignoredPaths, (searchPath) => isInPath(path2, searchPath)) || isIgnoredByWatchOptions(path2, options, useCaseSensitiveFileNames2, getCurrentDirectory);
|
|
3872
3900
|
}
|
|
3873
3901
|
function isInPath(path2, searchPath) {
|
|
3874
|
-
if (path2
|
|
3902
|
+
if (stringContains(path2, searchPath))
|
|
3875
3903
|
return true;
|
|
3876
3904
|
if (useCaseSensitiveFileNames2)
|
|
3877
3905
|
return false;
|
|
3878
|
-
return toCanonicalFilePath(path2)
|
|
3906
|
+
return stringContains(toCanonicalFilePath(path2), searchPath);
|
|
3879
3907
|
}
|
|
3880
3908
|
}
|
|
3881
3909
|
function createFileWatcherCallback(callback) {
|
|
@@ -4679,9 +4707,7 @@ var sys = (() => {
|
|
|
4679
4707
|
})();
|
|
4680
4708
|
if (sys && sys.getEnvironmentVariable) {
|
|
4681
4709
|
setCustomPollingValues(sys);
|
|
4682
|
-
Debug.setAssertionLevel(
|
|
4683
|
-
/^development$/i.test(sys.getEnvironmentVariable("NODE_ENV")) ? 1 /* Normal */ : 0 /* None */
|
|
4684
|
-
);
|
|
4710
|
+
Debug.setAssertionLevel(/^development$/i.test(sys.getEnvironmentVariable("NODE_ENV")) ? 1 /* Normal */ : 0 /* None */);
|
|
4685
4711
|
}
|
|
4686
4712
|
if (sys && sys.debugMode) {
|
|
4687
4713
|
Debug.isDebugging = true;
|
|
@@ -4705,7 +4731,7 @@ function pathIsRelative(path2) {
|
|
|
4705
4731
|
return /^\.\.?($|[\\/])/.test(path2);
|
|
4706
4732
|
}
|
|
4707
4733
|
function hasExtension(fileName) {
|
|
4708
|
-
return getBaseFileName(fileName)
|
|
4734
|
+
return stringContains(getBaseFileName(fileName), ".");
|
|
4709
4735
|
}
|
|
4710
4736
|
function fileExtensionIs(path2, extension) {
|
|
4711
4737
|
return path2.length > extension.length && endsWith(path2, extension);
|
|
@@ -4850,7 +4876,7 @@ function getPathFromPathComponents(pathComponents2, length2) {
|
|
|
4850
4876
|
return root + pathComponents2.slice(1, length2).join(directorySeparator);
|
|
4851
4877
|
}
|
|
4852
4878
|
function normalizeSlashes(path2) {
|
|
4853
|
-
return path2.
|
|
4879
|
+
return path2.indexOf("\\") !== -1 ? path2.replace(backslashRegExp, directorySeparator) : path2;
|
|
4854
4880
|
}
|
|
4855
4881
|
function reducePathComponents(components) {
|
|
4856
4882
|
if (!some(components))
|
|
@@ -5998,9 +6024,9 @@ var Diagnostics = {
|
|
|
5998
6024
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
|
|
5999
6025
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1 /* Error */, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
6000
6026
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1 /* Error */, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6027
|
+
Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),
|
|
6028
|
+
Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),
|
|
6029
|
+
Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, 1 /* Error */, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),
|
|
6004
6030
|
Import_assertion_values_must_be_string_literal_expressions: diag(2837, 1 /* Error */, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
|
|
6005
6031
|
All_declarations_of_0_must_have_identical_constraints: diag(2838, 1 /* Error */, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
|
|
6006
6032
|
This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, 1 /* Error */, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."),
|
|
@@ -8122,7 +8148,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8122
8148
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
8123
8149
|
if (shouldEmitInvalidEscapeError) {
|
|
8124
8150
|
const code = parseInt(text.substring(start2 + 1, pos), 8);
|
|
8125
|
-
error(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start2, pos - start2, "\\x" + code.toString(16)
|
|
8151
|
+
error(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start2, pos - start2, "\\x" + padLeft(code.toString(16), 2, "0"));
|
|
8126
8152
|
return String.fromCharCode(code);
|
|
8127
8153
|
}
|
|
8128
8154
|
return text.substring(start2, pos);
|
|
@@ -8925,7 +8951,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8925
8951
|
return token;
|
|
8926
8952
|
}
|
|
8927
8953
|
function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) {
|
|
8928
|
-
const type = getDirectiveFromComment(text2
|
|
8954
|
+
const type = getDirectiveFromComment(trimStringStart(text2), commentDirectiveRegEx);
|
|
8929
8955
|
if (type === void 0) {
|
|
8930
8956
|
return commentDirectives2;
|
|
8931
8957
|
}
|
|
@@ -9259,9 +9285,20 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9259
9285
|
inJSDocType += inType ? 1 : -1;
|
|
9260
9286
|
}
|
|
9261
9287
|
}
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9288
|
+
var codePointAt = String.prototype.codePointAt ? (s, i) => s.codePointAt(i) : function codePointAt2(str, i) {
|
|
9289
|
+
const size = str.length;
|
|
9290
|
+
if (i < 0 || i >= size) {
|
|
9291
|
+
return void 0;
|
|
9292
|
+
}
|
|
9293
|
+
const first2 = str.charCodeAt(i);
|
|
9294
|
+
if (first2 >= 55296 && first2 <= 56319 && size > i + 1) {
|
|
9295
|
+
const second = str.charCodeAt(i + 1);
|
|
9296
|
+
if (second >= 56320 && second <= 57343) {
|
|
9297
|
+
return (first2 - 55296) * 1024 + second - 56320 + 65536;
|
|
9298
|
+
}
|
|
9299
|
+
}
|
|
9300
|
+
return first2;
|
|
9301
|
+
};
|
|
9265
9302
|
function charSize(ch) {
|
|
9266
9303
|
if (ch >= 65536) {
|
|
9267
9304
|
return 2;
|
|
@@ -10088,7 +10125,7 @@ function getTextOfNodeFromSourceText(sourceText, node, includeTrivia = false) {
|
|
|
10088
10125
|
}
|
|
10089
10126
|
let text = sourceText.substring(includeTrivia ? node.pos : skipTrivia(sourceText, node.pos), node.end);
|
|
10090
10127
|
if (isJSDocTypeExpressionOrChild(node)) {
|
|
10091
|
-
text = text.split(/\r\n|\n|\r/).map((line) => line.replace(/^\s*\*/, "")
|
|
10128
|
+
text = text.split(/\r\n|\n|\r/).map((line) => trimStringStart(line.replace(/^\s*\*/, ""))).join("\n");
|
|
10092
10129
|
}
|
|
10093
10130
|
return text;
|
|
10094
10131
|
}
|
|
@@ -10987,17 +11024,21 @@ function closeFileWatcher(watcher) {
|
|
|
10987
11024
|
}
|
|
10988
11025
|
function getLastChild(node) {
|
|
10989
11026
|
let lastChild;
|
|
10990
|
-
forEachChild(
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
11027
|
+
forEachChild(
|
|
11028
|
+
node,
|
|
11029
|
+
(child) => {
|
|
11030
|
+
if (nodeIsPresent(child))
|
|
11031
|
+
lastChild = child;
|
|
11032
|
+
},
|
|
11033
|
+
(children) => {
|
|
11034
|
+
for (let i = children.length - 1; i >= 0; i--) {
|
|
11035
|
+
if (nodeIsPresent(children[i])) {
|
|
11036
|
+
lastChild = children[i];
|
|
11037
|
+
break;
|
|
11038
|
+
}
|
|
10998
11039
|
}
|
|
10999
11040
|
}
|
|
11000
|
-
|
|
11041
|
+
);
|
|
11001
11042
|
return lastChild;
|
|
11002
11043
|
}
|
|
11003
11044
|
function isTypeNodeKind(kind) {
|
|
@@ -18312,9 +18353,9 @@ var Parser;
|
|
|
18312
18353
|
/*allowReservedWords*/
|
|
18313
18354
|
true
|
|
18314
18355
|
);
|
|
18315
|
-
const
|
|
18356
|
+
const isInvalid = token() === 1 /* EndOfFileToken */ && !parseDiagnostics.length;
|
|
18316
18357
|
clearState();
|
|
18317
|
-
return
|
|
18358
|
+
return isInvalid ? entityName : void 0;
|
|
18318
18359
|
}
|
|
18319
18360
|
Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
|
|
18320
18361
|
function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
|
|
@@ -21757,9 +21798,7 @@ var Parser;
|
|
|
21757
21798
|
let dotDotDotToken;
|
|
21758
21799
|
let expression;
|
|
21759
21800
|
if (token() !== 20 /* CloseBraceToken */) {
|
|
21760
|
-
|
|
21761
|
-
dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */);
|
|
21762
|
-
}
|
|
21801
|
+
dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */);
|
|
21763
21802
|
expression = parseExpression();
|
|
21764
21803
|
}
|
|
21765
21804
|
if (inExpressionContext) {
|
|
@@ -23540,7 +23579,7 @@ var Parser;
|
|
|
23540
23579
|
}
|
|
23541
23580
|
function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiers, flags) {
|
|
23542
23581
|
const namespaceFlag = flags & 32 /* Namespace */;
|
|
23543
|
-
const name =
|
|
23582
|
+
const name = parseIdentifier();
|
|
23544
23583
|
const body = parseOptional(25 /* DotToken */) ? parseModuleOrNamespaceDeclaration(
|
|
23545
23584
|
getNodePos(),
|
|
23546
23585
|
/*hasJSDoc*/
|
|
@@ -24010,6 +24049,8 @@ var Parser;
|
|
|
24010
24049
|
PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter";
|
|
24011
24050
|
})(PropertyLikeParse || (PropertyLikeParse = {}));
|
|
24012
24051
|
function parseJSDocCommentWorker(start = 0, length2) {
|
|
24052
|
+
const saveParsingContext = parsingContext;
|
|
24053
|
+
parsingContext |= 1 << 25 /* JSDocComment */;
|
|
24013
24054
|
const content = sourceText;
|
|
24014
24055
|
const end = length2 === void 0 ? content.length : start + length2;
|
|
24015
24056
|
length2 = end - start;
|
|
@@ -24026,8 +24067,6 @@ var Parser;
|
|
|
24026
24067
|
let commentsPos;
|
|
24027
24068
|
let comments = [];
|
|
24028
24069
|
const parts = [];
|
|
24029
|
-
const saveParsingContext = parsingContext;
|
|
24030
|
-
parsingContext |= 1 << 25 /* JSDocComment */;
|
|
24031
24070
|
const result = scanner.scanRange(start + 3, length2 - 5, doJSDocScan);
|
|
24032
24071
|
parsingContext = saveParsingContext;
|
|
24033
24072
|
return result;
|
|
@@ -24119,7 +24158,7 @@ var Parser;
|
|
|
24119
24158
|
nextTokenJSDoc();
|
|
24120
24159
|
}
|
|
24121
24160
|
}
|
|
24122
|
-
const trimmedComments = comments.join("")
|
|
24161
|
+
const trimmedComments = trimStringEnd(comments.join(""));
|
|
24123
24162
|
if (parts.length && trimmedComments.length) {
|
|
24124
24163
|
parts.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd ?? start, commentsPos));
|
|
24125
24164
|
}
|
|
@@ -24135,7 +24174,7 @@ var Parser;
|
|
|
24135
24174
|
}
|
|
24136
24175
|
function removeTrailingWhitespace(comments2) {
|
|
24137
24176
|
while (comments2.length) {
|
|
24138
|
-
const trimmed = comments2[comments2.length - 1]
|
|
24177
|
+
const trimmed = trimStringEnd(comments2[comments2.length - 1]);
|
|
24139
24178
|
if (trimmed === "") {
|
|
24140
24179
|
comments2.pop();
|
|
24141
24180
|
} else if (trimmed.length < comments2[comments2.length - 1].length) {
|
|
@@ -24375,7 +24414,7 @@ var Parser;
|
|
|
24375
24414
|
}
|
|
24376
24415
|
}
|
|
24377
24416
|
removeLeadingNewlines(comments2);
|
|
24378
|
-
const trimmedComments = comments2.join("")
|
|
24417
|
+
const trimmedComments = trimStringEnd(comments2.join(""));
|
|
24379
24418
|
if (parts2.length) {
|
|
24380
24419
|
if (trimmedComments.length) {
|
|
24381
24420
|
parts2.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd2 ?? commentsPos2));
|
|
@@ -24940,7 +24979,16 @@ var IncrementalParser;
|
|
|
24940
24979
|
Debug.assert(textSpanEnd(changeRange.span) === textSpanEnd(textChangeRange.span));
|
|
24941
24980
|
Debug.assert(textSpanEnd(textChangeRangeNewSpan(changeRange)) === textSpanEnd(textChangeRangeNewSpan(textChangeRange)));
|
|
24942
24981
|
const delta = textChangeRangeNewSpan(changeRange).length - changeRange.span.length;
|
|
24943
|
-
updateTokenPositionsAndMarkElements(
|
|
24982
|
+
updateTokenPositionsAndMarkElements(
|
|
24983
|
+
incrementalSourceFile,
|
|
24984
|
+
changeRange.span.start,
|
|
24985
|
+
textSpanEnd(changeRange.span),
|
|
24986
|
+
textSpanEnd(textChangeRangeNewSpan(changeRange)),
|
|
24987
|
+
delta,
|
|
24988
|
+
oldText,
|
|
24989
|
+
newText,
|
|
24990
|
+
aggressiveChecks
|
|
24991
|
+
);
|
|
24944
24992
|
const result = Parser.parseSourceFile(
|
|
24945
24993
|
sourceFile.fileName,
|
|
24946
24994
|
newText,
|
|
@@ -25273,7 +25321,7 @@ var IncrementalParser;
|
|
|
25273
25321
|
})(InvalidPosition || (InvalidPosition = {}));
|
|
25274
25322
|
})(IncrementalParser || (IncrementalParser = {}));
|
|
25275
25323
|
function isDeclarationFileName(fileName) {
|
|
25276
|
-
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName)
|
|
25324
|
+
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && stringContains(getBaseFileName(fileName), ".d.");
|
|
25277
25325
|
}
|
|
25278
25326
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
25279
25327
|
if (!mode) {
|
|
@@ -25459,7 +25507,7 @@ function getNamedPragmaArguments(pragma, text) {
|
|
|
25459
25507
|
return {};
|
|
25460
25508
|
if (!pragma.args)
|
|
25461
25509
|
return {};
|
|
25462
|
-
const args = text
|
|
25510
|
+
const args = trimString(text).split(/\s+/);
|
|
25463
25511
|
const argMap = {};
|
|
25464
25512
|
for (let i = 0; i < pragma.args.length; i++) {
|
|
25465
25513
|
const argument = pragma.args[i];
|
|
@@ -27798,7 +27846,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
27798
27846
|
result = tryResolve(extensions, state);
|
|
27799
27847
|
}
|
|
27800
27848
|
let legacyResult;
|
|
27801
|
-
if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.
|
|
27849
|
+
if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.indexOf("import") > -1) {
|
|
27802
27850
|
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
27803
27851
|
const diagnosticState = {
|
|
27804
27852
|
...state,
|
|
@@ -27842,7 +27890,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
27842
27890
|
resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
27843
27891
|
}
|
|
27844
27892
|
if (!resolved2) {
|
|
27845
|
-
if (moduleName.
|
|
27893
|
+
if (moduleName.indexOf(":") > -1) {
|
|
27846
27894
|
if (traceEnabled) {
|
|
27847
27895
|
trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
27848
27896
|
}
|
|
@@ -27887,6 +27935,7 @@ function realPath(path2, host, traceEnabled) {
|
|
|
27887
27935
|
if (traceEnabled) {
|
|
27888
27936
|
trace(host, Diagnostics.Resolving_real_path_for_0_result_1, path2, real);
|
|
27889
27937
|
}
|
|
27938
|
+
Debug.assert(host.fileExists(real), `${path2} linked to nonexistent file ${real}`);
|
|
27890
27939
|
return real;
|
|
27891
27940
|
}
|
|
27892
27941
|
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
|
|
@@ -27931,7 +27980,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
|
|
|
27931
27980
|
}
|
|
27932
27981
|
var nodeModulesPathPart = "/node_modules/";
|
|
27933
27982
|
function pathContainsNodeModules(path2) {
|
|
27934
|
-
return path2
|
|
27983
|
+
return stringContains(path2, nodeModulesPathPart);
|
|
27935
27984
|
}
|
|
27936
27985
|
function parseNodeModuleFromPath(resolved, isFolder) {
|
|
27937
27986
|
const path2 = normalizePath(resolved);
|
|
@@ -27967,7 +28016,7 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
|
|
|
27967
28016
|
}
|
|
27968
28017
|
function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
|
|
27969
28018
|
const filename = getBaseFileName(candidate);
|
|
27970
|
-
if (
|
|
28019
|
+
if (filename.indexOf(".") === -1) {
|
|
27971
28020
|
return void 0;
|
|
27972
28021
|
}
|
|
27973
28022
|
let extensionless = removeFileExtension(candidate);
|
|
@@ -28375,7 +28424,7 @@ function comparePatternKeys(a, b) {
|
|
|
28375
28424
|
}
|
|
28376
28425
|
function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
|
|
28377
28426
|
const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
|
|
28378
|
-
if (!endsWith(moduleName, directorySeparator) &&
|
|
28427
|
+
if (!endsWith(moduleName, directorySeparator) && moduleName.indexOf("*") === -1 && hasProperty(lookupTable, moduleName)) {
|
|
28379
28428
|
const target = lookupTable[moduleName];
|
|
28380
28429
|
return loadModuleFromTargetImportOrExport(
|
|
28381
28430
|
target,
|
|
@@ -28386,7 +28435,7 @@ function loadModuleFromImportsOrExports(extensions, state, cache, redirectedRefe
|
|
|
28386
28435
|
moduleName
|
|
28387
28436
|
);
|
|
28388
28437
|
}
|
|
28389
|
-
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.
|
|
28438
|
+
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.indexOf("*") !== -1 || endsWith(k, "/")), comparePatternKeys);
|
|
28390
28439
|
for (const potentialTarget of expandingKeys) {
|
|
28391
28440
|
if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
|
|
28392
28441
|
const target = lookupTable[potentialTarget];
|
|
@@ -28460,15 +28509,13 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
28460
28509
|
false,
|
|
28461
28510
|
redirectedReference
|
|
28462
28511
|
);
|
|
28463
|
-
return toSearchResult(
|
|
28464
|
-
result.resolvedModule
|
|
28465
|
-
|
|
28466
|
-
|
|
28467
|
-
|
|
28468
|
-
|
|
28469
|
-
|
|
28470
|
-
} : void 0
|
|
28471
|
-
);
|
|
28512
|
+
return toSearchResult(result.resolvedModule ? {
|
|
28513
|
+
path: result.resolvedModule.resolvedFileName,
|
|
28514
|
+
extension: result.resolvedModule.extension,
|
|
28515
|
+
packageId: result.resolvedModule.packageId,
|
|
28516
|
+
originalPath: result.resolvedModule.originalPath,
|
|
28517
|
+
resolvedUsingTsExtension: result.resolvedModule.resolvedUsingTsExtension
|
|
28518
|
+
} : void 0);
|
|
28472
28519
|
}
|
|
28473
28520
|
if (state.traceEnabled) {
|
|
28474
28521
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
@@ -28480,7 +28527,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
28480
28527
|
}
|
|
28481
28528
|
const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target);
|
|
28482
28529
|
const partsAfterFirst = parts.slice(1);
|
|
28483
|
-
if (partsAfterFirst.
|
|
28530
|
+
if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
|
|
28484
28531
|
if (state.traceEnabled) {
|
|
28485
28532
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
28486
28533
|
}
|
|
@@ -28491,7 +28538,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
28491
28538
|
}
|
|
28492
28539
|
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
28493
28540
|
const subpathParts = getPathComponents(subpath);
|
|
28494
|
-
if (subpathParts.
|
|
28541
|
+
if (subpathParts.indexOf("..") >= 0 || subpathParts.indexOf(".") >= 0 || subpathParts.indexOf("node_modules") >= 0) {
|
|
28495
28542
|
if (state.traceEnabled) {
|
|
28496
28543
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
28497
28544
|
}
|
|
@@ -28501,7 +28548,13 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
28501
28548
|
);
|
|
28502
28549
|
}
|
|
28503
28550
|
if (state.traceEnabled) {
|
|
28504
|
-
trace(
|
|
28551
|
+
trace(
|
|
28552
|
+
state.host,
|
|
28553
|
+
Diagnostics.Using_0_subpath_1_with_target_2,
|
|
28554
|
+
isImports ? "imports" : "exports",
|
|
28555
|
+
key,
|
|
28556
|
+
pattern ? target.replace(/\*/g, subpath) : target + subpath
|
|
28557
|
+
);
|
|
28505
28558
|
}
|
|
28506
28559
|
const finalPath = toAbsolutePath(pattern ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath);
|
|
28507
28560
|
const inputLink = tryLoadInputFileForPath(finalPath, subpath, combinePaths(scope.packageDirectory, "package.json"), isImports);
|
|
@@ -28518,7 +28571,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
28518
28571
|
if (!Array.isArray(target)) {
|
|
28519
28572
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
28520
28573
|
for (const condition of getOwnKeys(target)) {
|
|
28521
|
-
if (condition === "default" || state.conditions.
|
|
28574
|
+
if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) {
|
|
28522
28575
|
traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition);
|
|
28523
28576
|
const subTarget = target[condition];
|
|
28524
28577
|
const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key);
|
|
@@ -28579,7 +28632,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
28579
28632
|
}
|
|
28580
28633
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
28581
28634
|
var _a, _b, _c, _d;
|
|
28582
|
-
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) &&
|
|
28635
|
+
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) {
|
|
28583
28636
|
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
|
28584
28637
|
const commonSourceDirGuesses = [];
|
|
28585
28638
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
@@ -28653,7 +28706,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
28653
28706
|
}
|
|
28654
28707
|
}
|
|
28655
28708
|
function isApplicableVersionedTypesKey(conditions, key) {
|
|
28656
|
-
if (
|
|
28709
|
+
if (conditions.indexOf("types") === -1)
|
|
28657
28710
|
return false;
|
|
28658
28711
|
if (!startsWith(key, "types@"))
|
|
28659
28712
|
return false;
|
|
@@ -31040,16 +31093,13 @@ var BuilderState;
|
|
|
31040
31093
|
sourceFile,
|
|
31041
31094
|
(fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => {
|
|
31042
31095
|
Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`);
|
|
31043
|
-
onNewSignature(
|
|
31044
|
-
|
|
31045
|
-
|
|
31046
|
-
|
|
31047
|
-
|
|
31048
|
-
|
|
31049
|
-
|
|
31050
|
-
),
|
|
31051
|
-
sourceFiles
|
|
31052
|
-
);
|
|
31096
|
+
onNewSignature(computeSignatureWithDiagnostics(
|
|
31097
|
+
programOfThisState,
|
|
31098
|
+
sourceFile,
|
|
31099
|
+
text,
|
|
31100
|
+
host,
|
|
31101
|
+
data
|
|
31102
|
+
), sourceFiles);
|
|
31053
31103
|
},
|
|
31054
31104
|
cancellationToken,
|
|
31055
31105
|
/*emitOnly*/
|
|
@@ -31232,7 +31282,9 @@ function computeSignatureWithDiagnostics(program, sourceFile, text, host, data)
|
|
|
31232
31282
|
text = getTextHandlingSourceMapForSignature(text, data);
|
|
31233
31283
|
let sourceFileDirectory;
|
|
31234
31284
|
if ((_a = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a.length) {
|
|
31235
|
-
text += data.diagnostics.map(
|
|
31285
|
+
text += data.diagnostics.map(
|
|
31286
|
+
(diagnostic) => `${locationInfo(diagnostic)}${DiagnosticCategory[diagnostic.category]}${diagnostic.code}: ${flattenDiagnosticMessageText2(diagnostic.messageText)}`
|
|
31287
|
+
).join("\n");
|
|
31236
31288
|
}
|
|
31237
31289
|
return (host.createHash ?? generateDjb2Hash)(text);
|
|
31238
31290
|
function flattenDiagnosticMessageText2(diagnostic) {
|
|
@@ -31601,7 +31653,7 @@ var Arguments;
|
|
|
31601
31653
|
Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
|
|
31602
31654
|
})(Arguments || (Arguments = {}));
|
|
31603
31655
|
function hasArgument(argumentName) {
|
|
31604
|
-
return sys.args.
|
|
31656
|
+
return sys.args.indexOf(argumentName) >= 0;
|
|
31605
31657
|
}
|
|
31606
31658
|
function findArgument(argumentName) {
|
|
31607
31659
|
const index = sys.args.indexOf(argumentName);
|
|
@@ -31609,7 +31661,7 @@ function findArgument(argumentName) {
|
|
|
31609
31661
|
}
|
|
31610
31662
|
function nowString() {
|
|
31611
31663
|
const d = /* @__PURE__ */ new Date();
|
|
31612
|
-
return `${d.getHours().toString()
|
|
31664
|
+
return `${padLeft(d.getHours().toString(), 2, "0")}:${padLeft(d.getMinutes().toString(), 2, "0")}:${padLeft(d.getSeconds().toString(), 2, "0")}.${padLeft(d.getMilliseconds().toString(), 3, "0")}`;
|
|
31613
31665
|
}
|
|
31614
31666
|
|
|
31615
31667
|
// src/typingsInstallerCore/typingsInstaller.ts
|
|
@@ -32028,7 +32080,7 @@ var NodeTypingsInstaller = class extends TypingsInstaller {
|
|
|
32028
32080
|
log2
|
|
32029
32081
|
);
|
|
32030
32082
|
this.npmPath = npmLocation2 !== void 0 ? npmLocation2 : getDefaultNPMLocation(process.argv[0], validateDefaultNpmLocation2, this.installTypingHost);
|
|
32031
|
-
if (this.npmPath
|
|
32083
|
+
if (stringContains(this.npmPath, " ") && this.npmPath[0] !== `"`) {
|
|
32032
32084
|
this.npmPath = `"${this.npmPath}"`;
|
|
32033
32085
|
}
|
|
32034
32086
|
if (this.log.isEnabled()) {
|