@typescript-deploys/pr-build 5.4.0-pr-56640-15 → 5.4.0-pr-56736-6
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 +319 -127
- package/lib/tsserver.js +327 -152
- package/lib/typescript.d.ts +20 -0
- package/lib/typescript.js +327 -153
- package/lib/typingsInstaller.js +228 -37
- package/package.json +3 -3
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 = [];
|
|
@@ -7794,7 +7794,9 @@ var Diagnostics = {
|
|
|
7794
7794
|
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
7795
7795
|
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'"),
|
|
7796
7796
|
Its_type_0_is_not_a_valid_JSX_element_type: diag(18053, 1 /* Error */, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type."),
|
|
7797
|
-
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.")
|
|
7797
|
+
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block."),
|
|
7798
|
+
A_member_initializer_in_a_enum_declaration_for_a_string_value_must_be_a_string_literal_when_isolatedModules_is_enabled: diag(18055, 1 /* Error */, "A_member_initializer_in_a_enum_declaration_for_a_string_value_must_be_a_string_literal_when_isolated_18055", "A member initializer in a enum declaration for a string value must be a string literal when 'isolatedModules' is enabled."),
|
|
7799
|
+
Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled: diag(18056, 1 /* Error */, "Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056", "Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled.")
|
|
7798
7800
|
};
|
|
7799
7801
|
|
|
7800
7802
|
// src/compiler/scanner.ts
|
|
@@ -16362,38 +16364,231 @@ function getSetExternalModuleIndicator(options) {
|
|
|
16362
16364
|
return callback;
|
|
16363
16365
|
}
|
|
16364
16366
|
}
|
|
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 */;
|
|
16367
|
+
function createComputedCompilerOptions(options) {
|
|
16368
|
+
return options;
|
|
16370
16369
|
}
|
|
16370
|
+
var computedOptions = createComputedCompilerOptions({
|
|
16371
|
+
target: {
|
|
16372
|
+
dependencies: ["module"],
|
|
16373
|
+
computeValue: (compilerOptions) => {
|
|
16374
|
+
return compilerOptions.target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
|
|
16375
|
+
}
|
|
16376
|
+
},
|
|
16377
|
+
module: {
|
|
16378
|
+
dependencies: ["target"],
|
|
16379
|
+
computeValue: (compilerOptions) => {
|
|
16380
|
+
return typeof compilerOptions.module === "number" ? compilerOptions.module : computedOptions.target.computeValue(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
|
|
16381
|
+
}
|
|
16382
|
+
},
|
|
16383
|
+
moduleResolution: {
|
|
16384
|
+
dependencies: ["module", "target"],
|
|
16385
|
+
computeValue: (compilerOptions) => {
|
|
16386
|
+
let moduleResolution = compilerOptions.moduleResolution;
|
|
16387
|
+
if (moduleResolution === void 0) {
|
|
16388
|
+
switch (computedOptions.module.computeValue(compilerOptions)) {
|
|
16389
|
+
case 1 /* CommonJS */:
|
|
16390
|
+
moduleResolution = 2 /* Node10 */;
|
|
16391
|
+
break;
|
|
16392
|
+
case 100 /* Node16 */:
|
|
16393
|
+
moduleResolution = 3 /* Node16 */;
|
|
16394
|
+
break;
|
|
16395
|
+
case 199 /* NodeNext */:
|
|
16396
|
+
moduleResolution = 99 /* NodeNext */;
|
|
16397
|
+
break;
|
|
16398
|
+
default:
|
|
16399
|
+
moduleResolution = 1 /* Classic */;
|
|
16400
|
+
break;
|
|
16401
|
+
}
|
|
16402
|
+
}
|
|
16403
|
+
return moduleResolution;
|
|
16404
|
+
}
|
|
16405
|
+
},
|
|
16406
|
+
moduleDetection: {
|
|
16407
|
+
dependencies: ["module", "target"],
|
|
16408
|
+
computeValue: (compilerOptions) => {
|
|
16409
|
+
return compilerOptions.moduleDetection || (computedOptions.module.computeValue(compilerOptions) === 100 /* Node16 */ || computedOptions.module.computeValue(compilerOptions) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
|
|
16410
|
+
}
|
|
16411
|
+
},
|
|
16412
|
+
isolatedModules: {
|
|
16413
|
+
dependencies: ["verbatimModuleSyntax"],
|
|
16414
|
+
computeValue: (compilerOptions) => {
|
|
16415
|
+
return !!(compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax);
|
|
16416
|
+
}
|
|
16417
|
+
},
|
|
16418
|
+
esModuleInterop: {
|
|
16419
|
+
dependencies: ["module", "target"],
|
|
16420
|
+
computeValue: (compilerOptions) => {
|
|
16421
|
+
if (compilerOptions.esModuleInterop !== void 0) {
|
|
16422
|
+
return compilerOptions.esModuleInterop;
|
|
16423
|
+
}
|
|
16424
|
+
switch (computedOptions.module.computeValue(compilerOptions)) {
|
|
16425
|
+
case 100 /* Node16 */:
|
|
16426
|
+
case 199 /* NodeNext */:
|
|
16427
|
+
return true;
|
|
16428
|
+
}
|
|
16429
|
+
return false;
|
|
16430
|
+
}
|
|
16431
|
+
},
|
|
16432
|
+
allowSyntheticDefaultImports: {
|
|
16433
|
+
dependencies: ["module", "target", "moduleResolution"],
|
|
16434
|
+
computeValue: (compilerOptions) => {
|
|
16435
|
+
if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
|
|
16436
|
+
return compilerOptions.allowSyntheticDefaultImports;
|
|
16437
|
+
}
|
|
16438
|
+
return computedOptions.esModuleInterop.computeValue(compilerOptions) || computedOptions.module.computeValue(compilerOptions) === 4 /* System */ || computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
|
|
16439
|
+
}
|
|
16440
|
+
},
|
|
16441
|
+
resolvePackageJsonExports: {
|
|
16442
|
+
dependencies: ["moduleResolution"],
|
|
16443
|
+
computeValue: (compilerOptions) => {
|
|
16444
|
+
const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
|
|
16445
|
+
if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
16446
|
+
return false;
|
|
16447
|
+
}
|
|
16448
|
+
if (compilerOptions.resolvePackageJsonExports !== void 0) {
|
|
16449
|
+
return compilerOptions.resolvePackageJsonExports;
|
|
16450
|
+
}
|
|
16451
|
+
switch (moduleResolution) {
|
|
16452
|
+
case 3 /* Node16 */:
|
|
16453
|
+
case 99 /* NodeNext */:
|
|
16454
|
+
case 100 /* Bundler */:
|
|
16455
|
+
return true;
|
|
16456
|
+
}
|
|
16457
|
+
return false;
|
|
16458
|
+
}
|
|
16459
|
+
},
|
|
16460
|
+
resolvePackageJsonImports: {
|
|
16461
|
+
dependencies: ["moduleResolution", "resolvePackageJsonExports"],
|
|
16462
|
+
computeValue: (compilerOptions) => {
|
|
16463
|
+
const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
|
|
16464
|
+
if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
16465
|
+
return false;
|
|
16466
|
+
}
|
|
16467
|
+
if (compilerOptions.resolvePackageJsonExports !== void 0) {
|
|
16468
|
+
return compilerOptions.resolvePackageJsonExports;
|
|
16469
|
+
}
|
|
16470
|
+
switch (moduleResolution) {
|
|
16471
|
+
case 3 /* Node16 */:
|
|
16472
|
+
case 99 /* NodeNext */:
|
|
16473
|
+
case 100 /* Bundler */:
|
|
16474
|
+
return true;
|
|
16475
|
+
}
|
|
16476
|
+
return false;
|
|
16477
|
+
}
|
|
16478
|
+
},
|
|
16479
|
+
resolveJsonModule: {
|
|
16480
|
+
dependencies: ["moduleResolution", "module", "target"],
|
|
16481
|
+
computeValue: (compilerOptions) => {
|
|
16482
|
+
if (compilerOptions.resolveJsonModule !== void 0) {
|
|
16483
|
+
return compilerOptions.resolveJsonModule;
|
|
16484
|
+
}
|
|
16485
|
+
return computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
|
|
16486
|
+
}
|
|
16487
|
+
},
|
|
16488
|
+
declaration: {
|
|
16489
|
+
dependencies: ["composite"],
|
|
16490
|
+
computeValue: (compilerOptions) => {
|
|
16491
|
+
return !!(compilerOptions.declaration || compilerOptions.composite);
|
|
16492
|
+
}
|
|
16493
|
+
},
|
|
16494
|
+
preserveConstEnums: {
|
|
16495
|
+
dependencies: ["isolatedModules", "verbatimModuleSyntax"],
|
|
16496
|
+
computeValue: (compilerOptions) => {
|
|
16497
|
+
return !!(compilerOptions.preserveConstEnums || computedOptions.isolatedModules.computeValue(compilerOptions));
|
|
16498
|
+
}
|
|
16499
|
+
},
|
|
16500
|
+
incremental: {
|
|
16501
|
+
dependencies: ["composite"],
|
|
16502
|
+
computeValue: (compilerOptions) => {
|
|
16503
|
+
return !!(compilerOptions.incremental || compilerOptions.composite);
|
|
16504
|
+
}
|
|
16505
|
+
},
|
|
16506
|
+
declarationMap: {
|
|
16507
|
+
dependencies: ["declaration", "composite"],
|
|
16508
|
+
computeValue: (compilerOptions) => {
|
|
16509
|
+
return !!(compilerOptions.declarationMap && computedOptions.declaration.computeValue(compilerOptions));
|
|
16510
|
+
}
|
|
16511
|
+
},
|
|
16512
|
+
allowJs: {
|
|
16513
|
+
dependencies: ["checkJs"],
|
|
16514
|
+
computeValue: (compilerOptions) => {
|
|
16515
|
+
return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs;
|
|
16516
|
+
}
|
|
16517
|
+
},
|
|
16518
|
+
useDefineForClassFields: {
|
|
16519
|
+
dependencies: ["target", "module"],
|
|
16520
|
+
computeValue: (compilerOptions) => {
|
|
16521
|
+
return compilerOptions.useDefineForClassFields === void 0 ? computedOptions.target.computeValue(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
|
|
16522
|
+
}
|
|
16523
|
+
},
|
|
16524
|
+
noImplicitAny: {
|
|
16525
|
+
dependencies: ["strict"],
|
|
16526
|
+
computeValue: (compilerOptions) => {
|
|
16527
|
+
return getStrictOptionValue(compilerOptions, "noImplicitAny");
|
|
16528
|
+
}
|
|
16529
|
+
},
|
|
16530
|
+
noImplicitThis: {
|
|
16531
|
+
dependencies: ["strict"],
|
|
16532
|
+
computeValue: (compilerOptions) => {
|
|
16533
|
+
return getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
16534
|
+
}
|
|
16535
|
+
},
|
|
16536
|
+
strictNullChecks: {
|
|
16537
|
+
dependencies: ["strict"],
|
|
16538
|
+
computeValue: (compilerOptions) => {
|
|
16539
|
+
return getStrictOptionValue(compilerOptions, "strictNullChecks");
|
|
16540
|
+
}
|
|
16541
|
+
},
|
|
16542
|
+
strictFunctionTypes: {
|
|
16543
|
+
dependencies: ["strict"],
|
|
16544
|
+
computeValue: (compilerOptions) => {
|
|
16545
|
+
return getStrictOptionValue(compilerOptions, "strictFunctionTypes");
|
|
16546
|
+
}
|
|
16547
|
+
},
|
|
16548
|
+
strictBindCallApply: {
|
|
16549
|
+
dependencies: ["strict"],
|
|
16550
|
+
computeValue: (compilerOptions) => {
|
|
16551
|
+
return getStrictOptionValue(compilerOptions, "strictBindCallApply");
|
|
16552
|
+
}
|
|
16553
|
+
},
|
|
16554
|
+
strictPropertyInitialization: {
|
|
16555
|
+
dependencies: ["strict"],
|
|
16556
|
+
computeValue: (compilerOptions) => {
|
|
16557
|
+
return getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
|
|
16558
|
+
}
|
|
16559
|
+
},
|
|
16560
|
+
alwaysStrict: {
|
|
16561
|
+
dependencies: ["strict"],
|
|
16562
|
+
computeValue: (compilerOptions) => {
|
|
16563
|
+
return getStrictOptionValue(compilerOptions, "alwaysStrict");
|
|
16564
|
+
}
|
|
16565
|
+
},
|
|
16566
|
+
useUnknownInCatchVariables: {
|
|
16567
|
+
dependencies: ["strict"],
|
|
16568
|
+
computeValue: (compilerOptions) => {
|
|
16569
|
+
return getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
16570
|
+
}
|
|
16571
|
+
}
|
|
16572
|
+
});
|
|
16573
|
+
var getEmitScriptTarget = computedOptions.target.computeValue;
|
|
16574
|
+
var getEmitModuleKind = computedOptions.module.computeValue;
|
|
16575
|
+
var getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue;
|
|
16576
|
+
var getEmitModuleDetectionKind = computedOptions.moduleDetection.computeValue;
|
|
16577
|
+
var getIsolatedModules = computedOptions.isolatedModules.computeValue;
|
|
16578
|
+
var getESModuleInterop = computedOptions.esModuleInterop.computeValue;
|
|
16579
|
+
var getAllowSyntheticDefaultImports = computedOptions.allowSyntheticDefaultImports.computeValue;
|
|
16580
|
+
var getResolvePackageJsonExports = computedOptions.resolvePackageJsonExports.computeValue;
|
|
16581
|
+
var getResolvePackageJsonImports = computedOptions.resolvePackageJsonImports.computeValue;
|
|
16582
|
+
var getResolveJsonModule = computedOptions.resolveJsonModule.computeValue;
|
|
16583
|
+
var getEmitDeclarations = computedOptions.declaration.computeValue;
|
|
16584
|
+
var shouldPreserveConstEnums = computedOptions.preserveConstEnums.computeValue;
|
|
16585
|
+
var isIncrementalCompilation = computedOptions.incremental.computeValue;
|
|
16586
|
+
var getAreDeclarationMapsEnabled = computedOptions.declarationMap.computeValue;
|
|
16587
|
+
var getAllowJSCompilerOption = computedOptions.allowJs.computeValue;
|
|
16588
|
+
var getUseDefineForClassFields = computedOptions.useDefineForClassFields.computeValue;
|
|
16371
16589
|
function emitModuleKindIsNonNodeESM(moduleKind) {
|
|
16372
16590
|
return moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */;
|
|
16373
16591
|
}
|
|
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
16592
|
function hasJsonModuleEmitEnabled(options) {
|
|
16398
16593
|
switch (getEmitModuleKind(options)) {
|
|
16399
16594
|
case 1 /* CommonJS */:
|
|
@@ -16409,81 +16604,21 @@ function hasJsonModuleEmitEnabled(options) {
|
|
|
16409
16604
|
return false;
|
|
16410
16605
|
}
|
|
16411
16606
|
}
|
|
16412
|
-
function getIsolatedModules(options) {
|
|
16413
|
-
return !!(options.isolatedModules || options.verbatimModuleSyntax);
|
|
16414
|
-
}
|
|
16415
16607
|
function unreachableCodeIsError(options) {
|
|
16416
16608
|
return options.allowUnreachableCode === false;
|
|
16417
16609
|
}
|
|
16418
16610
|
function unusedLabelIsError(options) {
|
|
16419
16611
|
return options.allowUnusedLabels === false;
|
|
16420
16612
|
}
|
|
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
16613
|
function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) {
|
|
16442
16614
|
return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
|
|
16443
16615
|
}
|
|
16444
16616
|
function shouldResolveJsRequire(compilerOptions) {
|
|
16445
16617
|
return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */;
|
|
16446
16618
|
}
|
|
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
16619
|
function getStrictOptionValue(compilerOptions, flag) {
|
|
16479
16620
|
return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
|
|
16480
16621
|
}
|
|
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
16622
|
function getEmitStandardClassFields(compilerOptions) {
|
|
16488
16623
|
return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */;
|
|
16489
16624
|
}
|
|
@@ -18839,8 +18974,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
18839
18974
|
return update(updated, original);
|
|
18840
18975
|
}
|
|
18841
18976
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
18977
|
+
const text = typeof value === "number" ? value + "" : value;
|
|
18978
|
+
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
18842
18979
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
18843
|
-
node.text =
|
|
18980
|
+
node.text = text;
|
|
18844
18981
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
18845
18982
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
18846
18983
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
@@ -35893,7 +36030,8 @@ function convertToTSConfig(configParseResult, configFileName, host) {
|
|
|
35893
36030
|
),
|
|
35894
36031
|
(f) => getRelativePathFromFile(getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), getNormalizedAbsolutePath(f, host.getCurrentDirectory()), getCanonicalFileName)
|
|
35895
36032
|
);
|
|
35896
|
-
const
|
|
36033
|
+
const pathOptions = { configFilePath: getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames };
|
|
36034
|
+
const optionMap = serializeCompilerOptions(configParseResult.options, pathOptions);
|
|
35897
36035
|
const watchOptionMap = configParseResult.watchOptions && serializeWatchOptions(configParseResult.watchOptions);
|
|
35898
36036
|
const config = {
|
|
35899
36037
|
compilerOptions: {
|
|
@@ -35918,6 +36056,18 @@ function convertToTSConfig(configParseResult, configFileName, host) {
|
|
|
35918
36056
|
} : {},
|
|
35919
36057
|
compileOnSave: !!configParseResult.compileOnSave ? true : void 0
|
|
35920
36058
|
};
|
|
36059
|
+
const providedKeys = new Set(optionMap.keys());
|
|
36060
|
+
const impliedCompilerOptions = {};
|
|
36061
|
+
for (const option in computedOptions) {
|
|
36062
|
+
if (!providedKeys.has(option) && some(computedOptions[option].dependencies, (dep) => providedKeys.has(dep))) {
|
|
36063
|
+
const implied = computedOptions[option].computeValue(configParseResult.options);
|
|
36064
|
+
const defaultValue = computedOptions[option].computeValue({});
|
|
36065
|
+
if (implied !== defaultValue) {
|
|
36066
|
+
impliedCompilerOptions[option] = computedOptions[option].computeValue(configParseResult.options);
|
|
36067
|
+
}
|
|
36068
|
+
}
|
|
36069
|
+
}
|
|
36070
|
+
assign(config.compilerOptions, optionMapToObject(serializeCompilerOptions(impliedCompilerOptions, pathOptions)));
|
|
35921
36071
|
return config;
|
|
35922
36072
|
}
|
|
35923
36073
|
function optionMapToObject(optionMap) {
|
|
@@ -57112,7 +57262,7 @@ function createTypeChecker(host) {
|
|
|
57112
57262
|
function removeConstrainedTypeVariables(types) {
|
|
57113
57263
|
const typeVariables = [];
|
|
57114
57264
|
for (const type of types) {
|
|
57115
|
-
if (getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57265
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57116
57266
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57117
57267
|
pushIfUnique(typeVariables, type.types[index]);
|
|
57118
57268
|
}
|
|
@@ -57120,7 +57270,7 @@ function createTypeChecker(host) {
|
|
|
57120
57270
|
for (const typeVariable of typeVariables) {
|
|
57121
57271
|
const primitives = [];
|
|
57122
57272
|
for (const type of types) {
|
|
57123
|
-
if (getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57273
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57124
57274
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57125
57275
|
if (type.types[index] === typeVariable) {
|
|
57126
57276
|
insertType(primitives, type.types[1 - index]);
|
|
@@ -57133,7 +57283,7 @@ function createTypeChecker(host) {
|
|
|
57133
57283
|
while (i > 0) {
|
|
57134
57284
|
i--;
|
|
57135
57285
|
const type = types[i];
|
|
57136
|
-
if (getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57286
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) {
|
|
57137
57287
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57138
57288
|
if (type.types[index] === typeVariable && containsType(primitives, type.types[1 - index])) {
|
|
57139
57289
|
orderedRemoveItemAt(types, i);
|
|
@@ -58301,7 +58451,9 @@ function createTypeChecker(host) {
|
|
|
58301
58451
|
if (checkType === wildcardType || extendsType === wildcardType) {
|
|
58302
58452
|
return wildcardType;
|
|
58303
58453
|
}
|
|
58304
|
-
const
|
|
58454
|
+
const checkTypeNode = skipTypeParentheses(root.node.checkType);
|
|
58455
|
+
const extendsTypeNode = skipTypeParentheses(root.node.extendsType);
|
|
58456
|
+
const checkTuples = isSimpleTupleType(checkTypeNode) && isSimpleTupleType(extendsTypeNode) && length(checkTypeNode.elements) === length(extendsTypeNode.elements);
|
|
58305
58457
|
const checkTypeDeferred = isDeferredType(checkType, checkTuples);
|
|
58306
58458
|
let combinedMapper;
|
|
58307
58459
|
if (root.inferTypeParameters) {
|
|
@@ -64305,16 +64457,6 @@ function createTypeChecker(host) {
|
|
|
64305
64457
|
} else if (target.flags & 134217728 /* TemplateLiteral */) {
|
|
64306
64458
|
inferToTemplateLiteralType(source, target);
|
|
64307
64459
|
} else {
|
|
64308
|
-
if (isGenericMappedType(source) && isGenericMappedType(target)) {
|
|
64309
|
-
invokeOnce(source, target, (source2, target2) => {
|
|
64310
|
-
inferFromTypes(getConstraintTypeFromMappedType(source2), getConstraintTypeFromMappedType(target2));
|
|
64311
|
-
inferFromTypes(getTemplateTypeFromMappedType(source2), getTemplateTypeFromMappedType(target2));
|
|
64312
|
-
const sourceNameType = getNameTypeFromMappedType(source2);
|
|
64313
|
-
const targetNameType = getNameTypeFromMappedType(target2);
|
|
64314
|
-
if (sourceNameType && targetNameType)
|
|
64315
|
-
inferFromTypes(sourceNameType, targetNameType);
|
|
64316
|
-
});
|
|
64317
|
-
}
|
|
64318
64460
|
source = getReducedType(source);
|
|
64319
64461
|
if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
|
|
64320
64462
|
const apparentSource = getApparentType(source);
|
|
@@ -75738,7 +75880,7 @@ function createTypeChecker(host) {
|
|
|
75738
75880
|
const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
|
|
75739
75881
|
if (modifiers) {
|
|
75740
75882
|
const symbol = getSymbolOfDeclaration(node.parent);
|
|
75741
|
-
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
75883
|
+
if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */))) {
|
|
75742
75884
|
error(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
75743
75885
|
} else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
|
|
75744
75886
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
|
|
@@ -80046,14 +80188,16 @@ function createTypeChecker(host) {
|
|
|
80046
80188
|
if (!(nodeLinks2.flags & 1024 /* EnumValuesComputed */)) {
|
|
80047
80189
|
nodeLinks2.flags |= 1024 /* EnumValuesComputed */;
|
|
80048
80190
|
let autoValue = 0;
|
|
80191
|
+
let previous;
|
|
80049
80192
|
for (const member of node.members) {
|
|
80050
|
-
const value = computeMemberValue(member, autoValue);
|
|
80193
|
+
const value = computeMemberValue(member, autoValue, previous);
|
|
80051
80194
|
getNodeLinks(member).enumMemberValue = value;
|
|
80052
80195
|
autoValue = typeof value === "number" ? value + 1 : void 0;
|
|
80196
|
+
previous = member;
|
|
80053
80197
|
}
|
|
80054
80198
|
}
|
|
80055
80199
|
}
|
|
80056
|
-
function computeMemberValue(member, autoValue) {
|
|
80200
|
+
function computeMemberValue(member, autoValue, previous) {
|
|
80057
80201
|
if (isComputedNonLiteralName(member.name)) {
|
|
80058
80202
|
error(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums);
|
|
80059
80203
|
} else {
|
|
@@ -80068,11 +80212,17 @@ function createTypeChecker(host) {
|
|
|
80068
80212
|
if (member.parent.flags & 33554432 /* Ambient */ && !isEnumConst(member.parent)) {
|
|
80069
80213
|
return void 0;
|
|
80070
80214
|
}
|
|
80071
|
-
if (autoValue
|
|
80072
|
-
|
|
80215
|
+
if (autoValue === void 0) {
|
|
80216
|
+
error(member.name, Diagnostics.Enum_member_must_have_initializer);
|
|
80217
|
+
return void 0;
|
|
80073
80218
|
}
|
|
80074
|
-
|
|
80075
|
-
|
|
80219
|
+
if (compilerOptions.isolatedModules && (previous == null ? void 0 : previous.initializer) && !evaluatesToNumericLiteral(previous.initializer)) {
|
|
80220
|
+
error(
|
|
80221
|
+
member.name,
|
|
80222
|
+
Diagnostics.Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled
|
|
80223
|
+
);
|
|
80224
|
+
}
|
|
80225
|
+
return autoValue;
|
|
80076
80226
|
}
|
|
80077
80227
|
function computeConstantValue(member) {
|
|
80078
80228
|
const isConstEnum = isEnumConst(member.parent);
|
|
@@ -80084,6 +80234,11 @@ function createTypeChecker(host) {
|
|
|
80084
80234
|
initializer,
|
|
80085
80235
|
isNaN(value) ? Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN : Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value
|
|
80086
80236
|
);
|
|
80237
|
+
} else if (compilerOptions.isolatedModules && typeof value === "string" && !evaluatesToStringLiteral(initializer)) {
|
|
80238
|
+
error(
|
|
80239
|
+
initializer,
|
|
80240
|
+
Diagnostics.A_member_initializer_in_a_enum_declaration_for_a_string_value_must_be_a_string_literal_when_isolatedModules_is_enabled
|
|
80241
|
+
);
|
|
80087
80242
|
}
|
|
80088
80243
|
} else if (isConstEnum) {
|
|
80089
80244
|
error(initializer, Diagnostics.const_enum_member_initializers_must_be_constant_expressions);
|
|
@@ -80094,6 +80249,37 @@ function createTypeChecker(host) {
|
|
|
80094
80249
|
}
|
|
80095
80250
|
return value;
|
|
80096
80251
|
}
|
|
80252
|
+
function evaluatesToNumericLiteral(expr) {
|
|
80253
|
+
switch (expr.kind) {
|
|
80254
|
+
case 224 /* PrefixUnaryExpression */:
|
|
80255
|
+
return evaluatesToNumericLiteral(expr.operand);
|
|
80256
|
+
case 226 /* BinaryExpression */:
|
|
80257
|
+
return evaluatesToNumericLiteral(expr.left) && evaluatesToNumericLiteral(expr.right);
|
|
80258
|
+
case 217 /* ParenthesizedExpression */:
|
|
80259
|
+
return evaluatesToNumericLiteral(expr.expression);
|
|
80260
|
+
case 9 /* NumericLiteral */:
|
|
80261
|
+
return true;
|
|
80262
|
+
}
|
|
80263
|
+
return false;
|
|
80264
|
+
}
|
|
80265
|
+
function evaluatesToStringLiteral(expr) {
|
|
80266
|
+
switch (expr.kind) {
|
|
80267
|
+
case 226 /* BinaryExpression */:
|
|
80268
|
+
const left = expr.left;
|
|
80269
|
+
const right = expr.right;
|
|
80270
|
+
const leftIsNumeric = evaluatesToNumericLiteral(left);
|
|
80271
|
+
const rightIsNumeric = evaluatesToNumericLiteral(right);
|
|
80272
|
+
return !(leftIsNumeric && rightIsNumeric) && (evaluatesToStringLiteral(left) || leftIsNumeric) && (evaluatesToStringLiteral(right) || rightIsNumeric) && expr.operatorToken.kind === 40 /* PlusToken */;
|
|
80273
|
+
case 228 /* TemplateExpression */:
|
|
80274
|
+
return expr.templateSpans.every((span) => evaluatesToStringLiteral(span.expression));
|
|
80275
|
+
case 217 /* ParenthesizedExpression */:
|
|
80276
|
+
return evaluatesToStringLiteral(expr.expression);
|
|
80277
|
+
case 11 /* StringLiteral */:
|
|
80278
|
+
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
80279
|
+
return true;
|
|
80280
|
+
}
|
|
80281
|
+
return false;
|
|
80282
|
+
}
|
|
80097
80283
|
function evaluate(expr, location) {
|
|
80098
80284
|
switch (expr.kind) {
|
|
80099
80285
|
case 224 /* PrefixUnaryExpression */:
|
|
@@ -82657,7 +82843,7 @@ function createTypeChecker(host) {
|
|
|
82657
82843
|
if (enumResult)
|
|
82658
82844
|
return enumResult;
|
|
82659
82845
|
const literalValue = type.value;
|
|
82660
|
-
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "
|
|
82846
|
+
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-literalValue)) : factory.createNumericLiteral(literalValue);
|
|
82661
82847
|
}
|
|
82662
82848
|
function createLiteralConstValue(node, tracker) {
|
|
82663
82849
|
const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
|
|
@@ -89086,7 +89272,7 @@ function transformTypeScript(context) {
|
|
|
89086
89272
|
function transformEnumMemberDeclarationValue(member) {
|
|
89087
89273
|
const value = resolver.getConstantValue(member);
|
|
89088
89274
|
if (value !== void 0) {
|
|
89089
|
-
return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
|
|
89275
|
+
return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-value)) : factory2.createNumericLiteral(value);
|
|
89090
89276
|
} else {
|
|
89091
89277
|
enableSubstitutionForNonQualifiedEnumMembers();
|
|
89092
89278
|
if (member.initializer) {
|
|
@@ -89616,7 +89802,7 @@ function transformTypeScript(context) {
|
|
|
89616
89802
|
const constantValue = tryGetConstEnumValue(node);
|
|
89617
89803
|
if (constantValue !== void 0) {
|
|
89618
89804
|
setConstantValue(node, constantValue);
|
|
89619
|
-
const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(
|
|
89805
|
+
const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constantValue)) : factory2.createNumericLiteral(constantValue);
|
|
89620
89806
|
if (!compilerOptions.removeComments) {
|
|
89621
89807
|
const originalNode = getOriginalNode(node, isAccessExpression);
|
|
89622
89808
|
addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `);
|
|
@@ -103406,7 +103592,7 @@ function transformGenerators(context) {
|
|
|
103406
103592
|
if (labelExpressions === void 0) {
|
|
103407
103593
|
labelExpressions = [];
|
|
103408
103594
|
}
|
|
103409
|
-
const expression = factory2.createNumericLiteral(
|
|
103595
|
+
const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
|
|
103410
103596
|
if (labelExpressions[label] === void 0) {
|
|
103411
103597
|
labelExpressions[label] = [expression];
|
|
103412
103598
|
} else {
|
|
@@ -109281,7 +109467,8 @@ function transformDeclarations(context) {
|
|
|
109281
109467
|
if (shouldStripInternal(m))
|
|
109282
109468
|
return;
|
|
109283
109469
|
const constValue = resolver.getConstantValue(m);
|
|
109284
|
-
|
|
109470
|
+
const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constValue)) : factory2.createNumericLiteral(constValue);
|
|
109471
|
+
return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
|
|
109285
109472
|
}))
|
|
109286
109473
|
));
|
|
109287
109474
|
}
|
|
@@ -111171,6 +111358,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
111171
111358
|
);
|
|
111172
111359
|
if (hint === 3 /* MappedTypeParameter */)
|
|
111173
111360
|
return emitMappedTypeParameter(cast(node, isTypeParameterDeclaration));
|
|
111361
|
+
if (hint === 7 /* ImportTypeNodeAttributes */)
|
|
111362
|
+
return emitImportTypeNodeAttributes(cast(node, isImportAttributes));
|
|
111174
111363
|
if (hint === 5 /* EmbeddedStatement */) {
|
|
111175
111364
|
Debug.assertNode(node, isEmptyStatement);
|
|
111176
111365
|
return emitEmptyStatement(
|
|
@@ -112147,15 +112336,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112147
112336
|
if (node.attributes) {
|
|
112148
112337
|
writePunctuation(",");
|
|
112149
112338
|
writeSpace();
|
|
112150
|
-
|
|
112151
|
-
writeSpace();
|
|
112152
|
-
writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
112153
|
-
writePunctuation(":");
|
|
112154
|
-
writeSpace();
|
|
112155
|
-
const elements = node.attributes.elements;
|
|
112156
|
-
emitList(node.attributes, elements, 526226 /* ImportAttributes */);
|
|
112157
|
-
writeSpace();
|
|
112158
|
-
writePunctuation("}");
|
|
112339
|
+
pipelineEmit(7 /* ImportTypeNodeAttributes */, node.attributes);
|
|
112159
112340
|
}
|
|
112160
112341
|
writePunctuation(")");
|
|
112161
112342
|
if (node.qualifier) {
|
|
@@ -113217,6 +113398,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
113217
113398
|
}
|
|
113218
113399
|
writeTrailingSemicolon();
|
|
113219
113400
|
}
|
|
113401
|
+
function emitImportTypeNodeAttributes(node) {
|
|
113402
|
+
writePunctuation("{");
|
|
113403
|
+
writeSpace();
|
|
113404
|
+
writeKeyword(node.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
113405
|
+
writePunctuation(":");
|
|
113406
|
+
writeSpace();
|
|
113407
|
+
const elements = node.elements;
|
|
113408
|
+
emitList(node, elements, 526226 /* ImportAttributes */);
|
|
113409
|
+
writeSpace();
|
|
113410
|
+
writePunctuation("}");
|
|
113411
|
+
}
|
|
113220
113412
|
function emitImportAttributes(node) {
|
|
113221
113413
|
emitTokenWithComment(node.token, node.pos, writeKeyword, node);
|
|
113222
113414
|
writeSpace();
|