@typescript-deploys/pr-build 5.4.0-pr-56555-7 → 5.4.0-pr-56742-5
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/lib/tsc.js +268 -107
- package/lib/tsserver.js +271 -123
- package/lib/typescript.d.ts +14 -0
- package/lib/typescript.js +271 -124
- package/lib/typingsInstaller.js +222 -35
- package/package.json +3 -4
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20231211`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -16362,38 +16362,231 @@ function getSetExternalModuleIndicator(options) {
|
|
|
16362
16362
|
return callback;
|
|
16363
16363
|
}
|
|
16364
16364
|
}
|
|
16365
|
-
function
|
|
16366
|
-
return
|
|
16367
|
-
}
|
|
16368
|
-
function getEmitModuleKind(compilerOptions) {
|
|
16369
|
-
return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
|
|
16365
|
+
function createComputedCompilerOptions(options) {
|
|
16366
|
+
return options;
|
|
16370
16367
|
}
|
|
16368
|
+
var computedOptions = createComputedCompilerOptions({
|
|
16369
|
+
target: {
|
|
16370
|
+
dependencies: ["module"],
|
|
16371
|
+
computeValue: (compilerOptions) => {
|
|
16372
|
+
return compilerOptions.target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
|
|
16373
|
+
}
|
|
16374
|
+
},
|
|
16375
|
+
module: {
|
|
16376
|
+
dependencies: ["target"],
|
|
16377
|
+
computeValue: (compilerOptions) => {
|
|
16378
|
+
return typeof compilerOptions.module === "number" ? compilerOptions.module : computedOptions.target.computeValue(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
|
|
16379
|
+
}
|
|
16380
|
+
},
|
|
16381
|
+
moduleResolution: {
|
|
16382
|
+
dependencies: ["module", "target"],
|
|
16383
|
+
computeValue: (compilerOptions) => {
|
|
16384
|
+
let moduleResolution = compilerOptions.moduleResolution;
|
|
16385
|
+
if (moduleResolution === void 0) {
|
|
16386
|
+
switch (computedOptions.module.computeValue(compilerOptions)) {
|
|
16387
|
+
case 1 /* CommonJS */:
|
|
16388
|
+
moduleResolution = 2 /* Node10 */;
|
|
16389
|
+
break;
|
|
16390
|
+
case 100 /* Node16 */:
|
|
16391
|
+
moduleResolution = 3 /* Node16 */;
|
|
16392
|
+
break;
|
|
16393
|
+
case 199 /* NodeNext */:
|
|
16394
|
+
moduleResolution = 99 /* NodeNext */;
|
|
16395
|
+
break;
|
|
16396
|
+
default:
|
|
16397
|
+
moduleResolution = 1 /* Classic */;
|
|
16398
|
+
break;
|
|
16399
|
+
}
|
|
16400
|
+
}
|
|
16401
|
+
return moduleResolution;
|
|
16402
|
+
}
|
|
16403
|
+
},
|
|
16404
|
+
moduleDetection: {
|
|
16405
|
+
dependencies: ["module", "target"],
|
|
16406
|
+
computeValue: (compilerOptions) => {
|
|
16407
|
+
return compilerOptions.moduleDetection || (computedOptions.module.computeValue(compilerOptions) === 100 /* Node16 */ || computedOptions.module.computeValue(compilerOptions) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
|
|
16408
|
+
}
|
|
16409
|
+
},
|
|
16410
|
+
isolatedModules: {
|
|
16411
|
+
dependencies: ["verbatimModuleSyntax"],
|
|
16412
|
+
computeValue: (compilerOptions) => {
|
|
16413
|
+
return !!(compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax);
|
|
16414
|
+
}
|
|
16415
|
+
},
|
|
16416
|
+
esModuleInterop: {
|
|
16417
|
+
dependencies: ["module", "target"],
|
|
16418
|
+
computeValue: (compilerOptions) => {
|
|
16419
|
+
if (compilerOptions.esModuleInterop !== void 0) {
|
|
16420
|
+
return compilerOptions.esModuleInterop;
|
|
16421
|
+
}
|
|
16422
|
+
switch (computedOptions.module.computeValue(compilerOptions)) {
|
|
16423
|
+
case 100 /* Node16 */:
|
|
16424
|
+
case 199 /* NodeNext */:
|
|
16425
|
+
return true;
|
|
16426
|
+
}
|
|
16427
|
+
return false;
|
|
16428
|
+
}
|
|
16429
|
+
},
|
|
16430
|
+
allowSyntheticDefaultImports: {
|
|
16431
|
+
dependencies: ["module", "target", "moduleResolution"],
|
|
16432
|
+
computeValue: (compilerOptions) => {
|
|
16433
|
+
if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
|
|
16434
|
+
return compilerOptions.allowSyntheticDefaultImports;
|
|
16435
|
+
}
|
|
16436
|
+
return computedOptions.esModuleInterop.computeValue(compilerOptions) || computedOptions.module.computeValue(compilerOptions) === 4 /* System */ || computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
|
|
16437
|
+
}
|
|
16438
|
+
},
|
|
16439
|
+
resolvePackageJsonExports: {
|
|
16440
|
+
dependencies: ["moduleResolution"],
|
|
16441
|
+
computeValue: (compilerOptions) => {
|
|
16442
|
+
const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
|
|
16443
|
+
if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
16444
|
+
return false;
|
|
16445
|
+
}
|
|
16446
|
+
if (compilerOptions.resolvePackageJsonExports !== void 0) {
|
|
16447
|
+
return compilerOptions.resolvePackageJsonExports;
|
|
16448
|
+
}
|
|
16449
|
+
switch (moduleResolution) {
|
|
16450
|
+
case 3 /* Node16 */:
|
|
16451
|
+
case 99 /* NodeNext */:
|
|
16452
|
+
case 100 /* Bundler */:
|
|
16453
|
+
return true;
|
|
16454
|
+
}
|
|
16455
|
+
return false;
|
|
16456
|
+
}
|
|
16457
|
+
},
|
|
16458
|
+
resolvePackageJsonImports: {
|
|
16459
|
+
dependencies: ["moduleResolution", "resolvePackageJsonExports"],
|
|
16460
|
+
computeValue: (compilerOptions) => {
|
|
16461
|
+
const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
|
|
16462
|
+
if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
16463
|
+
return false;
|
|
16464
|
+
}
|
|
16465
|
+
if (compilerOptions.resolvePackageJsonExports !== void 0) {
|
|
16466
|
+
return compilerOptions.resolvePackageJsonExports;
|
|
16467
|
+
}
|
|
16468
|
+
switch (moduleResolution) {
|
|
16469
|
+
case 3 /* Node16 */:
|
|
16470
|
+
case 99 /* NodeNext */:
|
|
16471
|
+
case 100 /* Bundler */:
|
|
16472
|
+
return true;
|
|
16473
|
+
}
|
|
16474
|
+
return false;
|
|
16475
|
+
}
|
|
16476
|
+
},
|
|
16477
|
+
resolveJsonModule: {
|
|
16478
|
+
dependencies: ["moduleResolution", "module", "target"],
|
|
16479
|
+
computeValue: (compilerOptions) => {
|
|
16480
|
+
if (compilerOptions.resolveJsonModule !== void 0) {
|
|
16481
|
+
return compilerOptions.resolveJsonModule;
|
|
16482
|
+
}
|
|
16483
|
+
return computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
|
|
16484
|
+
}
|
|
16485
|
+
},
|
|
16486
|
+
declaration: {
|
|
16487
|
+
dependencies: ["composite"],
|
|
16488
|
+
computeValue: (compilerOptions) => {
|
|
16489
|
+
return !!(compilerOptions.declaration || compilerOptions.composite);
|
|
16490
|
+
}
|
|
16491
|
+
},
|
|
16492
|
+
preserveConstEnums: {
|
|
16493
|
+
dependencies: ["isolatedModules", "verbatimModuleSyntax"],
|
|
16494
|
+
computeValue: (compilerOptions) => {
|
|
16495
|
+
return !!(compilerOptions.preserveConstEnums || computedOptions.isolatedModules.computeValue(compilerOptions));
|
|
16496
|
+
}
|
|
16497
|
+
},
|
|
16498
|
+
incremental: {
|
|
16499
|
+
dependencies: ["composite"],
|
|
16500
|
+
computeValue: (compilerOptions) => {
|
|
16501
|
+
return !!(compilerOptions.incremental || compilerOptions.composite);
|
|
16502
|
+
}
|
|
16503
|
+
},
|
|
16504
|
+
declarationMap: {
|
|
16505
|
+
dependencies: ["declaration", "composite"],
|
|
16506
|
+
computeValue: (compilerOptions) => {
|
|
16507
|
+
return !!(compilerOptions.declarationMap && computedOptions.declaration.computeValue(compilerOptions));
|
|
16508
|
+
}
|
|
16509
|
+
},
|
|
16510
|
+
allowJs: {
|
|
16511
|
+
dependencies: ["checkJs"],
|
|
16512
|
+
computeValue: (compilerOptions) => {
|
|
16513
|
+
return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs;
|
|
16514
|
+
}
|
|
16515
|
+
},
|
|
16516
|
+
useDefineForClassFields: {
|
|
16517
|
+
dependencies: ["target", "module"],
|
|
16518
|
+
computeValue: (compilerOptions) => {
|
|
16519
|
+
return compilerOptions.useDefineForClassFields === void 0 ? computedOptions.target.computeValue(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
|
|
16520
|
+
}
|
|
16521
|
+
},
|
|
16522
|
+
noImplicitAny: {
|
|
16523
|
+
dependencies: ["strict"],
|
|
16524
|
+
computeValue: (compilerOptions) => {
|
|
16525
|
+
return getStrictOptionValue(compilerOptions, "noImplicitAny");
|
|
16526
|
+
}
|
|
16527
|
+
},
|
|
16528
|
+
noImplicitThis: {
|
|
16529
|
+
dependencies: ["strict"],
|
|
16530
|
+
computeValue: (compilerOptions) => {
|
|
16531
|
+
return getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
16532
|
+
}
|
|
16533
|
+
},
|
|
16534
|
+
strictNullChecks: {
|
|
16535
|
+
dependencies: ["strict"],
|
|
16536
|
+
computeValue: (compilerOptions) => {
|
|
16537
|
+
return getStrictOptionValue(compilerOptions, "strictNullChecks");
|
|
16538
|
+
}
|
|
16539
|
+
},
|
|
16540
|
+
strictFunctionTypes: {
|
|
16541
|
+
dependencies: ["strict"],
|
|
16542
|
+
computeValue: (compilerOptions) => {
|
|
16543
|
+
return getStrictOptionValue(compilerOptions, "strictFunctionTypes");
|
|
16544
|
+
}
|
|
16545
|
+
},
|
|
16546
|
+
strictBindCallApply: {
|
|
16547
|
+
dependencies: ["strict"],
|
|
16548
|
+
computeValue: (compilerOptions) => {
|
|
16549
|
+
return getStrictOptionValue(compilerOptions, "strictBindCallApply");
|
|
16550
|
+
}
|
|
16551
|
+
},
|
|
16552
|
+
strictPropertyInitialization: {
|
|
16553
|
+
dependencies: ["strict"],
|
|
16554
|
+
computeValue: (compilerOptions) => {
|
|
16555
|
+
return getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
|
|
16556
|
+
}
|
|
16557
|
+
},
|
|
16558
|
+
alwaysStrict: {
|
|
16559
|
+
dependencies: ["strict"],
|
|
16560
|
+
computeValue: (compilerOptions) => {
|
|
16561
|
+
return getStrictOptionValue(compilerOptions, "alwaysStrict");
|
|
16562
|
+
}
|
|
16563
|
+
},
|
|
16564
|
+
useUnknownInCatchVariables: {
|
|
16565
|
+
dependencies: ["strict"],
|
|
16566
|
+
computeValue: (compilerOptions) => {
|
|
16567
|
+
return getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
16568
|
+
}
|
|
16569
|
+
}
|
|
16570
|
+
});
|
|
16571
|
+
var getEmitScriptTarget = computedOptions.target.computeValue;
|
|
16572
|
+
var getEmitModuleKind = computedOptions.module.computeValue;
|
|
16573
|
+
var getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue;
|
|
16574
|
+
var getEmitModuleDetectionKind = computedOptions.moduleDetection.computeValue;
|
|
16575
|
+
var getIsolatedModules = computedOptions.isolatedModules.computeValue;
|
|
16576
|
+
var getESModuleInterop = computedOptions.esModuleInterop.computeValue;
|
|
16577
|
+
var getAllowSyntheticDefaultImports = computedOptions.allowSyntheticDefaultImports.computeValue;
|
|
16578
|
+
var getResolvePackageJsonExports = computedOptions.resolvePackageJsonExports.computeValue;
|
|
16579
|
+
var getResolvePackageJsonImports = computedOptions.resolvePackageJsonImports.computeValue;
|
|
16580
|
+
var getResolveJsonModule = computedOptions.resolveJsonModule.computeValue;
|
|
16581
|
+
var getEmitDeclarations = computedOptions.declaration.computeValue;
|
|
16582
|
+
var shouldPreserveConstEnums = computedOptions.preserveConstEnums.computeValue;
|
|
16583
|
+
var isIncrementalCompilation = computedOptions.incremental.computeValue;
|
|
16584
|
+
var getAreDeclarationMapsEnabled = computedOptions.declarationMap.computeValue;
|
|
16585
|
+
var getAllowJSCompilerOption = computedOptions.allowJs.computeValue;
|
|
16586
|
+
var getUseDefineForClassFields = computedOptions.useDefineForClassFields.computeValue;
|
|
16371
16587
|
function emitModuleKindIsNonNodeESM(moduleKind) {
|
|
16372
16588
|
return moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */;
|
|
16373
16589
|
}
|
|
16374
|
-
function getEmitModuleResolutionKind(compilerOptions) {
|
|
16375
|
-
let moduleResolution = compilerOptions.moduleResolution;
|
|
16376
|
-
if (moduleResolution === void 0) {
|
|
16377
|
-
switch (getEmitModuleKind(compilerOptions)) {
|
|
16378
|
-
case 1 /* CommonJS */:
|
|
16379
|
-
moduleResolution = 2 /* Node10 */;
|
|
16380
|
-
break;
|
|
16381
|
-
case 100 /* Node16 */:
|
|
16382
|
-
moduleResolution = 3 /* Node16 */;
|
|
16383
|
-
break;
|
|
16384
|
-
case 199 /* NodeNext */:
|
|
16385
|
-
moduleResolution = 99 /* NodeNext */;
|
|
16386
|
-
break;
|
|
16387
|
-
default:
|
|
16388
|
-
moduleResolution = 1 /* Classic */;
|
|
16389
|
-
break;
|
|
16390
|
-
}
|
|
16391
|
-
}
|
|
16392
|
-
return moduleResolution;
|
|
16393
|
-
}
|
|
16394
|
-
function getEmitModuleDetectionKind(options) {
|
|
16395
|
-
return options.moduleDetection || (getEmitModuleKind(options) === 100 /* Node16 */ || getEmitModuleKind(options) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
|
|
16396
|
-
}
|
|
16397
16590
|
function hasJsonModuleEmitEnabled(options) {
|
|
16398
16591
|
switch (getEmitModuleKind(options)) {
|
|
16399
16592
|
case 1 /* CommonJS */:
|
|
@@ -16409,81 +16602,21 @@ function hasJsonModuleEmitEnabled(options) {
|
|
|
16409
16602
|
return false;
|
|
16410
16603
|
}
|
|
16411
16604
|
}
|
|
16412
|
-
function getIsolatedModules(options) {
|
|
16413
|
-
return !!(options.isolatedModules || options.verbatimModuleSyntax);
|
|
16414
|
-
}
|
|
16415
16605
|
function unreachableCodeIsError(options) {
|
|
16416
16606
|
return options.allowUnreachableCode === false;
|
|
16417
16607
|
}
|
|
16418
16608
|
function unusedLabelIsError(options) {
|
|
16419
16609
|
return options.allowUnusedLabels === false;
|
|
16420
16610
|
}
|
|
16421
|
-
function getAreDeclarationMapsEnabled(options) {
|
|
16422
|
-
return !!(getEmitDeclarations(options) && options.declarationMap);
|
|
16423
|
-
}
|
|
16424
|
-
function getESModuleInterop(compilerOptions) {
|
|
16425
|
-
if (compilerOptions.esModuleInterop !== void 0) {
|
|
16426
|
-
return compilerOptions.esModuleInterop;
|
|
16427
|
-
}
|
|
16428
|
-
switch (getEmitModuleKind(compilerOptions)) {
|
|
16429
|
-
case 100 /* Node16 */:
|
|
16430
|
-
case 199 /* NodeNext */:
|
|
16431
|
-
return true;
|
|
16432
|
-
}
|
|
16433
|
-
return void 0;
|
|
16434
|
-
}
|
|
16435
|
-
function getAllowSyntheticDefaultImports(compilerOptions) {
|
|
16436
|
-
if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
|
|
16437
|
-
return compilerOptions.allowSyntheticDefaultImports;
|
|
16438
|
-
}
|
|
16439
|
-
return getESModuleInterop(compilerOptions) || getEmitModuleKind(compilerOptions) === 4 /* System */ || getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
|
|
16440
|
-
}
|
|
16441
16611
|
function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) {
|
|
16442
16612
|
return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
|
|
16443
16613
|
}
|
|
16444
16614
|
function shouldResolveJsRequire(compilerOptions) {
|
|
16445
16615
|
return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */;
|
|
16446
16616
|
}
|
|
16447
|
-
function getResolvePackageJsonExports(compilerOptions) {
|
|
16448
|
-
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
16449
|
-
if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
16450
|
-
return false;
|
|
16451
|
-
}
|
|
16452
|
-
if (compilerOptions.resolvePackageJsonExports !== void 0) {
|
|
16453
|
-
return compilerOptions.resolvePackageJsonExports;
|
|
16454
|
-
}
|
|
16455
|
-
switch (moduleResolution) {
|
|
16456
|
-
case 3 /* Node16 */:
|
|
16457
|
-
case 99 /* NodeNext */:
|
|
16458
|
-
case 100 /* Bundler */:
|
|
16459
|
-
return true;
|
|
16460
|
-
}
|
|
16461
|
-
return false;
|
|
16462
|
-
}
|
|
16463
|
-
function getResolveJsonModule(compilerOptions) {
|
|
16464
|
-
if (compilerOptions.resolveJsonModule !== void 0) {
|
|
16465
|
-
return compilerOptions.resolveJsonModule;
|
|
16466
|
-
}
|
|
16467
|
-
return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
|
|
16468
|
-
}
|
|
16469
|
-
function getEmitDeclarations(compilerOptions) {
|
|
16470
|
-
return !!(compilerOptions.declaration || compilerOptions.composite);
|
|
16471
|
-
}
|
|
16472
|
-
function shouldPreserveConstEnums(compilerOptions) {
|
|
16473
|
-
return !!(compilerOptions.preserveConstEnums || getIsolatedModules(compilerOptions));
|
|
16474
|
-
}
|
|
16475
|
-
function isIncrementalCompilation(options) {
|
|
16476
|
-
return !!(options.incremental || options.composite);
|
|
16477
|
-
}
|
|
16478
16617
|
function getStrictOptionValue(compilerOptions, flag) {
|
|
16479
16618
|
return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
|
|
16480
16619
|
}
|
|
16481
|
-
function getAllowJSCompilerOption(compilerOptions) {
|
|
16482
|
-
return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs;
|
|
16483
|
-
}
|
|
16484
|
-
function getUseDefineForClassFields(compilerOptions) {
|
|
16485
|
-
return compilerOptions.useDefineForClassFields === void 0 ? getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
|
|
16486
|
-
}
|
|
16487
16620
|
function getEmitStandardClassFields(compilerOptions) {
|
|
16488
16621
|
return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */;
|
|
16489
16622
|
}
|
|
@@ -35895,7 +36028,8 @@ function convertToTSConfig(configParseResult, configFileName, host) {
|
|
|
35895
36028
|
),
|
|
35896
36029
|
(f) => getRelativePathFromFile(getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), getNormalizedAbsolutePath(f, host.getCurrentDirectory()), getCanonicalFileName)
|
|
35897
36030
|
);
|
|
35898
|
-
const
|
|
36031
|
+
const pathOptions = { configFilePath: getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames };
|
|
36032
|
+
const optionMap = serializeCompilerOptions(configParseResult.options, pathOptions);
|
|
35899
36033
|
const watchOptionMap = configParseResult.watchOptions && serializeWatchOptions(configParseResult.watchOptions);
|
|
35900
36034
|
const config = {
|
|
35901
36035
|
compilerOptions: {
|
|
@@ -35920,6 +36054,18 @@ function convertToTSConfig(configParseResult, configFileName, host) {
|
|
|
35920
36054
|
} : {},
|
|
35921
36055
|
compileOnSave: !!configParseResult.compileOnSave ? true : void 0
|
|
35922
36056
|
};
|
|
36057
|
+
const providedKeys = new Set(optionMap.keys());
|
|
36058
|
+
const impliedCompilerOptions = {};
|
|
36059
|
+
for (const option in computedOptions) {
|
|
36060
|
+
if (!providedKeys.has(option) && some(computedOptions[option].dependencies, (dep) => providedKeys.has(dep))) {
|
|
36061
|
+
const implied = computedOptions[option].computeValue(configParseResult.options);
|
|
36062
|
+
const defaultValue = computedOptions[option].computeValue({});
|
|
36063
|
+
if (implied !== defaultValue) {
|
|
36064
|
+
impliedCompilerOptions[option] = computedOptions[option].computeValue(configParseResult.options);
|
|
36065
|
+
}
|
|
36066
|
+
}
|
|
36067
|
+
}
|
|
36068
|
+
assign(config.compilerOptions, optionMapToObject(serializeCompilerOptions(impliedCompilerOptions, pathOptions)));
|
|
35923
36069
|
return config;
|
|
35924
36070
|
}
|
|
35925
36071
|
function optionMapToObject(optionMap) {
|
|
@@ -57114,7 +57260,7 @@ function createTypeChecker(host) {
|
|
|
57114
57260
|
function removeConstrainedTypeVariables(types) {
|
|
57115
57261
|
const typeVariables = [];
|
|
57116
57262
|
for (const type of types) {
|
|
57117
|
-
if (getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57263
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57118
57264
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57119
57265
|
pushIfUnique(typeVariables, type.types[index]);
|
|
57120
57266
|
}
|
|
@@ -57122,7 +57268,7 @@ function createTypeChecker(host) {
|
|
|
57122
57268
|
for (const typeVariable of typeVariables) {
|
|
57123
57269
|
const primitives = [];
|
|
57124
57270
|
for (const type of types) {
|
|
57125
|
-
if (getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57271
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57126
57272
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57127
57273
|
if (type.types[index] === typeVariable) {
|
|
57128
57274
|
insertType(primitives, type.types[1 - index]);
|
|
@@ -57135,7 +57281,7 @@ function createTypeChecker(host) {
|
|
|
57135
57281
|
while (i > 0) {
|
|
57136
57282
|
i--;
|
|
57137
57283
|
const type = types[i];
|
|
57138
|
-
if (getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57284
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57139
57285
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57140
57286
|
if (type.types[index] === typeVariable && containsType(primitives, type.types[1 - index])) {
|
|
57141
57287
|
orderedRemoveItemAt(types, i);
|
|
@@ -58303,7 +58449,9 @@ function createTypeChecker(host) {
|
|
|
58303
58449
|
if (checkType === wildcardType || extendsType === wildcardType) {
|
|
58304
58450
|
return wildcardType;
|
|
58305
58451
|
}
|
|
58306
|
-
const
|
|
58452
|
+
const checkTypeNode = skipTypeParentheses(root.node.checkType);
|
|
58453
|
+
const extendsTypeNode = skipTypeParentheses(root.node.extendsType);
|
|
58454
|
+
const checkTuples = isSimpleTupleType(checkTypeNode) && isSimpleTupleType(extendsTypeNode) && length(checkTypeNode.elements) === length(extendsTypeNode.elements);
|
|
58307
58455
|
const checkTypeDeferred = isDeferredType(checkType, checkTuples);
|
|
58308
58456
|
let combinedMapper;
|
|
58309
58457
|
if (root.inferTypeParameters) {
|
|
@@ -61541,6 +61689,18 @@ function createTypeChecker(host) {
|
|
|
61541
61689
|
}
|
|
61542
61690
|
return result2;
|
|
61543
61691
|
}
|
|
61692
|
+
function getApparentMappedTypeKeys(nameType, targetType) {
|
|
61693
|
+
const modifiersType = getApparentType(getModifiersTypeFromMappedType(targetType));
|
|
61694
|
+
const mappedKeys = [];
|
|
61695
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(
|
|
61696
|
+
modifiersType,
|
|
61697
|
+
8576 /* StringOrNumberLiteralOrUnique */,
|
|
61698
|
+
/*stringsOnly*/
|
|
61699
|
+
false,
|
|
61700
|
+
(t) => void mappedKeys.push(instantiateType(nameType, appendTypeMapping(targetType.mapper, getTypeParameterFromMappedType(targetType), t)))
|
|
61701
|
+
);
|
|
61702
|
+
return getUnionType(mappedKeys);
|
|
61703
|
+
}
|
|
61544
61704
|
function structuredTypeRelatedToWorker(source2, target2, reportErrors2, intersectionState, saveErrorInfo) {
|
|
61545
61705
|
let result2;
|
|
61546
61706
|
let originalErrorInfo;
|
|
@@ -61723,16 +61883,8 @@ function createTypeChecker(host) {
|
|
|
61723
61883
|
const constraintType = getConstraintTypeFromMappedType(targetType);
|
|
61724
61884
|
let targetKeys;
|
|
61725
61885
|
if (nameType && isMappedTypeWithKeyofConstraintDeclaration(targetType)) {
|
|
61726
|
-
const
|
|
61727
|
-
|
|
61728
|
-
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(
|
|
61729
|
-
modifiersType,
|
|
61730
|
-
8576 /* StringOrNumberLiteralOrUnique */,
|
|
61731
|
-
/*stringsOnly*/
|
|
61732
|
-
false,
|
|
61733
|
-
(t) => void mappedKeys.push(instantiateType(nameType, appendTypeMapping(targetType.mapper, getTypeParameterFromMappedType(targetType), t)))
|
|
61734
|
-
);
|
|
61735
|
-
targetKeys = getUnionType([...mappedKeys, nameType]);
|
|
61886
|
+
const mappedKeys = getApparentMappedTypeKeys(nameType, targetType);
|
|
61887
|
+
targetKeys = getUnionType([mappedKeys, nameType]);
|
|
61736
61888
|
} else {
|
|
61737
61889
|
targetKeys = nameType || constraintType;
|
|
61738
61890
|
}
|
|
@@ -61903,9 +62055,18 @@ function createTypeChecker(host) {
|
|
|
61903
62055
|
}
|
|
61904
62056
|
}
|
|
61905
62057
|
} else if (sourceFlags & 4194304 /* Index */) {
|
|
61906
|
-
|
|
62058
|
+
const isDeferredMappedIndex = shouldDeferIndexType(source2.type, source2.indexFlags) && getObjectFlags(source2.type) & 32 /* Mapped */;
|
|
62059
|
+
if (result2 = isRelatedTo(keyofConstraintType, target2, 1 /* Source */, reportErrors2 && !isDeferredMappedIndex)) {
|
|
61907
62060
|
return result2;
|
|
61908
62061
|
}
|
|
62062
|
+
if (isDeferredMappedIndex) {
|
|
62063
|
+
const mappedType = source2.type;
|
|
62064
|
+
const nameType = getNameTypeFromMappedType(mappedType);
|
|
62065
|
+
const sourceMappedKeys = nameType && isMappedTypeWithKeyofConstraintDeclaration(mappedType) ? getApparentMappedTypeKeys(nameType, mappedType) : nameType || getConstraintTypeFromMappedType(mappedType);
|
|
62066
|
+
if (result2 = isRelatedTo(sourceMappedKeys, target2, 1 /* Source */, reportErrors2)) {
|
|
62067
|
+
return result2;
|
|
62068
|
+
}
|
|
62069
|
+
}
|
|
61909
62070
|
} else if (sourceFlags & 134217728 /* TemplateLiteral */ && !(targetFlags & 524288 /* Object */)) {
|
|
61910
62071
|
if (!(targetFlags & 134217728 /* TemplateLiteral */)) {
|
|
61911
62072
|
const constraint = getBaseConstraintOfType(source2);
|
|
@@ -68802,7 +68963,7 @@ function createTypeChecker(host) {
|
|
|
68802
68963
|
/*contextFlags*/
|
|
68803
68964
|
void 0
|
|
68804
68965
|
);
|
|
68805
|
-
const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType,
|
|
68966
|
+
const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType, isTupleLikeType);
|
|
68806
68967
|
let hasOmittedExpression = false;
|
|
68807
68968
|
for (let i = 0; i < elementCount; i++) {
|
|
68808
68969
|
const e = elements[i];
|
|
@@ -75730,7 +75891,7 @@ function createTypeChecker(host) {
|
|
|
75730
75891
|
const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
|
|
75731
75892
|
if (modifiers) {
|
|
75732
75893
|
const symbol = getSymbolOfDeclaration(node.parent);
|
|
75733
|
-
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
75894
|
+
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
75734
75895
|
error(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
75735
75896
|
} else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
|
|
75736
75897
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
|