@typescript-deploys/pr-build 5.4.0-pr-56681-3 → 5.4.0-pr-56680-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/lib/tsc.js +82 -229
- package/lib/tsserver.js +96 -274
- package/lib/typescript.d.ts +2 -24
- package/lib/typescript.js +97 -272
- package/lib/typingsInstaller.js +36 -111
- package/package.json +2 -2
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.20231206`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7353,9 +7353,6 @@ var Diagnostics = {
|
|
|
7353
7353
|
Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
|
|
7354
7354
|
Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
|
|
7355
7355
|
Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
|
|
7356
|
-
Specify_how_files_are_determined_to_be_ECMAScript_modules_or_CommonJS_modules: diag(6805, 3 /* Message */, "Specify_how_files_are_determined_to_be_ECMAScript_modules_or_CommonJS_modules_6805", "Specify how files are determined to be ECMAScript modules or CommonJS modules."),
|
|
7357
|
-
Specify_the_target_runtime_s_rules_for_ESM_CommonJS_interoperation: diag(6806, 3 /* Message */, "Specify_the_target_runtime_s_rules_for_ESM_CommonJS_interoperation_6806", "Specify the target runtime's rules for ESM-CommonJS interoperation."),
|
|
7358
|
-
Specify_defaults_for_module_options_suited_for_common_runtimes_and_bundlers: diag(6807, 3 /* Message */, "Specify_defaults_for_module_options_suited_for_common_runtimes_and_bundlers_6807", "Specify defaults for module options suited for common runtimes and bundlers."),
|
|
7359
7356
|
one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"),
|
|
7360
7357
|
one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"),
|
|
7361
7358
|
type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"),
|
|
@@ -7388,8 +7385,6 @@ var Diagnostics = {
|
|
|
7388
7385
|
Compiles_the_current_project_with_additional_settings: diag(6929, 3 /* Message */, "Compiles_the_current_project_with_additional_settings_6929", "Compiles the current project, with additional settings."),
|
|
7389
7386
|
true_for_ES2022_and_above_including_ESNext: diag(6930, 3 /* Message */, "true_for_ES2022_and_above_including_ESNext_6930", "`true` for ES2022 and above, including ESNext."),
|
|
7390
7387
|
List_of_file_name_suffixes_to_search_when_resolving_a_module: diag(6931, 1 /* Error */, "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931", "List of file name suffixes to search when resolving a module."),
|
|
7391
|
-
node16_when_module_is_node16_nodenext_when_module_is_nodenext_none_otherwise: diag(6932, 3 /* Message */, "node16_when_module_is_node16_nodenext_when_module_is_nodenext_none_otherwise_6932", "'node16' when 'module' is 'node16'; 'nodenext' when 'module' is 'nodenext'; 'none' otherwise."),
|
|
7392
|
-
node16_when_module_is_node16_nodenext_when_module_is_nodenext_babel_otherwise: diag(6933, 3 /* Message */, "node16_when_module_is_node16_nodenext_when_module_is_nodenext_babel_otherwise_6933", "'node16' when 'module' is 'node16'; 'nodenext' when 'module' is 'nodenext'; 'babel' otherwise."),
|
|
7393
7388
|
Variable_0_implicitly_has_an_1_type: diag(7005, 1 /* Error */, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."),
|
|
7394
7389
|
Parameter_0_implicitly_has_an_1_type: diag(7006, 1 /* Error */, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."),
|
|
7395
7390
|
Member_0_implicitly_has_an_1_type: diag(7008, 1 /* Error */, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."),
|
|
@@ -13871,12 +13866,12 @@ function canHaveJSDoc(node) {
|
|
|
13871
13866
|
function getJSDocCommentsAndTags(hostNode, noCache) {
|
|
13872
13867
|
let result;
|
|
13873
13868
|
if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
|
|
13874
|
-
result = addRange(result, filterOwnedJSDocTags(hostNode,
|
|
13869
|
+
result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
|
|
13875
13870
|
}
|
|
13876
13871
|
let node = hostNode;
|
|
13877
13872
|
while (node && node.parent) {
|
|
13878
13873
|
if (hasJSDocNodes(node)) {
|
|
13879
|
-
result = addRange(result, filterOwnedJSDocTags(hostNode,
|
|
13874
|
+
result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
|
|
13880
13875
|
}
|
|
13881
13876
|
if (node.kind === 169 /* Parameter */) {
|
|
13882
13877
|
result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
|
|
@@ -13890,12 +13885,16 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
|
|
|
13890
13885
|
}
|
|
13891
13886
|
return result || emptyArray;
|
|
13892
13887
|
}
|
|
13893
|
-
function filterOwnedJSDocTags(hostNode,
|
|
13894
|
-
|
|
13895
|
-
|
|
13896
|
-
|
|
13897
|
-
|
|
13898
|
-
|
|
13888
|
+
function filterOwnedJSDocTags(hostNode, comments) {
|
|
13889
|
+
const lastJsDoc = last(comments);
|
|
13890
|
+
return flatMap(comments, (jsDoc) => {
|
|
13891
|
+
if (jsDoc === lastJsDoc) {
|
|
13892
|
+
const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
|
|
13893
|
+
return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
|
|
13894
|
+
} else {
|
|
13895
|
+
return filter(jsDoc.tags, isJSDocOverloadTag);
|
|
13896
|
+
}
|
|
13897
|
+
});
|
|
13899
13898
|
}
|
|
13900
13899
|
function ownsJSDocTag(hostNode, tag) {
|
|
13901
13900
|
return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
|
|
@@ -13934,6 +13933,9 @@ function getEffectiveContainerForJSDocTemplateTag(node) {
|
|
|
13934
13933
|
}
|
|
13935
13934
|
return getHostSignatureFromJSDoc(node);
|
|
13936
13935
|
}
|
|
13936
|
+
function getJSDocOverloadTags(node) {
|
|
13937
|
+
return getAllJSDocTags(node, isJSDocOverloadTag);
|
|
13938
|
+
}
|
|
13937
13939
|
function getHostSignatureFromJSDoc(node) {
|
|
13938
13940
|
const host = getEffectiveJSDocHost(node);
|
|
13939
13941
|
if (host) {
|
|
@@ -16364,46 +16366,11 @@ function getEmitScriptTarget(compilerOptions) {
|
|
|
16364
16366
|
return compilerOptions.target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
|
|
16365
16367
|
}
|
|
16366
16368
|
function getEmitModuleKind(compilerOptions) {
|
|
16367
|
-
if (typeof compilerOptions.module === "object" && compilerOptions.module.emit !== void 0) {
|
|
16368
|
-
return compilerOptions.module.emit;
|
|
16369
|
-
}
|
|
16370
16369
|
return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
|
|
16371
16370
|
}
|
|
16372
16371
|
function emitModuleKindIsNonNodeESM(moduleKind) {
|
|
16373
16372
|
return moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */;
|
|
16374
16373
|
}
|
|
16375
|
-
function getModulePreset(compilerOptions) {
|
|
16376
|
-
if (typeof compilerOptions.module === "object") {
|
|
16377
|
-
return compilerOptions.module.preset;
|
|
16378
|
-
}
|
|
16379
|
-
return compilerOptions.module;
|
|
16380
|
-
}
|
|
16381
|
-
function getModuleFormatDetectionKind(compilerOptions) {
|
|
16382
|
-
if (typeof compilerOptions.module === "object" && compilerOptions.module.formatDetection !== void 0) {
|
|
16383
|
-
return compilerOptions.module.formatDetection;
|
|
16384
|
-
}
|
|
16385
|
-
switch (getModulePreset(compilerOptions)) {
|
|
16386
|
-
case 100 /* Node16 */:
|
|
16387
|
-
return 100 /* Node16 */;
|
|
16388
|
-
case 199 /* NodeNext */:
|
|
16389
|
-
return 199 /* NodeNext */;
|
|
16390
|
-
default:
|
|
16391
|
-
return 0 /* None */;
|
|
16392
|
-
}
|
|
16393
|
-
}
|
|
16394
|
-
function getModuleFormatInteropKind(compilerOptions) {
|
|
16395
|
-
if (typeof compilerOptions.module === "object" && compilerOptions.module.formatInterop !== void 0) {
|
|
16396
|
-
return compilerOptions.module.formatInterop;
|
|
16397
|
-
}
|
|
16398
|
-
switch (getModulePreset(compilerOptions)) {
|
|
16399
|
-
case 100 /* Node16 */:
|
|
16400
|
-
return 100 /* Node16 */;
|
|
16401
|
-
case 199 /* NodeNext */:
|
|
16402
|
-
return 199 /* NodeNext */;
|
|
16403
|
-
default:
|
|
16404
|
-
return 1 /* Babel */;
|
|
16405
|
-
}
|
|
16406
|
-
}
|
|
16407
16374
|
function getEmitModuleResolutionKind(compilerOptions) {
|
|
16408
16375
|
let moduleResolution = compilerOptions.moduleResolution;
|
|
16409
16376
|
if (moduleResolution === void 0) {
|
|
@@ -17566,6 +17533,10 @@ function hasResolutionModeOverride(node) {
|
|
|
17566
17533
|
}
|
|
17567
17534
|
return !!getResolutionModeOverride(node.attributes);
|
|
17568
17535
|
}
|
|
17536
|
+
var stringReplace = String.prototype.replace;
|
|
17537
|
+
function replaceFirstStar(s, replacement) {
|
|
17538
|
+
return stringReplace.call(s, "*", replacement);
|
|
17539
|
+
}
|
|
17569
17540
|
|
|
17570
17541
|
// src/compiler/factory/baseNodeFactory.ts
|
|
17571
17542
|
function createBaseNodeFactory() {
|
|
@@ -34234,79 +34205,23 @@ var targetOptionDeclaration = {
|
|
|
34234
34205
|
description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
|
|
34235
34206
|
defaultValueDescription: 1 /* ES5 */
|
|
34236
34207
|
};
|
|
34237
|
-
var moduleKindMap = new Map(Object.entries({
|
|
34238
|
-
none: 0 /* None */,
|
|
34239
|
-
commonjs: 1 /* CommonJS */,
|
|
34240
|
-
amd: 2 /* AMD */,
|
|
34241
|
-
system: 4 /* System */,
|
|
34242
|
-
umd: 3 /* UMD */,
|
|
34243
|
-
es6: 5 /* ES2015 */,
|
|
34244
|
-
es2015: 5 /* ES2015 */,
|
|
34245
|
-
es2020: 6 /* ES2020 */,
|
|
34246
|
-
es2022: 7 /* ES2022 */,
|
|
34247
|
-
esnext: 99 /* ESNext */,
|
|
34248
|
-
node16: 100 /* Node16 */,
|
|
34249
|
-
nodenext: 199 /* NodeNext */
|
|
34250
|
-
}));
|
|
34251
|
-
var moduleSubOptionDeclarations = [
|
|
34252
|
-
{
|
|
34253
|
-
name: "preset",
|
|
34254
|
-
type: moduleKindMap,
|
|
34255
|
-
affectsSourceFile: true,
|
|
34256
|
-
affectsBuildInfo: true,
|
|
34257
|
-
affectsEmit: true,
|
|
34258
|
-
affectsSemanticDiagnostics: true,
|
|
34259
|
-
category: Diagnostics.Modules,
|
|
34260
|
-
description: Diagnostics.Specify_defaults_for_module_options_suited_for_common_runtimes_and_bundlers,
|
|
34261
|
-
defaultValueDescription: void 0,
|
|
34262
|
-
getParentOption: getModuleOptionDeclaration
|
|
34263
|
-
},
|
|
34264
|
-
{
|
|
34265
|
-
name: "formatDetection",
|
|
34266
|
-
type: new Map(Object.entries({
|
|
34267
|
-
none: 0 /* None */,
|
|
34268
|
-
bundler: 1 /* Bundler */,
|
|
34269
|
-
node16: 100 /* Node16 */,
|
|
34270
|
-
nodenext: 199 /* NodeNext */
|
|
34271
|
-
})),
|
|
34272
|
-
affectsModuleResolution: true,
|
|
34273
|
-
affectsSemanticDiagnostics: true,
|
|
34274
|
-
affectsEmit: true,
|
|
34275
|
-
category: Diagnostics.Modules,
|
|
34276
|
-
description: Diagnostics.Specify_how_files_are_determined_to_be_ECMAScript_modules_or_CommonJS_modules,
|
|
34277
|
-
defaultValueDescription: Diagnostics.node16_when_module_is_node16_nodenext_when_module_is_nodenext_none_otherwise,
|
|
34278
|
-
getParentOption: getModuleOptionDeclaration
|
|
34279
|
-
},
|
|
34280
|
-
{
|
|
34281
|
-
name: "formatInterop",
|
|
34282
|
-
type: new Map(Object.entries({
|
|
34283
|
-
babel: 1 /* Babel */,
|
|
34284
|
-
bundlernode: 2 /* BundlerNode */,
|
|
34285
|
-
node16: 100 /* Node16 */,
|
|
34286
|
-
nodenext: 199 /* NodeNext */
|
|
34287
|
-
})),
|
|
34288
|
-
affectsSemanticDiagnostics: true,
|
|
34289
|
-
category: Diagnostics.Modules,
|
|
34290
|
-
description: Diagnostics.Specify_the_target_runtime_s_rules_for_ESM_CommonJS_interoperation,
|
|
34291
|
-
defaultValueDescription: Diagnostics.node16_when_module_is_node16_nodenext_when_module_is_nodenext_babel_otherwise,
|
|
34292
|
-
getParentOption: getModuleOptionDeclaration
|
|
34293
|
-
},
|
|
34294
|
-
{
|
|
34295
|
-
name: "emit",
|
|
34296
|
-
type: moduleKindMap,
|
|
34297
|
-
affectsEmit: true,
|
|
34298
|
-
category: Diagnostics.Modules,
|
|
34299
|
-
description: Diagnostics.Specify_what_module_code_is_generated,
|
|
34300
|
-
defaultValueDescription: void 0,
|
|
34301
|
-
getParentOption: getModuleOptionDeclaration
|
|
34302
|
-
}
|
|
34303
|
-
];
|
|
34304
34208
|
var moduleOptionDeclaration = {
|
|
34305
34209
|
name: "module",
|
|
34306
34210
|
shortName: "m",
|
|
34307
|
-
type:
|
|
34308
|
-
|
|
34309
|
-
|
|
34211
|
+
type: new Map(Object.entries({
|
|
34212
|
+
none: 0 /* None */,
|
|
34213
|
+
commonjs: 1 /* CommonJS */,
|
|
34214
|
+
amd: 2 /* AMD */,
|
|
34215
|
+
system: 4 /* System */,
|
|
34216
|
+
umd: 3 /* UMD */,
|
|
34217
|
+
es6: 5 /* ES2015 */,
|
|
34218
|
+
es2015: 5 /* ES2015 */,
|
|
34219
|
+
es2020: 6 /* ES2020 */,
|
|
34220
|
+
es2022: 7 /* ES2022 */,
|
|
34221
|
+
esnext: 99 /* ESNext */,
|
|
34222
|
+
node16: 100 /* Node16 */,
|
|
34223
|
+
nodenext: 199 /* NodeNext */
|
|
34224
|
+
})),
|
|
34310
34225
|
affectsSourceFile: true,
|
|
34311
34226
|
affectsModuleResolution: true,
|
|
34312
34227
|
affectsEmit: true,
|
|
@@ -34317,9 +34232,6 @@ var moduleOptionDeclaration = {
|
|
|
34317
34232
|
description: Diagnostics.Specify_what_module_code_is_generated,
|
|
34318
34233
|
defaultValueDescription: void 0
|
|
34319
34234
|
};
|
|
34320
|
-
function getModuleOptionDeclaration() {
|
|
34321
|
-
return moduleOptionDeclaration;
|
|
34322
|
-
}
|
|
34323
34235
|
var commandOptionsWithoutBuild = [
|
|
34324
34236
|
// CommandLine only options
|
|
34325
34237
|
{
|
|
@@ -34386,9 +34298,6 @@ var commandOptionsWithoutBuild = [
|
|
|
34386
34298
|
// Basic
|
|
34387
34299
|
targetOptionDeclaration,
|
|
34388
34300
|
moduleOptionDeclaration,
|
|
34389
|
-
// HEAD
|
|
34390
|
-
//
|
|
34391
|
-
// parent of 19e60f1a19 (Fix showConfig)
|
|
34392
34301
|
{
|
|
34393
34302
|
name: "lib",
|
|
34394
34303
|
type: "list",
|
|
@@ -35385,16 +35294,10 @@ function createOptionNameMap(optionDeclarations2) {
|
|
|
35385
35294
|
const optionsNameMap = /* @__PURE__ */ new Map();
|
|
35386
35295
|
const shortOptionNames = /* @__PURE__ */ new Map();
|
|
35387
35296
|
forEach(optionDeclarations2, (option) => {
|
|
35388
|
-
|
|
35389
|
-
optionsNameMap.set(lowerCaseName, option);
|
|
35297
|
+
optionsNameMap.set(option.name.toLowerCase(), option);
|
|
35390
35298
|
if (option.shortName) {
|
|
35391
35299
|
shortOptionNames.set(option.shortName, option.name);
|
|
35392
35300
|
}
|
|
35393
|
-
if (option.type === "objectOrShorthand") {
|
|
35394
|
-
forEachEntry(option.elementOptions, (subOption, subOptionName) => {
|
|
35395
|
-
optionsNameMap.set(`${lowerCaseName}.${subOptionName.toLowerCase()}`, subOption);
|
|
35396
|
-
});
|
|
35397
|
-
}
|
|
35398
35301
|
});
|
|
35399
35302
|
return { optionsNameMap, shortOptionNames };
|
|
35400
35303
|
}
|
|
@@ -35415,8 +35318,7 @@ var defaultInitCompilerOptions = {
|
|
|
35415
35318
|
skipLibCheck: true
|
|
35416
35319
|
};
|
|
35417
35320
|
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
|
|
35418
|
-
const
|
|
35419
|
-
const namesOfType = arrayFrom(type.keys());
|
|
35321
|
+
const namesOfType = arrayFrom(opt.type.keys());
|
|
35420
35322
|
const stringNames = (opt.deprecatedKeys ? namesOfType.filter((k) => !opt.deprecatedKeys.has(k)) : namesOfType).map((key) => `'${key}'`).join(", ");
|
|
35421
35323
|
return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, stringNames);
|
|
35422
35324
|
}
|
|
@@ -35539,7 +35441,6 @@ function parseCommandLineWorker(diagnostics, commandLine, readFile) {
|
|
|
35539
35441
|
}
|
|
35540
35442
|
}
|
|
35541
35443
|
function parseOptionValue(args, i, diagnostics, opt, options, errors) {
|
|
35542
|
-
var _a;
|
|
35543
35444
|
if (opt.isTSConfigOnly) {
|
|
35544
35445
|
const optValue = args[i];
|
|
35545
35446
|
if (optValue === "null") {
|
|
@@ -35568,46 +35469,40 @@ function parseOptionValue(args, i, diagnostics, opt, options, errors) {
|
|
|
35568
35469
|
if (!args[i] && opt.type !== "boolean") {
|
|
35569
35470
|
errors.push(createCompilerDiagnostic(diagnostics.optionTypeMismatchDiagnostic, opt.name, getCompilerOptionValueTypeString(opt)));
|
|
35570
35471
|
}
|
|
35571
|
-
const parentOption = (_a = opt.getParentOption) == null ? void 0 : _a.call(opt);
|
|
35572
|
-
const [base = {}, name] = parentOption ? [options[parentOption.name], opt.name] : [options, opt.name];
|
|
35573
|
-
if (parentOption) {
|
|
35574
|
-
options[parentOption.name] = base;
|
|
35575
|
-
}
|
|
35576
35472
|
if (args[i] !== "null") {
|
|
35577
|
-
switch (opt.type
|
|
35473
|
+
switch (opt.type) {
|
|
35578
35474
|
case "number":
|
|
35579
|
-
|
|
35475
|
+
options[opt.name] = validateJsonOptionValue(opt, parseInt(args[i]), errors);
|
|
35580
35476
|
i++;
|
|
35581
35477
|
break;
|
|
35582
35478
|
case "boolean":
|
|
35583
35479
|
const optValue = args[i];
|
|
35584
|
-
|
|
35480
|
+
options[opt.name] = validateJsonOptionValue(opt, optValue !== "false", errors);
|
|
35585
35481
|
if (optValue === "false" || optValue === "true") {
|
|
35586
35482
|
i++;
|
|
35587
35483
|
}
|
|
35588
35484
|
break;
|
|
35589
35485
|
case "string":
|
|
35590
|
-
|
|
35486
|
+
options[opt.name] = validateJsonOptionValue(opt, args[i] || "", errors);
|
|
35591
35487
|
i++;
|
|
35592
35488
|
break;
|
|
35593
35489
|
case "list":
|
|
35594
35490
|
const result = parseListTypeOption(opt, args[i], errors);
|
|
35595
|
-
|
|
35491
|
+
options[opt.name] = result || [];
|
|
35596
35492
|
if (result) {
|
|
35597
35493
|
i++;
|
|
35598
35494
|
}
|
|
35599
35495
|
break;
|
|
35600
|
-
case "object":
|
|
35601
35496
|
case "listOrElement":
|
|
35602
|
-
Debug.fail("listOrElement
|
|
35497
|
+
Debug.fail("listOrElement not supported here");
|
|
35603
35498
|
break;
|
|
35604
35499
|
default:
|
|
35605
|
-
|
|
35500
|
+
options[opt.name] = parseCustomTypeOption(opt, args[i], errors);
|
|
35606
35501
|
i++;
|
|
35607
35502
|
break;
|
|
35608
35503
|
}
|
|
35609
35504
|
} else {
|
|
35610
|
-
|
|
35505
|
+
options[opt.name] = void 0;
|
|
35611
35506
|
i++;
|
|
35612
35507
|
}
|
|
35613
35508
|
}
|
|
@@ -35973,23 +35868,17 @@ function isCompilerOptionsValue(option, value) {
|
|
|
35973
35868
|
if (option) {
|
|
35974
35869
|
if (isNullOrUndefined(value))
|
|
35975
35870
|
return !option.disallowNullOrUndefined;
|
|
35976
|
-
if (option.type === "
|
|
35977
|
-
return
|
|
35871
|
+
if (option.type === "list") {
|
|
35872
|
+
return isArray(value);
|
|
35978
35873
|
}
|
|
35979
|
-
if (option.type === "
|
|
35980
|
-
return
|
|
35874
|
+
if (option.type === "listOrElement") {
|
|
35875
|
+
return isArray(value) || isCompilerOptionsValue(option.element, value);
|
|
35981
35876
|
}
|
|
35982
|
-
|
|
35877
|
+
const expectedType = isString(option.type) ? option.type : "string";
|
|
35878
|
+
return typeof value === expectedType;
|
|
35983
35879
|
}
|
|
35984
35880
|
return false;
|
|
35985
35881
|
}
|
|
35986
|
-
function isCompilerOptionsValueWorker(type, value) {
|
|
35987
|
-
if (type === "list") {
|
|
35988
|
-
return isArray(value);
|
|
35989
|
-
}
|
|
35990
|
-
const expectedType = isString(type) ? type : "string";
|
|
35991
|
-
return typeof value === expectedType;
|
|
35992
|
-
}
|
|
35993
35882
|
function convertToTSConfig(configParseResult, configFileName, host) {
|
|
35994
35883
|
var _a, _b, _c;
|
|
35995
35884
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames);
|
|
@@ -36073,8 +35962,6 @@ function getCustomTypeMapOfCommandLineOption(optionDefinition) {
|
|
|
36073
35962
|
case "list":
|
|
36074
35963
|
case "listOrElement":
|
|
36075
35964
|
return getCustomTypeMapOfCommandLineOption(optionDefinition.element);
|
|
36076
|
-
case "objectOrShorthand":
|
|
36077
|
-
return typeof optionDefinition.shorthandType === "object" ? optionDefinition.shorthandType : void 0;
|
|
36078
35965
|
default:
|
|
36079
35966
|
return optionDefinition.type;
|
|
36080
35967
|
}
|
|
@@ -36573,7 +36460,6 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa
|
|
|
36573
36460
|
const options = getDefaultCompilerOptions(configFileName);
|
|
36574
36461
|
let typeAcquisition;
|
|
36575
36462
|
let watchOptions;
|
|
36576
|
-
let moduleOption;
|
|
36577
36463
|
let extendedConfigPath;
|
|
36578
36464
|
let rootCompilerOptions;
|
|
36579
36465
|
const rootOptions = getTsconfigRootOptionsMap();
|
|
@@ -36601,8 +36487,6 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa
|
|
|
36601
36487
|
currentOption = watchOptions ?? (watchOptions = {});
|
|
36602
36488
|
else if (parentOption === typeAcquisitionDeclaration)
|
|
36603
36489
|
currentOption = typeAcquisition ?? (typeAcquisition = getDefaultTypeAcquisition(configFileName));
|
|
36604
|
-
else if (parentOption === moduleOptionDeclaration)
|
|
36605
|
-
currentOption = moduleOption ?? (moduleOption = {});
|
|
36606
36490
|
else
|
|
36607
36491
|
Debug.fail("Unknown option");
|
|
36608
36492
|
currentOption[option.name] = value;
|
|
@@ -36764,16 +36648,6 @@ function convertJsonOption(opt, value, basePath, errors, propertyAssignment, val
|
|
|
36764
36648
|
return convertJsonOptionOfListType(opt, value, basePath, errors, propertyAssignment, valueExpression, sourceFile);
|
|
36765
36649
|
} else if (optType === "listOrElement") {
|
|
36766
36650
|
return isArray(value) ? convertJsonOptionOfListType(opt, value, basePath, errors, propertyAssignment, valueExpression, sourceFile) : convertJsonOption(opt.element, value, basePath, errors, propertyAssignment, valueExpression, sourceFile);
|
|
36767
|
-
} else if (optType === "objectOrShorthand") {
|
|
36768
|
-
if (!value || typeof value !== "object") {
|
|
36769
|
-
if (!isString(opt.shorthandType)) {
|
|
36770
|
-
return convertJsonOptionOfCustomType(opt, value, errors, valueExpression, sourceFile);
|
|
36771
|
-
}
|
|
36772
|
-
const validatedValue2 = validateJsonOptionValue(opt, value, errors, valueExpression, sourceFile);
|
|
36773
|
-
return isNullOrUndefined(validatedValue2) ? validatedValue2 : normalizeNonListOptionValue(opt, basePath, validatedValue2);
|
|
36774
|
-
} else {
|
|
36775
|
-
return {};
|
|
36776
|
-
}
|
|
36777
36651
|
} else if (!isString(opt.type)) {
|
|
36778
36652
|
return convertJsonOptionOfCustomType(opt, value, errors, valueExpression, sourceFile);
|
|
36779
36653
|
}
|
|
@@ -36806,8 +36680,7 @@ function convertJsonOptionOfCustomType(opt, value, errors, valueExpression, sour
|
|
|
36806
36680
|
if (isNullOrUndefined(value))
|
|
36807
36681
|
return void 0;
|
|
36808
36682
|
const key = value.toLowerCase();
|
|
36809
|
-
const
|
|
36810
|
-
const val = type.get(key);
|
|
36683
|
+
const val = opt.type.get(key);
|
|
36811
36684
|
if (val !== void 0) {
|
|
36812
36685
|
return validateJsonOptionValue(opt, val, errors, valueExpression, sourceFile);
|
|
36813
36686
|
} else {
|
|
@@ -37034,8 +36907,7 @@ function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, exte
|
|
|
37034
36907
|
}
|
|
37035
36908
|
}
|
|
37036
36909
|
function getDefaultValueForOption(option) {
|
|
37037
|
-
|
|
37038
|
-
switch (type) {
|
|
36910
|
+
switch (option.type) {
|
|
37039
36911
|
case "number":
|
|
37040
36912
|
return 1;
|
|
37041
36913
|
case "boolean":
|
|
@@ -39295,7 +39167,7 @@ function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, p
|
|
|
39295
39167
|
trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
|
|
39296
39168
|
}
|
|
39297
39169
|
const resolved = forEach(paths[matchedPatternText], (subst) => {
|
|
39298
|
-
const path = matchedStar ? subst
|
|
39170
|
+
const path = matchedStar ? replaceFirstStar(subst, matchedStar) : subst;
|
|
39299
39171
|
const candidate = normalizePath(combinePaths(baseDirectory, path));
|
|
39300
39172
|
if (state.traceEnabled) {
|
|
39301
39173
|
trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path);
|
|
@@ -42932,7 +42804,7 @@ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, hos
|
|
|
42932
42804
|
if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
|
|
42933
42805
|
const matchedStar = value.substring(prefix.length, value.length - suffix.length);
|
|
42934
42806
|
if (!pathIsRelative(matchedStar)) {
|
|
42935
|
-
return key
|
|
42807
|
+
return replaceFirstStar(key, matchedStar);
|
|
42936
42808
|
}
|
|
42937
42809
|
}
|
|
42938
42810
|
}
|
|
@@ -42980,11 +42852,11 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
|
|
|
42980
42852
|
const trailingSlice = pathOrPattern.slice(starPos + 1);
|
|
42981
42853
|
if (startsWith(targetFilePath, leadingSlice) && endsWith(targetFilePath, trailingSlice)) {
|
|
42982
42854
|
const starReplacement = targetFilePath.slice(leadingSlice.length, targetFilePath.length - trailingSlice.length);
|
|
42983
|
-
return { moduleFileToTry: packageName
|
|
42855
|
+
return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
|
|
42984
42856
|
}
|
|
42985
42857
|
if (extensionSwappedTarget && startsWith(extensionSwappedTarget, leadingSlice) && endsWith(extensionSwappedTarget, trailingSlice)) {
|
|
42986
42858
|
const starReplacement = extensionSwappedTarget.slice(leadingSlice.length, extensionSwappedTarget.length - trailingSlice.length);
|
|
42987
|
-
return { moduleFileToTry: packageName
|
|
42859
|
+
return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
|
|
42988
42860
|
}
|
|
42989
42861
|
break;
|
|
42990
42862
|
}
|
|
@@ -45772,16 +45644,19 @@ function createTypeChecker(host) {
|
|
|
45772
45644
|
return isStringLiteralLike(usage) ? getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0;
|
|
45773
45645
|
}
|
|
45774
45646
|
function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) {
|
|
45775
|
-
return usageMode === 99 /* ESNext */ && targetMode
|
|
45647
|
+
return usageMode === 99 /* ESNext */ && targetMode === 1 /* CommonJS */;
|
|
45776
45648
|
}
|
|
45777
45649
|
function isOnlyImportedAsDefault(usage) {
|
|
45778
45650
|
const usageMode = getUsageModeForExpression(usage);
|
|
45779
45651
|
return usageMode === 99 /* ESNext */ && endsWith(usage.text, ".json" /* Json */);
|
|
45780
45652
|
}
|
|
45781
45653
|
function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) {
|
|
45782
|
-
const usageMode = file &&
|
|
45783
|
-
if (
|
|
45784
|
-
|
|
45654
|
+
const usageMode = file && getUsageModeForExpression(usage);
|
|
45655
|
+
if (file && usageMode !== void 0) {
|
|
45656
|
+
const result = isESMFormatImportImportingCommonjsFormatFile(usageMode, file.impliedNodeFormat);
|
|
45657
|
+
if (usageMode === 99 /* ESNext */ || result) {
|
|
45658
|
+
return result;
|
|
45659
|
+
}
|
|
45785
45660
|
}
|
|
45786
45661
|
if (!allowSyntheticDefaultImports) {
|
|
45787
45662
|
return false;
|
|
@@ -46674,7 +46549,6 @@ function createTypeChecker(host) {
|
|
|
46674
46549
|
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = findAncestor(location, isImportCall)) == null ? void 0 : _a.arguments[0]) || ((_b = findAncestor(location, isImportDeclaration)) == null ? void 0 : _b.moduleSpecifier) || ((_c = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _c.moduleReference.expression) || ((_d = findAncestor(location, isExportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _e.name) || ((_f = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _f.argument.literal);
|
|
46675
46550
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
46676
46551
|
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
46677
|
-
const moduleFormatInterop = getModuleFormatInteropKind(compilerOptions);
|
|
46678
46552
|
const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
|
|
46679
46553
|
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
46680
46554
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
@@ -46710,7 +46584,7 @@ function createTypeChecker(host) {
|
|
|
46710
46584
|
moduleReference
|
|
46711
46585
|
);
|
|
46712
46586
|
}
|
|
46713
|
-
if (
|
|
46587
|
+
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
46714
46588
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
46715
46589
|
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
46716
46590
|
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
|
@@ -55627,22 +55501,15 @@ function createTypeChecker(host) {
|
|
|
55627
55501
|
}
|
|
55628
55502
|
}
|
|
55629
55503
|
if (isInJSFile(decl) && decl.jsDoc) {
|
|
55630
|
-
|
|
55631
|
-
|
|
55632
|
-
|
|
55633
|
-
|
|
55634
|
-
|
|
55635
|
-
|
|
55636
|
-
if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
|
|
55637
|
-
reportImplicitAny(jsDocSignature, anyType);
|
|
55638
|
-
}
|
|
55639
|
-
result.push(getSignatureFromDeclaration(jsDocSignature));
|
|
55640
|
-
hasJSDocOverloads = true;
|
|
55641
|
-
}
|
|
55504
|
+
const tags = getJSDocOverloadTags(decl);
|
|
55505
|
+
if (length(tags)) {
|
|
55506
|
+
for (const tag of tags) {
|
|
55507
|
+
const jsDocSignature = tag.typeExpression;
|
|
55508
|
+
if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
|
|
55509
|
+
reportImplicitAny(jsDocSignature, anyType);
|
|
55642
55510
|
}
|
|
55511
|
+
result.push(getSignatureFromDeclaration(jsDocSignature));
|
|
55643
55512
|
}
|
|
55644
|
-
}
|
|
55645
|
-
if (hasJSDocOverloads) {
|
|
55646
55513
|
continue;
|
|
55647
55514
|
}
|
|
55648
55515
|
}
|
|
@@ -76793,15 +76660,7 @@ function createTypeChecker(host) {
|
|
|
76793
76660
|
}
|
|
76794
76661
|
}
|
|
76795
76662
|
if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
|
|
76796
|
-
|
|
76797
|
-
if (node2.tags) {
|
|
76798
|
-
for (const tag of node2.tags) {
|
|
76799
|
-
if (isJSDocOverloadTag(tag)) {
|
|
76800
|
-
hasOverloads = true;
|
|
76801
|
-
}
|
|
76802
|
-
}
|
|
76803
|
-
}
|
|
76804
|
-
}
|
|
76663
|
+
hasOverloads = length(getJSDocOverloadTags(current)) > 0;
|
|
76805
76664
|
}
|
|
76806
76665
|
}
|
|
76807
76666
|
}
|
|
@@ -107484,7 +107343,7 @@ function transformECMAScriptModule(context) {
|
|
|
107484
107343
|
return node.isExportEquals ? void 0 : node;
|
|
107485
107344
|
}
|
|
107486
107345
|
function visitExportDeclaration(node) {
|
|
107487
|
-
if (
|
|
107346
|
+
if (compilerOptions.module !== void 0 && compilerOptions.module > 5 /* ES2015 */) {
|
|
107488
107347
|
return node;
|
|
107489
107348
|
}
|
|
107490
107349
|
if (!node.exportClause || !isNamespaceExport(node.exportClause) || !node.moduleSpecifier) {
|
|
@@ -116674,25 +116533,20 @@ function getConfigFileParsingDiagnostics(configFileParseResult) {
|
|
|
116674
116533
|
return configFileParseResult.options.configFile ? [...configFileParseResult.options.configFile.parseDiagnostics, ...configFileParseResult.errors] : configFileParseResult.errors;
|
|
116675
116534
|
}
|
|
116676
116535
|
function getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options) {
|
|
116677
|
-
|
|
116678
|
-
|
|
116679
|
-
case
|
|
116680
|
-
|
|
116681
|
-
case 199 /* NodeNext */:
|
|
116682
|
-
case 2 /* DefaultModule */:
|
|
116683
|
-
case 3 /* DefaultCommonJS */:
|
|
116684
|
-
const defaultFormat = formatDetection === 1 /* Bundler */ ? void 0 : formatDetection === 2 /* DefaultModule */ ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
116685
|
-
return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson(defaultFormat) : void 0;
|
|
116536
|
+
switch (getEmitModuleResolutionKind(options)) {
|
|
116537
|
+
case 3 /* Node16 */:
|
|
116538
|
+
case 99 /* NodeNext */:
|
|
116539
|
+
return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson() : void 0;
|
|
116686
116540
|
default:
|
|
116687
116541
|
return void 0;
|
|
116688
116542
|
}
|
|
116689
|
-
function lookupFromPackageJson(
|
|
116543
|
+
function lookupFromPackageJson() {
|
|
116690
116544
|
const state = getTemporaryModuleResolutionState(packageJsonInfoCache, host, options);
|
|
116691
116545
|
const packageJsonLocations = [];
|
|
116692
116546
|
state.failedLookupLocations = packageJsonLocations;
|
|
116693
116547
|
state.affectingLocations = packageJsonLocations;
|
|
116694
116548
|
const packageJsonScope = getPackageScopeForPath(fileName, state);
|
|
116695
|
-
const impliedNodeFormat = (packageJsonScope == null ? void 0 : packageJsonScope.contents.packageJsonContent.type) === "module" ? 99 /* ESNext */ :
|
|
116549
|
+
const impliedNodeFormat = (packageJsonScope == null ? void 0 : packageJsonScope.contents.packageJsonContent.type) === "module" ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
116696
116550
|
return { impliedNodeFormat, packageJsonLocations, packageJsonScope };
|
|
116697
116551
|
}
|
|
116698
116552
|
}
|
|
@@ -126471,12 +126325,11 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
|
|
|
126471
126325
|
}
|
|
126472
126326
|
function getPossibleValues(option3) {
|
|
126473
126327
|
let possibleValues;
|
|
126474
|
-
|
|
126475
|
-
switch (type) {
|
|
126328
|
+
switch (option3.type) {
|
|
126476
126329
|
case "string":
|
|
126477
126330
|
case "number":
|
|
126478
126331
|
case "boolean":
|
|
126479
|
-
possibleValues = type;
|
|
126332
|
+
possibleValues = option3.type;
|
|
126480
126333
|
break;
|
|
126481
126334
|
case "list":
|
|
126482
126335
|
case "listOrElement":
|
|
@@ -126487,7 +126340,7 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
|
|
|
126487
126340
|
break;
|
|
126488
126341
|
default:
|
|
126489
126342
|
const inverted = {};
|
|
126490
|
-
type.forEach((value, name2) => {
|
|
126343
|
+
option3.type.forEach((value, name2) => {
|
|
126491
126344
|
var _a2;
|
|
126492
126345
|
if (!((_a2 = option3.deprecatedKeys) == null ? void 0 : _a2.has(name2))) {
|
|
126493
126346
|
(inverted[value] || (inverted[value] = [])).push(name2);
|