typescript 5.0.0-dev.20230106 → 5.0.0-dev.20230108
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 +291 -175
- package/lib/tsserver.js +360 -414
- package/lib/tsserverlibrary.js +364 -410
- package/lib/typescript.js +349 -373
- package/lib/typingsInstaller.js +49 -71
- package/package.json +1 -1
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.0";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20230108`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -161,13 +161,10 @@ function map(array, f) {
|
|
|
161
161
|
}
|
|
162
162
|
return result;
|
|
163
163
|
}
|
|
164
|
-
function mapIterator(iter, mapFn) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false };
|
|
169
|
-
}
|
|
170
|
-
};
|
|
164
|
+
function* mapIterator(iter, mapFn) {
|
|
165
|
+
for (const x of iter) {
|
|
166
|
+
yield mapFn(x);
|
|
167
|
+
}
|
|
171
168
|
}
|
|
172
169
|
function sameMap(array, f) {
|
|
173
170
|
if (array) {
|
|
@@ -247,21 +244,13 @@ function mapDefined(array, mapFn) {
|
|
|
247
244
|
}
|
|
248
245
|
return result;
|
|
249
246
|
}
|
|
250
|
-
function mapDefinedIterator(iter, mapFn) {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
if (res.done) {
|
|
256
|
-
return res;
|
|
257
|
-
}
|
|
258
|
-
const value = mapFn(res.value);
|
|
259
|
-
if (value !== void 0) {
|
|
260
|
-
return { value, done: false };
|
|
261
|
-
}
|
|
262
|
-
}
|
|
247
|
+
function* mapDefinedIterator(iter, mapFn) {
|
|
248
|
+
for (const x of iter) {
|
|
249
|
+
const value = mapFn(x);
|
|
250
|
+
if (value !== void 0) {
|
|
251
|
+
yield value;
|
|
263
252
|
}
|
|
264
|
-
}
|
|
253
|
+
}
|
|
265
254
|
}
|
|
266
255
|
function some(array, predicate) {
|
|
267
256
|
if (array) {
|
|
@@ -383,6 +372,15 @@ function stableSort(array, comparer) {
|
|
|
383
372
|
stableSortIndices(array, indices, comparer);
|
|
384
373
|
return indices.map((i) => array[i]);
|
|
385
374
|
}
|
|
375
|
+
var elementAt = !!Array.prototype.at ? (array, offset) => array == null ? void 0 : array.at(offset) : (array, offset) => {
|
|
376
|
+
if (array) {
|
|
377
|
+
offset = toOffset(array, offset);
|
|
378
|
+
if (offset < array.length) {
|
|
379
|
+
return array[offset];
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return void 0;
|
|
383
|
+
};
|
|
386
384
|
function firstOrUndefined(array) {
|
|
387
385
|
return array === void 0 || array.length === 0 ? void 0 : array[0];
|
|
388
386
|
}
|
|
@@ -459,21 +457,10 @@ function getOwnKeys(map2) {
|
|
|
459
457
|
}
|
|
460
458
|
return keys;
|
|
461
459
|
}
|
|
462
|
-
var _entries = Object.entries || ((obj) => {
|
|
463
|
-
const keys = getOwnKeys(obj);
|
|
464
|
-
const result = Array(keys.length);
|
|
465
|
-
for (let i = 0; i < keys.length; i++) {
|
|
466
|
-
result[i] = [keys[i], obj[keys[i]]];
|
|
467
|
-
}
|
|
468
|
-
return result;
|
|
469
|
-
});
|
|
470
|
-
function getEntries(obj) {
|
|
471
|
-
return obj ? _entries(obj) : [];
|
|
472
|
-
}
|
|
473
460
|
function arrayFrom(iterator, map2) {
|
|
474
461
|
const result = [];
|
|
475
|
-
for (
|
|
476
|
-
result.push(map2 ? map2(
|
|
462
|
+
for (const value of iterator) {
|
|
463
|
+
result.push(map2 ? map2(value) : value);
|
|
477
464
|
}
|
|
478
465
|
return result;
|
|
479
466
|
}
|
|
@@ -546,7 +533,7 @@ function createQueue(items) {
|
|
|
546
533
|
};
|
|
547
534
|
}
|
|
548
535
|
function isArray(value) {
|
|
549
|
-
return Array.isArray
|
|
536
|
+
return Array.isArray(value);
|
|
550
537
|
}
|
|
551
538
|
function toArray(value) {
|
|
552
539
|
return isArray(value) ? value : [value];
|
|
@@ -7322,8 +7309,8 @@ var textToKeywordObj = {
|
|
|
7322
7309
|
await: 133 /* AwaitKeyword */,
|
|
7323
7310
|
of: 162 /* OfKeyword */
|
|
7324
7311
|
};
|
|
7325
|
-
var textToKeyword = new Map(
|
|
7326
|
-
var textToToken = new Map(
|
|
7312
|
+
var textToKeyword = new Map(Object.entries(textToKeywordObj));
|
|
7313
|
+
var textToToken = new Map(Object.entries({
|
|
7327
7314
|
...textToKeywordObj,
|
|
7328
7315
|
"{": 18 /* OpenBraceToken */,
|
|
7329
7316
|
"}": 19 /* CloseBraceToken */,
|
|
@@ -11403,7 +11390,7 @@ function getBinaryOperatorPrecedence(kind) {
|
|
|
11403
11390
|
function hasInvalidEscape(template) {
|
|
11404
11391
|
return template && !!(isNoSubstitutionTemplateLiteral(template) ? template.templateFlags : template.head.templateFlags || some(template.templateSpans, (span) => !!span.literal.templateFlags));
|
|
11405
11392
|
}
|
|
11406
|
-
var escapedCharsMap = new Map(
|
|
11393
|
+
var escapedCharsMap = new Map(Object.entries({
|
|
11407
11394
|
" ": "\\t",
|
|
11408
11395
|
"\v": "\\v",
|
|
11409
11396
|
"\f": "\\f",
|
|
@@ -11423,7 +11410,7 @@ var escapedCharsMap = new Map(getEntries({
|
|
|
11423
11410
|
"\r\n": "\\r\\n"
|
|
11424
11411
|
// special case for CRLFs in backticks
|
|
11425
11412
|
}));
|
|
11426
|
-
var jsxEscapedCharsMap = new Map(
|
|
11413
|
+
var jsxEscapedCharsMap = new Map(Object.entries({
|
|
11427
11414
|
'"': """,
|
|
11428
11415
|
"'": "'"
|
|
11429
11416
|
}));
|
|
@@ -18983,7 +18970,6 @@ var Parser;
|
|
|
18983
18970
|
let currentToken;
|
|
18984
18971
|
let nodeCount;
|
|
18985
18972
|
let identifiers;
|
|
18986
|
-
let privateIdentifiers;
|
|
18987
18973
|
let identifierCount;
|
|
18988
18974
|
let parsingContext;
|
|
18989
18975
|
let notParenthesizedArrow;
|
|
@@ -19136,7 +19122,6 @@ var Parser;
|
|
|
19136
19122
|
parseDiagnostics = [];
|
|
19137
19123
|
parsingContext = 0;
|
|
19138
19124
|
identifiers = /* @__PURE__ */ new Map();
|
|
19139
|
-
privateIdentifiers = /* @__PURE__ */ new Map();
|
|
19140
19125
|
identifierCount = 0;
|
|
19141
19126
|
nodeCount = 0;
|
|
19142
19127
|
sourceFlags = 0;
|
|
@@ -19877,16 +19862,9 @@ var Parser;
|
|
|
19877
19862
|
parseExpected(23 /* CloseBracketToken */);
|
|
19878
19863
|
return finishNode(factory2.createComputedPropertyName(expression), pos);
|
|
19879
19864
|
}
|
|
19880
|
-
function internPrivateIdentifier(text) {
|
|
19881
|
-
let privateIdentifier = privateIdentifiers.get(text);
|
|
19882
|
-
if (privateIdentifier === void 0) {
|
|
19883
|
-
privateIdentifiers.set(text, privateIdentifier = text);
|
|
19884
|
-
}
|
|
19885
|
-
return privateIdentifier;
|
|
19886
|
-
}
|
|
19887
19865
|
function parsePrivateIdentifier() {
|
|
19888
19866
|
const pos = getNodePos();
|
|
19889
|
-
const node = factory2.createPrivateIdentifier(
|
|
19867
|
+
const node = factory2.createPrivateIdentifier(internIdentifier(scanner.getTokenValue()));
|
|
19890
19868
|
nextToken();
|
|
19891
19869
|
return finishNode(node, pos);
|
|
19892
19870
|
}
|
|
@@ -26049,14 +26027,14 @@ var compileOnSaveCommandLineOption = {
|
|
|
26049
26027
|
type: "boolean",
|
|
26050
26028
|
defaultValueDescription: false
|
|
26051
26029
|
};
|
|
26052
|
-
var jsxOptionMap = new Map(
|
|
26030
|
+
var jsxOptionMap = new Map(Object.entries({
|
|
26053
26031
|
"preserve": 1 /* Preserve */,
|
|
26054
26032
|
"react-native": 3 /* ReactNative */,
|
|
26055
26033
|
"react": 2 /* React */,
|
|
26056
26034
|
"react-jsx": 4 /* ReactJSX */,
|
|
26057
26035
|
"react-jsxdev": 5 /* ReactJSXDev */
|
|
26058
26036
|
}));
|
|
26059
|
-
var inverseJsxOptionMap = new Map(
|
|
26037
|
+
var inverseJsxOptionMap = new Map(mapIterator(jsxOptionMap.entries(), ([key, value]) => ["" + value, key]));
|
|
26060
26038
|
var libEntries = [
|
|
26061
26039
|
// JavaScript only
|
|
26062
26040
|
["es5", "lib.es5.d.ts"],
|
|
@@ -26137,7 +26115,7 @@ var libMap = new Map(libEntries);
|
|
|
26137
26115
|
var optionsForWatch = [
|
|
26138
26116
|
{
|
|
26139
26117
|
name: "watchFile",
|
|
26140
|
-
type: new Map(
|
|
26118
|
+
type: new Map(Object.entries({
|
|
26141
26119
|
fixedpollinginterval: 0 /* FixedPollingInterval */,
|
|
26142
26120
|
prioritypollinginterval: 1 /* PriorityPollingInterval */,
|
|
26143
26121
|
dynamicprioritypolling: 2 /* DynamicPriorityPolling */,
|
|
@@ -26151,7 +26129,7 @@ var optionsForWatch = [
|
|
|
26151
26129
|
},
|
|
26152
26130
|
{
|
|
26153
26131
|
name: "watchDirectory",
|
|
26154
|
-
type: new Map(
|
|
26132
|
+
type: new Map(Object.entries({
|
|
26155
26133
|
usefsevents: 0 /* UseFsEvents */,
|
|
26156
26134
|
fixedpollinginterval: 1 /* FixedPollingInterval */,
|
|
26157
26135
|
dynamicprioritypolling: 2 /* DynamicPriorityPolling */,
|
|
@@ -26163,7 +26141,7 @@ var optionsForWatch = [
|
|
|
26163
26141
|
},
|
|
26164
26142
|
{
|
|
26165
26143
|
name: "fallbackPolling",
|
|
26166
|
-
type: new Map(
|
|
26144
|
+
type: new Map(Object.entries({
|
|
26167
26145
|
fixedinterval: 0 /* FixedInterval */,
|
|
26168
26146
|
priorityinterval: 1 /* PriorityInterval */,
|
|
26169
26147
|
dynamicpriority: 2 /* DynamicPriority */,
|
|
@@ -26394,7 +26372,7 @@ var commonOptionsWithBuild = [
|
|
|
26394
26372
|
var targetOptionDeclaration = {
|
|
26395
26373
|
name: "target",
|
|
26396
26374
|
shortName: "t",
|
|
26397
|
-
type: new Map(
|
|
26375
|
+
type: new Map(Object.entries({
|
|
26398
26376
|
es3: 0 /* ES3 */,
|
|
26399
26377
|
es5: 1 /* ES5 */,
|
|
26400
26378
|
es6: 2 /* ES2015 */,
|
|
@@ -26421,7 +26399,7 @@ var targetOptionDeclaration = {
|
|
|
26421
26399
|
var moduleOptionDeclaration = {
|
|
26422
26400
|
name: "module",
|
|
26423
26401
|
shortName: "m",
|
|
26424
|
-
type: new Map(
|
|
26402
|
+
type: new Map(Object.entries({
|
|
26425
26403
|
none: 0 /* None */,
|
|
26426
26404
|
commonjs: 1 /* CommonJS */,
|
|
26427
26405
|
amd: 2 /* AMD */,
|
|
@@ -26644,7 +26622,7 @@ var commandOptionsWithoutBuild = [
|
|
|
26644
26622
|
},
|
|
26645
26623
|
{
|
|
26646
26624
|
name: "importsNotUsedAsValues",
|
|
26647
|
-
type: new Map(
|
|
26625
|
+
type: new Map(Object.entries({
|
|
26648
26626
|
remove: 0 /* Remove */,
|
|
26649
26627
|
preserve: 1 /* Preserve */,
|
|
26650
26628
|
error: 2 /* Error */
|
|
@@ -26846,7 +26824,7 @@ var commandOptionsWithoutBuild = [
|
|
|
26846
26824
|
// Module Resolution
|
|
26847
26825
|
{
|
|
26848
26826
|
name: "moduleResolution",
|
|
26849
|
-
type: new Map(
|
|
26827
|
+
type: new Map(Object.entries({
|
|
26850
26828
|
// N.B. The first entry specifies the value shown in `tsc --init`
|
|
26851
26829
|
node10: 2 /* Node10 */,
|
|
26852
26830
|
node: 2 /* Node10 */,
|
|
@@ -27138,7 +27116,7 @@ var commandOptionsWithoutBuild = [
|
|
|
27138
27116
|
},
|
|
27139
27117
|
{
|
|
27140
27118
|
name: "newLine",
|
|
27141
|
-
type: new Map(
|
|
27119
|
+
type: new Map(Object.entries({
|
|
27142
27120
|
crlf: 0 /* CarriageReturnLineFeed */,
|
|
27143
27121
|
lf: 1 /* LineFeed */
|
|
27144
27122
|
})),
|
|
@@ -27382,7 +27360,7 @@ var commandOptionsWithoutBuild = [
|
|
|
27382
27360
|
},
|
|
27383
27361
|
{
|
|
27384
27362
|
name: "moduleDetection",
|
|
27385
|
-
type: new Map(
|
|
27363
|
+
type: new Map(Object.entries({
|
|
27386
27364
|
auto: 2 /* Auto */,
|
|
27387
27365
|
legacy: 1 /* Legacy */,
|
|
27388
27366
|
force: 3 /* Force */
|
|
@@ -32584,7 +32562,7 @@ var TypeFacts = /* @__PURE__ */ ((TypeFacts3) => {
|
|
|
32584
32562
|
TypeFacts3[TypeFacts3["AndFactsMask"] = 134209471] = "AndFactsMask";
|
|
32585
32563
|
return TypeFacts3;
|
|
32586
32564
|
})(TypeFacts || {});
|
|
32587
|
-
var typeofNEFacts = new Map(
|
|
32565
|
+
var typeofNEFacts = new Map(Object.entries({
|
|
32588
32566
|
string: 256 /* TypeofNEString */,
|
|
32589
32567
|
number: 512 /* TypeofNENumber */,
|
|
32590
32568
|
bigint: 1024 /* TypeofNEBigInt */,
|
|
@@ -32615,7 +32593,7 @@ var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
|
|
|
32615
32593
|
return SignatureCheckMode3;
|
|
32616
32594
|
})(SignatureCheckMode || {});
|
|
32617
32595
|
var isNotOverloadAndNotAccessor = and(isNotOverload, isNotAccessor);
|
|
32618
|
-
var intrinsicTypeKinds = new Map(
|
|
32596
|
+
var intrinsicTypeKinds = new Map(Object.entries({
|
|
32619
32597
|
Uppercase: 0 /* Uppercase */,
|
|
32620
32598
|
Lowercase: 1 /* Lowercase */,
|
|
32621
32599
|
Capitalize: 2 /* Capitalize */,
|
|
@@ -33916,7 +33894,7 @@ function extractSingleNode(nodes) {
|
|
|
33916
33894
|
}
|
|
33917
33895
|
|
|
33918
33896
|
// src/compiler/transformers/jsx.ts
|
|
33919
|
-
var entities = new Map(
|
|
33897
|
+
var entities = new Map(Object.entries({
|
|
33920
33898
|
quot: 34,
|
|
33921
33899
|
amp: 38,
|
|
33922
33900
|
apos: 39,
|
|
@@ -34749,9 +34727,8 @@ var BuilderState;
|
|
|
34749
34727
|
seenMap.add(path2);
|
|
34750
34728
|
const references = state.referencedMap.getValues(path2);
|
|
34751
34729
|
if (references) {
|
|
34752
|
-
const
|
|
34753
|
-
|
|
34754
|
-
queue.push(iterResult.value);
|
|
34730
|
+
for (const key of references.keys()) {
|
|
34731
|
+
queue.push(key);
|
|
34755
34732
|
}
|
|
34756
34733
|
}
|
|
34757
34734
|
}
|
|
@@ -34966,12 +34943,13 @@ function nonRelativeModuleNameForTypingCache(moduleName) {
|
|
|
34966
34943
|
}
|
|
34967
34944
|
function loadSafeList(host, safeListPath) {
|
|
34968
34945
|
const result = readConfigFile(safeListPath, (path2) => host.readFile(path2));
|
|
34969
|
-
return new Map(
|
|
34946
|
+
return new Map(Object.entries(result.config));
|
|
34970
34947
|
}
|
|
34971
34948
|
function loadTypesMap(host, typesMapPath) {
|
|
34949
|
+
var _a2;
|
|
34972
34950
|
const result = readConfigFile(typesMapPath, (path2) => host.readFile(path2));
|
|
34973
|
-
if (result.config) {
|
|
34974
|
-
return new Map(
|
|
34951
|
+
if ((_a2 = result.config) == null ? void 0 : _a2.simpleMap) {
|
|
34952
|
+
return new Map(Object.entries(result.config.simpleMap));
|
|
34975
34953
|
}
|
|
34976
34954
|
return void 0;
|
|
34977
34955
|
}
|
|
@@ -35700,7 +35678,7 @@ function loadTypesRegistryFile(typesRegistryFilePath, host, log2) {
|
|
|
35700
35678
|
}
|
|
35701
35679
|
try {
|
|
35702
35680
|
const content = JSON.parse(host.readFile(typesRegistryFilePath));
|
|
35703
|
-
return new Map(
|
|
35681
|
+
return new Map(Object.entries(content.entries));
|
|
35704
35682
|
} catch (e) {
|
|
35705
35683
|
if (log2.isEnabled()) {
|
|
35706
35684
|
log2.writeLine(`Error when loading types registry file '${typesRegistryFilePath}': ${e.message}, ${e.stack}`);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.0.0-dev.
|
|
5
|
+
"version": "5.0.0-dev.20230108",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|