@typescript-deploys/pr-build 4.6.0-pr-47607-13 → 4.6.0-pr-47607-31

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 CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.6";
72
- ts.version = ts.versionMajorMinor + ".0-insiders.20220127";
72
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220207";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -1087,11 +1087,11 @@ var ts;
1087
1087
  return result;
1088
1088
  }
1089
1089
  ts.getAllKeys = getAllKeys;
1090
- function getOwnValues(sparseArray) {
1090
+ function getOwnValues(collection) {
1091
1091
  var values = [];
1092
- for (var key in sparseArray) {
1093
- if (hasOwnProperty.call(sparseArray, key)) {
1094
- values.push(sparseArray[key]);
1092
+ for (var key in collection) {
1093
+ if (hasOwnProperty.call(collection, key)) {
1094
+ values.push(collection[key]);
1095
1095
  }
1096
1096
  }
1097
1097
  return values;
@@ -3343,491 +3343,6 @@ var ts;
3343
3343
  };
3344
3344
  })(ts || (ts = {}));
3345
3345
  var ts;
3346
- (function (ts) {
3347
- ts.directorySeparator = "/";
3348
- ts.altDirectorySeparator = "\\";
3349
- var urlSchemeSeparator = "://";
3350
- var backslashRegExp = /\\/g;
3351
- function isAnyDirectorySeparator(charCode) {
3352
- return charCode === 47 || charCode === 92;
3353
- }
3354
- ts.isAnyDirectorySeparator = isAnyDirectorySeparator;
3355
- function isUrl(path) {
3356
- return getEncodedRootLength(path) < 0;
3357
- }
3358
- ts.isUrl = isUrl;
3359
- function isRootedDiskPath(path) {
3360
- return getEncodedRootLength(path) > 0;
3361
- }
3362
- ts.isRootedDiskPath = isRootedDiskPath;
3363
- function isDiskPathRoot(path) {
3364
- var rootLength = getEncodedRootLength(path);
3365
- return rootLength > 0 && rootLength === path.length;
3366
- }
3367
- ts.isDiskPathRoot = isDiskPathRoot;
3368
- function pathIsAbsolute(path) {
3369
- return getEncodedRootLength(path) !== 0;
3370
- }
3371
- ts.pathIsAbsolute = pathIsAbsolute;
3372
- function pathIsRelative(path) {
3373
- return /^\.\.?($|[\\/])/.test(path);
3374
- }
3375
- ts.pathIsRelative = pathIsRelative;
3376
- function pathIsBareSpecifier(path) {
3377
- return !pathIsAbsolute(path) && !pathIsRelative(path);
3378
- }
3379
- ts.pathIsBareSpecifier = pathIsBareSpecifier;
3380
- function hasExtension(fileName) {
3381
- return ts.stringContains(getBaseFileName(fileName), ".");
3382
- }
3383
- ts.hasExtension = hasExtension;
3384
- function fileExtensionIs(path, extension) {
3385
- return path.length > extension.length && ts.endsWith(path, extension);
3386
- }
3387
- ts.fileExtensionIs = fileExtensionIs;
3388
- function fileExtensionIsOneOf(path, extensions) {
3389
- for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) {
3390
- var extension = extensions_1[_i];
3391
- if (fileExtensionIs(path, extension)) {
3392
- return true;
3393
- }
3394
- }
3395
- return false;
3396
- }
3397
- ts.fileExtensionIsOneOf = fileExtensionIsOneOf;
3398
- function hasTrailingDirectorySeparator(path) {
3399
- return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1));
3400
- }
3401
- ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator;
3402
- function isVolumeCharacter(charCode) {
3403
- return (charCode >= 97 && charCode <= 122) ||
3404
- (charCode >= 65 && charCode <= 90);
3405
- }
3406
- function getFileUrlVolumeSeparatorEnd(url, start) {
3407
- var ch0 = url.charCodeAt(start);
3408
- if (ch0 === 58)
3409
- return start + 1;
3410
- if (ch0 === 37 && url.charCodeAt(start + 1) === 51) {
3411
- var ch2 = url.charCodeAt(start + 2);
3412
- if (ch2 === 97 || ch2 === 65)
3413
- return start + 3;
3414
- }
3415
- return -1;
3416
- }
3417
- function getEncodedRootLength(path) {
3418
- if (!path)
3419
- return 0;
3420
- var ch0 = path.charCodeAt(0);
3421
- if (ch0 === 47 || ch0 === 92) {
3422
- if (path.charCodeAt(1) !== ch0)
3423
- return 1;
3424
- var p1 = path.indexOf(ch0 === 47 ? ts.directorySeparator : ts.altDirectorySeparator, 2);
3425
- if (p1 < 0)
3426
- return path.length;
3427
- return p1 + 1;
3428
- }
3429
- if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58) {
3430
- var ch2 = path.charCodeAt(2);
3431
- if (ch2 === 47 || ch2 === 92)
3432
- return 3;
3433
- if (path.length === 2)
3434
- return 2;
3435
- }
3436
- var schemeEnd = path.indexOf(urlSchemeSeparator);
3437
- if (schemeEnd !== -1) {
3438
- var authorityStart = schemeEnd + urlSchemeSeparator.length;
3439
- var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart);
3440
- if (authorityEnd !== -1) {
3441
- var scheme = path.slice(0, schemeEnd);
3442
- var authority = path.slice(authorityStart, authorityEnd);
3443
- if (scheme === "file" && (authority === "" || authority === "localhost") &&
3444
- isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {
3445
- var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);
3446
- if (volumeSeparatorEnd !== -1) {
3447
- if (path.charCodeAt(volumeSeparatorEnd) === 47) {
3448
- return ~(volumeSeparatorEnd + 1);
3449
- }
3450
- if (volumeSeparatorEnd === path.length) {
3451
- return ~volumeSeparatorEnd;
3452
- }
3453
- }
3454
- }
3455
- return ~(authorityEnd + 1);
3456
- }
3457
- return ~path.length;
3458
- }
3459
- return 0;
3460
- }
3461
- function getRootLength(path) {
3462
- var rootLength = getEncodedRootLength(path);
3463
- return rootLength < 0 ? ~rootLength : rootLength;
3464
- }
3465
- ts.getRootLength = getRootLength;
3466
- function getDirectoryPath(path) {
3467
- path = normalizeSlashes(path);
3468
- var rootLength = getRootLength(path);
3469
- if (rootLength === path.length)
3470
- return path;
3471
- path = removeTrailingDirectorySeparator(path);
3472
- return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator)));
3473
- }
3474
- ts.getDirectoryPath = getDirectoryPath;
3475
- function getBaseFileName(path, extensions, ignoreCase) {
3476
- path = normalizeSlashes(path);
3477
- var rootLength = getRootLength(path);
3478
- if (rootLength === path.length)
3479
- return "";
3480
- path = removeTrailingDirectorySeparator(path);
3481
- var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1));
3482
- var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined;
3483
- return extension ? name.slice(0, name.length - extension.length) : name;
3484
- }
3485
- ts.getBaseFileName = getBaseFileName;
3486
- function tryGetExtensionFromPath(path, extension, stringEqualityComparer) {
3487
- if (!ts.startsWith(extension, "."))
3488
- extension = "." + extension;
3489
- if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46) {
3490
- var pathExtension = path.slice(path.length - extension.length);
3491
- if (stringEqualityComparer(pathExtension, extension)) {
3492
- return pathExtension;
3493
- }
3494
- }
3495
- }
3496
- function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) {
3497
- if (typeof extensions === "string") {
3498
- return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || "";
3499
- }
3500
- for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) {
3501
- var extension = extensions_2[_i];
3502
- var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer);
3503
- if (result)
3504
- return result;
3505
- }
3506
- return "";
3507
- }
3508
- function getAnyExtensionFromPath(path, extensions, ignoreCase) {
3509
- if (extensions) {
3510
- return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive);
3511
- }
3512
- var baseFileName = getBaseFileName(path);
3513
- var extensionIndex = baseFileName.lastIndexOf(".");
3514
- if (extensionIndex >= 0) {
3515
- return baseFileName.substring(extensionIndex);
3516
- }
3517
- return "";
3518
- }
3519
- ts.getAnyExtensionFromPath = getAnyExtensionFromPath;
3520
- function pathComponents(path, rootLength) {
3521
- var root = path.substring(0, rootLength);
3522
- var rest = path.substring(rootLength).split(ts.directorySeparator);
3523
- if (rest.length && !ts.lastOrUndefined(rest))
3524
- rest.pop();
3525
- return __spreadArray([root], rest, true);
3526
- }
3527
- function getPathComponents(path, currentDirectory) {
3528
- if (currentDirectory === void 0) { currentDirectory = ""; }
3529
- path = combinePaths(currentDirectory, path);
3530
- return pathComponents(path, getRootLength(path));
3531
- }
3532
- ts.getPathComponents = getPathComponents;
3533
- function getPathFromPathComponents(pathComponents) {
3534
- if (pathComponents.length === 0)
3535
- return "";
3536
- var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]);
3537
- return root + pathComponents.slice(1).join(ts.directorySeparator);
3538
- }
3539
- ts.getPathFromPathComponents = getPathFromPathComponents;
3540
- function normalizeSlashes(path) {
3541
- var index = path.indexOf("\\");
3542
- if (index === -1) {
3543
- return path;
3544
- }
3545
- backslashRegExp.lastIndex = index;
3546
- return path.replace(backslashRegExp, ts.directorySeparator);
3547
- }
3548
- ts.normalizeSlashes = normalizeSlashes;
3549
- function reducePathComponents(components) {
3550
- if (!ts.some(components))
3551
- return [];
3552
- var reduced = [components[0]];
3553
- for (var i = 1; i < components.length; i++) {
3554
- var component = components[i];
3555
- if (!component)
3556
- continue;
3557
- if (component === ".")
3558
- continue;
3559
- if (component === "..") {
3560
- if (reduced.length > 1) {
3561
- if (reduced[reduced.length - 1] !== "..") {
3562
- reduced.pop();
3563
- continue;
3564
- }
3565
- }
3566
- else if (reduced[0])
3567
- continue;
3568
- }
3569
- reduced.push(component);
3570
- }
3571
- return reduced;
3572
- }
3573
- ts.reducePathComponents = reducePathComponents;
3574
- function combinePaths(path) {
3575
- var paths = [];
3576
- for (var _i = 1; _i < arguments.length; _i++) {
3577
- paths[_i - 1] = arguments[_i];
3578
- }
3579
- if (path)
3580
- path = normalizeSlashes(path);
3581
- for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) {
3582
- var relativePath = paths_1[_a];
3583
- if (!relativePath)
3584
- continue;
3585
- relativePath = normalizeSlashes(relativePath);
3586
- if (!path || getRootLength(relativePath) !== 0) {
3587
- path = relativePath;
3588
- }
3589
- else {
3590
- path = ensureTrailingDirectorySeparator(path) + relativePath;
3591
- }
3592
- }
3593
- return path;
3594
- }
3595
- ts.combinePaths = combinePaths;
3596
- function resolvePath(path) {
3597
- var paths = [];
3598
- for (var _i = 1; _i < arguments.length; _i++) {
3599
- paths[_i - 1] = arguments[_i];
3600
- }
3601
- return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArray([path], paths, false)) : normalizeSlashes(path));
3602
- }
3603
- ts.resolvePath = resolvePath;
3604
- function getNormalizedPathComponents(path, currentDirectory) {
3605
- return reducePathComponents(getPathComponents(path, currentDirectory));
3606
- }
3607
- ts.getNormalizedPathComponents = getNormalizedPathComponents;
3608
- function getNormalizedAbsolutePath(fileName, currentDirectory) {
3609
- return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory));
3610
- }
3611
- ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath;
3612
- function normalizePath(path) {
3613
- path = normalizeSlashes(path);
3614
- if (!relativePathSegmentRegExp.test(path)) {
3615
- return path;
3616
- }
3617
- var simplified = path.replace(/\/\.\//g, "/").replace(/^\.\//, "");
3618
- if (simplified !== path) {
3619
- path = simplified;
3620
- if (!relativePathSegmentRegExp.test(path)) {
3621
- return path;
3622
- }
3623
- }
3624
- var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path)));
3625
- return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
3626
- }
3627
- ts.normalizePath = normalizePath;
3628
- function getPathWithoutRoot(pathComponents) {
3629
- if (pathComponents.length === 0)
3630
- return "";
3631
- return pathComponents.slice(1).join(ts.directorySeparator);
3632
- }
3633
- function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) {
3634
- return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory));
3635
- }
3636
- ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot;
3637
- function toPath(fileName, basePath, getCanonicalFileName) {
3638
- var nonCanonicalizedPath = isRootedDiskPath(fileName)
3639
- ? normalizePath(fileName)
3640
- : getNormalizedAbsolutePath(fileName, basePath);
3641
- return getCanonicalFileName(nonCanonicalizedPath);
3642
- }
3643
- ts.toPath = toPath;
3644
- function normalizePathAndParts(path) {
3645
- path = normalizeSlashes(path);
3646
- var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1);
3647
- if (parts.length) {
3648
- var joinedParts = root + parts.join(ts.directorySeparator);
3649
- return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts };
3650
- }
3651
- else {
3652
- return { path: root, parts: parts };
3653
- }
3654
- }
3655
- ts.normalizePathAndParts = normalizePathAndParts;
3656
- function removeTrailingDirectorySeparator(path) {
3657
- if (hasTrailingDirectorySeparator(path)) {
3658
- return path.substr(0, path.length - 1);
3659
- }
3660
- return path;
3661
- }
3662
- ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator;
3663
- function ensureTrailingDirectorySeparator(path) {
3664
- if (!hasTrailingDirectorySeparator(path)) {
3665
- return path + ts.directorySeparator;
3666
- }
3667
- return path;
3668
- }
3669
- ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator;
3670
- function ensurePathIsNonModuleName(path) {
3671
- return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path;
3672
- }
3673
- ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName;
3674
- function changeAnyExtension(path, ext, extensions, ignoreCase) {
3675
- var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path);
3676
- return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path;
3677
- }
3678
- ts.changeAnyExtension = changeAnyExtension;
3679
- var relativePathSegmentRegExp = /(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/;
3680
- function comparePathsWorker(a, b, componentComparer) {
3681
- if (a === b)
3682
- return 0;
3683
- if (a === undefined)
3684
- return -1;
3685
- if (b === undefined)
3686
- return 1;
3687
- var aRoot = a.substring(0, getRootLength(a));
3688
- var bRoot = b.substring(0, getRootLength(b));
3689
- var result = ts.compareStringsCaseInsensitive(aRoot, bRoot);
3690
- if (result !== 0) {
3691
- return result;
3692
- }
3693
- var aRest = a.substring(aRoot.length);
3694
- var bRest = b.substring(bRoot.length);
3695
- if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) {
3696
- return componentComparer(aRest, bRest);
3697
- }
3698
- var aComponents = reducePathComponents(getPathComponents(a));
3699
- var bComponents = reducePathComponents(getPathComponents(b));
3700
- var sharedLength = Math.min(aComponents.length, bComponents.length);
3701
- for (var i = 1; i < sharedLength; i++) {
3702
- var result_2 = componentComparer(aComponents[i], bComponents[i]);
3703
- if (result_2 !== 0) {
3704
- return result_2;
3705
- }
3706
- }
3707
- return ts.compareValues(aComponents.length, bComponents.length);
3708
- }
3709
- function comparePathsCaseSensitive(a, b) {
3710
- return comparePathsWorker(a, b, ts.compareStringsCaseSensitive);
3711
- }
3712
- ts.comparePathsCaseSensitive = comparePathsCaseSensitive;
3713
- function comparePathsCaseInsensitive(a, b) {
3714
- return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive);
3715
- }
3716
- ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive;
3717
- function comparePaths(a, b, currentDirectory, ignoreCase) {
3718
- if (typeof currentDirectory === "string") {
3719
- a = combinePaths(currentDirectory, a);
3720
- b = combinePaths(currentDirectory, b);
3721
- }
3722
- else if (typeof currentDirectory === "boolean") {
3723
- ignoreCase = currentDirectory;
3724
- }
3725
- return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase));
3726
- }
3727
- ts.comparePaths = comparePaths;
3728
- function containsPath(parent, child, currentDirectory, ignoreCase) {
3729
- if (typeof currentDirectory === "string") {
3730
- parent = combinePaths(currentDirectory, parent);
3731
- child = combinePaths(currentDirectory, child);
3732
- }
3733
- else if (typeof currentDirectory === "boolean") {
3734
- ignoreCase = currentDirectory;
3735
- }
3736
- if (parent === undefined || child === undefined)
3737
- return false;
3738
- if (parent === child)
3739
- return true;
3740
- var parentComponents = reducePathComponents(getPathComponents(parent));
3741
- var childComponents = reducePathComponents(getPathComponents(child));
3742
- if (childComponents.length < parentComponents.length) {
3743
- return false;
3744
- }
3745
- var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive;
3746
- for (var i = 0; i < parentComponents.length; i++) {
3747
- var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer;
3748
- if (!equalityComparer(parentComponents[i], childComponents[i])) {
3749
- return false;
3750
- }
3751
- }
3752
- return true;
3753
- }
3754
- ts.containsPath = containsPath;
3755
- function startsWithDirectory(fileName, directoryName, getCanonicalFileName) {
3756
- var canonicalFileName = getCanonicalFileName(fileName);
3757
- var canonicalDirectoryName = getCanonicalFileName(directoryName);
3758
- return ts.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts.startsWith(canonicalFileName, canonicalDirectoryName + "\\");
3759
- }
3760
- ts.startsWithDirectory = startsWithDirectory;
3761
- function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) {
3762
- var fromComponents = reducePathComponents(getPathComponents(from));
3763
- var toComponents = reducePathComponents(getPathComponents(to));
3764
- var start;
3765
- for (start = 0; start < fromComponents.length && start < toComponents.length; start++) {
3766
- var fromComponent = getCanonicalFileName(fromComponents[start]);
3767
- var toComponent = getCanonicalFileName(toComponents[start]);
3768
- var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer;
3769
- if (!comparer(fromComponent, toComponent))
3770
- break;
3771
- }
3772
- if (start === 0) {
3773
- return toComponents;
3774
- }
3775
- var components = toComponents.slice(start);
3776
- var relative = [];
3777
- for (; start < fromComponents.length; start++) {
3778
- relative.push("..");
3779
- }
3780
- return __spreadArray(__spreadArray([""], relative, true), components, true);
3781
- }
3782
- ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo;
3783
- function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
3784
- ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative");
3785
- var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity;
3786
- var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false;
3787
- var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName);
3788
- return getPathFromPathComponents(pathComponents);
3789
- }
3790
- ts.getRelativePathFromDirectory = getRelativePathFromDirectory;
3791
- function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) {
3792
- return !isRootedDiskPath(absoluteOrRelativePath)
3793
- ? absoluteOrRelativePath
3794
- : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, false);
3795
- }
3796
- ts.convertToRelativePath = convertToRelativePath;
3797
- function getRelativePathFromFile(from, to, getCanonicalFileName) {
3798
- return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName));
3799
- }
3800
- ts.getRelativePathFromFile = getRelativePathFromFile;
3801
- function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) {
3802
- var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName);
3803
- var firstComponent = pathComponents[0];
3804
- if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) {
3805
- var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///";
3806
- pathComponents[0] = prefix + firstComponent;
3807
- }
3808
- return getPathFromPathComponents(pathComponents);
3809
- }
3810
- ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl;
3811
- function forEachAncestorDirectory(directory, callback) {
3812
- while (true) {
3813
- var result = callback(directory);
3814
- if (result !== undefined) {
3815
- return result;
3816
- }
3817
- var parentPath = getDirectoryPath(directory);
3818
- if (parentPath === directory) {
3819
- return undefined;
3820
- }
3821
- directory = parentPath;
3822
- }
3823
- }
3824
- ts.forEachAncestorDirectory = forEachAncestorDirectory;
3825
- function isNodeModulesDirectory(dirPath) {
3826
- return ts.endsWith(dirPath, "/node_modules");
3827
- }
3828
- ts.isNodeModulesDirectory = isNodeModulesDirectory;
3829
- })(ts || (ts = {}));
3830
- var ts;
3831
3346
  (function (ts) {
3832
3347
  function generateDjb2Hash(data) {
3833
3348
  var acc = 5381;
@@ -5072,6 +4587,491 @@ var ts;
5072
4587
  }
5073
4588
  })(ts || (ts = {}));
5074
4589
  var ts;
4590
+ (function (ts) {
4591
+ ts.directorySeparator = "/";
4592
+ ts.altDirectorySeparator = "\\";
4593
+ var urlSchemeSeparator = "://";
4594
+ var backslashRegExp = /\\/g;
4595
+ function isAnyDirectorySeparator(charCode) {
4596
+ return charCode === 47 || charCode === 92;
4597
+ }
4598
+ ts.isAnyDirectorySeparator = isAnyDirectorySeparator;
4599
+ function isUrl(path) {
4600
+ return getEncodedRootLength(path) < 0;
4601
+ }
4602
+ ts.isUrl = isUrl;
4603
+ function isRootedDiskPath(path) {
4604
+ return getEncodedRootLength(path) > 0;
4605
+ }
4606
+ ts.isRootedDiskPath = isRootedDiskPath;
4607
+ function isDiskPathRoot(path) {
4608
+ var rootLength = getEncodedRootLength(path);
4609
+ return rootLength > 0 && rootLength === path.length;
4610
+ }
4611
+ ts.isDiskPathRoot = isDiskPathRoot;
4612
+ function pathIsAbsolute(path) {
4613
+ return getEncodedRootLength(path) !== 0;
4614
+ }
4615
+ ts.pathIsAbsolute = pathIsAbsolute;
4616
+ function pathIsRelative(path) {
4617
+ return /^\.\.?($|[\\/])/.test(path);
4618
+ }
4619
+ ts.pathIsRelative = pathIsRelative;
4620
+ function pathIsBareSpecifier(path) {
4621
+ return !pathIsAbsolute(path) && !pathIsRelative(path);
4622
+ }
4623
+ ts.pathIsBareSpecifier = pathIsBareSpecifier;
4624
+ function hasExtension(fileName) {
4625
+ return ts.stringContains(getBaseFileName(fileName), ".");
4626
+ }
4627
+ ts.hasExtension = hasExtension;
4628
+ function fileExtensionIs(path, extension) {
4629
+ return path.length > extension.length && ts.endsWith(path, extension);
4630
+ }
4631
+ ts.fileExtensionIs = fileExtensionIs;
4632
+ function fileExtensionIsOneOf(path, extensions) {
4633
+ for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) {
4634
+ var extension = extensions_1[_i];
4635
+ if (fileExtensionIs(path, extension)) {
4636
+ return true;
4637
+ }
4638
+ }
4639
+ return false;
4640
+ }
4641
+ ts.fileExtensionIsOneOf = fileExtensionIsOneOf;
4642
+ function hasTrailingDirectorySeparator(path) {
4643
+ return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1));
4644
+ }
4645
+ ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator;
4646
+ function isVolumeCharacter(charCode) {
4647
+ return (charCode >= 97 && charCode <= 122) ||
4648
+ (charCode >= 65 && charCode <= 90);
4649
+ }
4650
+ function getFileUrlVolumeSeparatorEnd(url, start) {
4651
+ var ch0 = url.charCodeAt(start);
4652
+ if (ch0 === 58)
4653
+ return start + 1;
4654
+ if (ch0 === 37 && url.charCodeAt(start + 1) === 51) {
4655
+ var ch2 = url.charCodeAt(start + 2);
4656
+ if (ch2 === 97 || ch2 === 65)
4657
+ return start + 3;
4658
+ }
4659
+ return -1;
4660
+ }
4661
+ function getEncodedRootLength(path) {
4662
+ if (!path)
4663
+ return 0;
4664
+ var ch0 = path.charCodeAt(0);
4665
+ if (ch0 === 47 || ch0 === 92) {
4666
+ if (path.charCodeAt(1) !== ch0)
4667
+ return 1;
4668
+ var p1 = path.indexOf(ch0 === 47 ? ts.directorySeparator : ts.altDirectorySeparator, 2);
4669
+ if (p1 < 0)
4670
+ return path.length;
4671
+ return p1 + 1;
4672
+ }
4673
+ if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58) {
4674
+ var ch2 = path.charCodeAt(2);
4675
+ if (ch2 === 47 || ch2 === 92)
4676
+ return 3;
4677
+ if (path.length === 2)
4678
+ return 2;
4679
+ }
4680
+ var schemeEnd = path.indexOf(urlSchemeSeparator);
4681
+ if (schemeEnd !== -1) {
4682
+ var authorityStart = schemeEnd + urlSchemeSeparator.length;
4683
+ var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart);
4684
+ if (authorityEnd !== -1) {
4685
+ var scheme = path.slice(0, schemeEnd);
4686
+ var authority = path.slice(authorityStart, authorityEnd);
4687
+ if (scheme === "file" && (authority === "" || authority === "localhost") &&
4688
+ isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {
4689
+ var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);
4690
+ if (volumeSeparatorEnd !== -1) {
4691
+ if (path.charCodeAt(volumeSeparatorEnd) === 47) {
4692
+ return ~(volumeSeparatorEnd + 1);
4693
+ }
4694
+ if (volumeSeparatorEnd === path.length) {
4695
+ return ~volumeSeparatorEnd;
4696
+ }
4697
+ }
4698
+ }
4699
+ return ~(authorityEnd + 1);
4700
+ }
4701
+ return ~path.length;
4702
+ }
4703
+ return 0;
4704
+ }
4705
+ function getRootLength(path) {
4706
+ var rootLength = getEncodedRootLength(path);
4707
+ return rootLength < 0 ? ~rootLength : rootLength;
4708
+ }
4709
+ ts.getRootLength = getRootLength;
4710
+ function getDirectoryPath(path) {
4711
+ path = normalizeSlashes(path);
4712
+ var rootLength = getRootLength(path);
4713
+ if (rootLength === path.length)
4714
+ return path;
4715
+ path = removeTrailingDirectorySeparator(path);
4716
+ return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator)));
4717
+ }
4718
+ ts.getDirectoryPath = getDirectoryPath;
4719
+ function getBaseFileName(path, extensions, ignoreCase) {
4720
+ path = normalizeSlashes(path);
4721
+ var rootLength = getRootLength(path);
4722
+ if (rootLength === path.length)
4723
+ return "";
4724
+ path = removeTrailingDirectorySeparator(path);
4725
+ var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1));
4726
+ var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined;
4727
+ return extension ? name.slice(0, name.length - extension.length) : name;
4728
+ }
4729
+ ts.getBaseFileName = getBaseFileName;
4730
+ function tryGetExtensionFromPath(path, extension, stringEqualityComparer) {
4731
+ if (!ts.startsWith(extension, "."))
4732
+ extension = "." + extension;
4733
+ if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46) {
4734
+ var pathExtension = path.slice(path.length - extension.length);
4735
+ if (stringEqualityComparer(pathExtension, extension)) {
4736
+ return pathExtension;
4737
+ }
4738
+ }
4739
+ }
4740
+ function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) {
4741
+ if (typeof extensions === "string") {
4742
+ return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || "";
4743
+ }
4744
+ for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) {
4745
+ var extension = extensions_2[_i];
4746
+ var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer);
4747
+ if (result)
4748
+ return result;
4749
+ }
4750
+ return "";
4751
+ }
4752
+ function getAnyExtensionFromPath(path, extensions, ignoreCase) {
4753
+ if (extensions) {
4754
+ return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive);
4755
+ }
4756
+ var baseFileName = getBaseFileName(path);
4757
+ var extensionIndex = baseFileName.lastIndexOf(".");
4758
+ if (extensionIndex >= 0) {
4759
+ return baseFileName.substring(extensionIndex);
4760
+ }
4761
+ return "";
4762
+ }
4763
+ ts.getAnyExtensionFromPath = getAnyExtensionFromPath;
4764
+ function pathComponents(path, rootLength) {
4765
+ var root = path.substring(0, rootLength);
4766
+ var rest = path.substring(rootLength).split(ts.directorySeparator);
4767
+ if (rest.length && !ts.lastOrUndefined(rest))
4768
+ rest.pop();
4769
+ return __spreadArray([root], rest, true);
4770
+ }
4771
+ function getPathComponents(path, currentDirectory) {
4772
+ if (currentDirectory === void 0) { currentDirectory = ""; }
4773
+ path = combinePaths(currentDirectory, path);
4774
+ return pathComponents(path, getRootLength(path));
4775
+ }
4776
+ ts.getPathComponents = getPathComponents;
4777
+ function getPathFromPathComponents(pathComponents) {
4778
+ if (pathComponents.length === 0)
4779
+ return "";
4780
+ var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]);
4781
+ return root + pathComponents.slice(1).join(ts.directorySeparator);
4782
+ }
4783
+ ts.getPathFromPathComponents = getPathFromPathComponents;
4784
+ function normalizeSlashes(path) {
4785
+ var index = path.indexOf("\\");
4786
+ if (index === -1) {
4787
+ return path;
4788
+ }
4789
+ backslashRegExp.lastIndex = index;
4790
+ return path.replace(backslashRegExp, ts.directorySeparator);
4791
+ }
4792
+ ts.normalizeSlashes = normalizeSlashes;
4793
+ function reducePathComponents(components) {
4794
+ if (!ts.some(components))
4795
+ return [];
4796
+ var reduced = [components[0]];
4797
+ for (var i = 1; i < components.length; i++) {
4798
+ var component = components[i];
4799
+ if (!component)
4800
+ continue;
4801
+ if (component === ".")
4802
+ continue;
4803
+ if (component === "..") {
4804
+ if (reduced.length > 1) {
4805
+ if (reduced[reduced.length - 1] !== "..") {
4806
+ reduced.pop();
4807
+ continue;
4808
+ }
4809
+ }
4810
+ else if (reduced[0])
4811
+ continue;
4812
+ }
4813
+ reduced.push(component);
4814
+ }
4815
+ return reduced;
4816
+ }
4817
+ ts.reducePathComponents = reducePathComponents;
4818
+ function combinePaths(path) {
4819
+ var paths = [];
4820
+ for (var _i = 1; _i < arguments.length; _i++) {
4821
+ paths[_i - 1] = arguments[_i];
4822
+ }
4823
+ if (path)
4824
+ path = normalizeSlashes(path);
4825
+ for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) {
4826
+ var relativePath = paths_1[_a];
4827
+ if (!relativePath)
4828
+ continue;
4829
+ relativePath = normalizeSlashes(relativePath);
4830
+ if (!path || getRootLength(relativePath) !== 0) {
4831
+ path = relativePath;
4832
+ }
4833
+ else {
4834
+ path = ensureTrailingDirectorySeparator(path) + relativePath;
4835
+ }
4836
+ }
4837
+ return path;
4838
+ }
4839
+ ts.combinePaths = combinePaths;
4840
+ function resolvePath(path) {
4841
+ var paths = [];
4842
+ for (var _i = 1; _i < arguments.length; _i++) {
4843
+ paths[_i - 1] = arguments[_i];
4844
+ }
4845
+ return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArray([path], paths, false)) : normalizeSlashes(path));
4846
+ }
4847
+ ts.resolvePath = resolvePath;
4848
+ function getNormalizedPathComponents(path, currentDirectory) {
4849
+ return reducePathComponents(getPathComponents(path, currentDirectory));
4850
+ }
4851
+ ts.getNormalizedPathComponents = getNormalizedPathComponents;
4852
+ function getNormalizedAbsolutePath(fileName, currentDirectory) {
4853
+ return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory));
4854
+ }
4855
+ ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath;
4856
+ function normalizePath(path) {
4857
+ path = normalizeSlashes(path);
4858
+ if (!relativePathSegmentRegExp.test(path)) {
4859
+ return path;
4860
+ }
4861
+ var simplified = path.replace(/\/\.\//g, "/").replace(/^\.\//, "");
4862
+ if (simplified !== path) {
4863
+ path = simplified;
4864
+ if (!relativePathSegmentRegExp.test(path)) {
4865
+ return path;
4866
+ }
4867
+ }
4868
+ var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path)));
4869
+ return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
4870
+ }
4871
+ ts.normalizePath = normalizePath;
4872
+ function getPathWithoutRoot(pathComponents) {
4873
+ if (pathComponents.length === 0)
4874
+ return "";
4875
+ return pathComponents.slice(1).join(ts.directorySeparator);
4876
+ }
4877
+ function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) {
4878
+ return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory));
4879
+ }
4880
+ ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot;
4881
+ function toPath(fileName, basePath, getCanonicalFileName) {
4882
+ var nonCanonicalizedPath = isRootedDiskPath(fileName)
4883
+ ? normalizePath(fileName)
4884
+ : getNormalizedAbsolutePath(fileName, basePath);
4885
+ return getCanonicalFileName(nonCanonicalizedPath);
4886
+ }
4887
+ ts.toPath = toPath;
4888
+ function normalizePathAndParts(path) {
4889
+ path = normalizeSlashes(path);
4890
+ var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1);
4891
+ if (parts.length) {
4892
+ var joinedParts = root + parts.join(ts.directorySeparator);
4893
+ return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts };
4894
+ }
4895
+ else {
4896
+ return { path: root, parts: parts };
4897
+ }
4898
+ }
4899
+ ts.normalizePathAndParts = normalizePathAndParts;
4900
+ function removeTrailingDirectorySeparator(path) {
4901
+ if (hasTrailingDirectorySeparator(path)) {
4902
+ return path.substr(0, path.length - 1);
4903
+ }
4904
+ return path;
4905
+ }
4906
+ ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator;
4907
+ function ensureTrailingDirectorySeparator(path) {
4908
+ if (!hasTrailingDirectorySeparator(path)) {
4909
+ return path + ts.directorySeparator;
4910
+ }
4911
+ return path;
4912
+ }
4913
+ ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator;
4914
+ function ensurePathIsNonModuleName(path) {
4915
+ return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path;
4916
+ }
4917
+ ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName;
4918
+ function changeAnyExtension(path, ext, extensions, ignoreCase) {
4919
+ var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path);
4920
+ return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path;
4921
+ }
4922
+ ts.changeAnyExtension = changeAnyExtension;
4923
+ var relativePathSegmentRegExp = /(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/;
4924
+ function comparePathsWorker(a, b, componentComparer) {
4925
+ if (a === b)
4926
+ return 0;
4927
+ if (a === undefined)
4928
+ return -1;
4929
+ if (b === undefined)
4930
+ return 1;
4931
+ var aRoot = a.substring(0, getRootLength(a));
4932
+ var bRoot = b.substring(0, getRootLength(b));
4933
+ var result = ts.compareStringsCaseInsensitive(aRoot, bRoot);
4934
+ if (result !== 0) {
4935
+ return result;
4936
+ }
4937
+ var aRest = a.substring(aRoot.length);
4938
+ var bRest = b.substring(bRoot.length);
4939
+ if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) {
4940
+ return componentComparer(aRest, bRest);
4941
+ }
4942
+ var aComponents = reducePathComponents(getPathComponents(a));
4943
+ var bComponents = reducePathComponents(getPathComponents(b));
4944
+ var sharedLength = Math.min(aComponents.length, bComponents.length);
4945
+ for (var i = 1; i < sharedLength; i++) {
4946
+ var result_2 = componentComparer(aComponents[i], bComponents[i]);
4947
+ if (result_2 !== 0) {
4948
+ return result_2;
4949
+ }
4950
+ }
4951
+ return ts.compareValues(aComponents.length, bComponents.length);
4952
+ }
4953
+ function comparePathsCaseSensitive(a, b) {
4954
+ return comparePathsWorker(a, b, ts.compareStringsCaseSensitive);
4955
+ }
4956
+ ts.comparePathsCaseSensitive = comparePathsCaseSensitive;
4957
+ function comparePathsCaseInsensitive(a, b) {
4958
+ return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive);
4959
+ }
4960
+ ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive;
4961
+ function comparePaths(a, b, currentDirectory, ignoreCase) {
4962
+ if (typeof currentDirectory === "string") {
4963
+ a = combinePaths(currentDirectory, a);
4964
+ b = combinePaths(currentDirectory, b);
4965
+ }
4966
+ else if (typeof currentDirectory === "boolean") {
4967
+ ignoreCase = currentDirectory;
4968
+ }
4969
+ return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase));
4970
+ }
4971
+ ts.comparePaths = comparePaths;
4972
+ function containsPath(parent, child, currentDirectory, ignoreCase) {
4973
+ if (typeof currentDirectory === "string") {
4974
+ parent = combinePaths(currentDirectory, parent);
4975
+ child = combinePaths(currentDirectory, child);
4976
+ }
4977
+ else if (typeof currentDirectory === "boolean") {
4978
+ ignoreCase = currentDirectory;
4979
+ }
4980
+ if (parent === undefined || child === undefined)
4981
+ return false;
4982
+ if (parent === child)
4983
+ return true;
4984
+ var parentComponents = reducePathComponents(getPathComponents(parent));
4985
+ var childComponents = reducePathComponents(getPathComponents(child));
4986
+ if (childComponents.length < parentComponents.length) {
4987
+ return false;
4988
+ }
4989
+ var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive;
4990
+ for (var i = 0; i < parentComponents.length; i++) {
4991
+ var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer;
4992
+ if (!equalityComparer(parentComponents[i], childComponents[i])) {
4993
+ return false;
4994
+ }
4995
+ }
4996
+ return true;
4997
+ }
4998
+ ts.containsPath = containsPath;
4999
+ function startsWithDirectory(fileName, directoryName, getCanonicalFileName) {
5000
+ var canonicalFileName = getCanonicalFileName(fileName);
5001
+ var canonicalDirectoryName = getCanonicalFileName(directoryName);
5002
+ return ts.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts.startsWith(canonicalFileName, canonicalDirectoryName + "\\");
5003
+ }
5004
+ ts.startsWithDirectory = startsWithDirectory;
5005
+ function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) {
5006
+ var fromComponents = reducePathComponents(getPathComponents(from));
5007
+ var toComponents = reducePathComponents(getPathComponents(to));
5008
+ var start;
5009
+ for (start = 0; start < fromComponents.length && start < toComponents.length; start++) {
5010
+ var fromComponent = getCanonicalFileName(fromComponents[start]);
5011
+ var toComponent = getCanonicalFileName(toComponents[start]);
5012
+ var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer;
5013
+ if (!comparer(fromComponent, toComponent))
5014
+ break;
5015
+ }
5016
+ if (start === 0) {
5017
+ return toComponents;
5018
+ }
5019
+ var components = toComponents.slice(start);
5020
+ var relative = [];
5021
+ for (; start < fromComponents.length; start++) {
5022
+ relative.push("..");
5023
+ }
5024
+ return __spreadArray(__spreadArray([""], relative, true), components, true);
5025
+ }
5026
+ ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo;
5027
+ function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
5028
+ ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative");
5029
+ var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity;
5030
+ var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false;
5031
+ var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName);
5032
+ return getPathFromPathComponents(pathComponents);
5033
+ }
5034
+ ts.getRelativePathFromDirectory = getRelativePathFromDirectory;
5035
+ function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) {
5036
+ return !isRootedDiskPath(absoluteOrRelativePath)
5037
+ ? absoluteOrRelativePath
5038
+ : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, false);
5039
+ }
5040
+ ts.convertToRelativePath = convertToRelativePath;
5041
+ function getRelativePathFromFile(from, to, getCanonicalFileName) {
5042
+ return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName));
5043
+ }
5044
+ ts.getRelativePathFromFile = getRelativePathFromFile;
5045
+ function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) {
5046
+ var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName);
5047
+ var firstComponent = pathComponents[0];
5048
+ if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) {
5049
+ var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///";
5050
+ pathComponents[0] = prefix + firstComponent;
5051
+ }
5052
+ return getPathFromPathComponents(pathComponents);
5053
+ }
5054
+ ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl;
5055
+ function forEachAncestorDirectory(directory, callback) {
5056
+ while (true) {
5057
+ var result = callback(directory);
5058
+ if (result !== undefined) {
5059
+ return result;
5060
+ }
5061
+ var parentPath = getDirectoryPath(directory);
5062
+ if (parentPath === directory) {
5063
+ return undefined;
5064
+ }
5065
+ directory = parentPath;
5066
+ }
5067
+ }
5068
+ ts.forEachAncestorDirectory = forEachAncestorDirectory;
5069
+ function isNodeModulesDirectory(dirPath) {
5070
+ return ts.endsWith(dirPath, "/node_modules");
5071
+ }
5072
+ ts.isNodeModulesDirectory = isNodeModulesDirectory;
5073
+ })(ts || (ts = {}));
5074
+ var ts;
5075
5075
  (function (ts) {
5076
5076
  function diag(code, category, key, message, reportsUnnecessary, elidedInCompatabilityPyramid, reportsDeprecated) {
5077
5077
  return { code: code, category: category, key: key, message: message, reportsUnnecessary: reportsUnnecessary, elidedInCompatabilityPyramid: elidedInCompatabilityPyramid, reportsDeprecated: reportsDeprecated };
@@ -5362,7 +5362,6 @@ var ts;
5362
5362
  Unexpected_token_Did_you_mean_or_rbrace: diag(1381, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `&rbrace;`?"),
5363
5363
  Unexpected_token_Did_you_mean_or_gt: diag(1382, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `&gt;`?"),
5364
5364
  Only_named_exports_may_use_export_type: diag(1383, ts.DiagnosticCategory.Error, "Only_named_exports_may_use_export_type_1383", "Only named exports may use 'export type'."),
5365
- A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list: diag(1384, ts.DiagnosticCategory.Error, "A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384", "A 'new' expression with type arguments must always be followed by a parenthesized argument list."),
5366
5365
  Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."),
5367
5366
  Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."),
5368
5367
  Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."),
@@ -5896,12 +5895,10 @@ var ts;
5896
5895
  Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher: diag(2802, ts.DiagnosticCategory.Error, "Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802", "Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."),
5897
5896
  Cannot_assign_to_private_method_0_Private_methods_are_not_writable: diag(2803, ts.DiagnosticCategory.Error, "Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803", "Cannot assign to private method '{0}'. Private methods are not writable."),
5898
5897
  Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name: diag(2804, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804", "Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."),
5899
- Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_not_specified_with_a_target_of_esnext_Consider_adding_the_useDefineForClassFields_flag: diag(2805, ts.DiagnosticCategory.Error, "Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805", "Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag."),
5900
5898
  Private_accessor_was_defined_without_a_getter: diag(2806, ts.DiagnosticCategory.Error, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."),
5901
5899
  This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, ts.DiagnosticCategory.Error, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),
5902
5900
  A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, ts.DiagnosticCategory.Error, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"),
5903
5901
  Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses: diag(2809, ts.DiagnosticCategory.Error, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."),
5904
- Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnext_and_useDefineForClassFields_is_false: diag(2810, ts.DiagnosticCategory.Error, "Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810", "Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'."),
5905
5902
  Initializer_for_property_0: diag(2811, ts.DiagnosticCategory.Error, "Initializer_for_property_0_2811", "Initializer for property '{0}'"),
5906
5903
  Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),
5907
5904
  Class_declaration_cannot_implement_overload_list_for_0: diag(2813, ts.DiagnosticCategory.Error, "Class_declaration_cannot_implement_overload_list_for_0_2813", "Class declaration cannot implement overload list for '{0}'."),
@@ -6658,9 +6655,8 @@ var ts;
6658
6655
  Remove_variable_statement: diag(90010, ts.DiagnosticCategory.Message, "Remove_variable_statement_90010", "Remove variable statement"),
6659
6656
  Remove_template_tag: diag(90011, ts.DiagnosticCategory.Message, "Remove_template_tag_90011", "Remove template tag"),
6660
6657
  Remove_type_parameters: diag(90012, ts.DiagnosticCategory.Message, "Remove_type_parameters_90012", "Remove type parameters"),
6661
- Import_0_from_module_1: diag(90013, ts.DiagnosticCategory.Message, "Import_0_from_module_1_90013", "Import '{0}' from module \"{1}\""),
6658
+ Import_0_from_1: diag(90013, ts.DiagnosticCategory.Message, "Import_0_from_1_90013", "Import '{0}' from \"{1}\""),
6662
6659
  Change_0_to_1: diag(90014, ts.DiagnosticCategory.Message, "Change_0_to_1_90014", "Change '{0}' to '{1}'"),
6663
- Add_0_to_existing_import_declaration_from_1: diag(90015, ts.DiagnosticCategory.Message, "Add_0_to_existing_import_declaration_from_1_90015", "Add '{0}' to existing import declaration from \"{1}\""),
6664
6660
  Declare_property_0: diag(90016, ts.DiagnosticCategory.Message, "Declare_property_0_90016", "Declare property '{0}'"),
6665
6661
  Add_index_signature_for_property_0: diag(90017, ts.DiagnosticCategory.Message, "Add_index_signature_for_property_0_90017", "Add index signature for property '{0}'"),
6666
6662
  Disable_checking_for_this_file: diag(90018, ts.DiagnosticCategory.Message, "Disable_checking_for_this_file_90018", "Disable checking for this file"),
@@ -6677,8 +6673,6 @@ var ts;
6677
6673
  Add_async_modifier_to_containing_function: diag(90029, ts.DiagnosticCategory.Message, "Add_async_modifier_to_containing_function_90029", "Add async modifier to containing function"),
6678
6674
  Replace_infer_0_with_unknown: diag(90030, ts.DiagnosticCategory.Message, "Replace_infer_0_with_unknown_90030", "Replace 'infer {0}' with 'unknown'"),
6679
6675
  Replace_all_unused_infer_with_unknown: diag(90031, ts.DiagnosticCategory.Message, "Replace_all_unused_infer_with_unknown_90031", "Replace all unused 'infer' with 'unknown'"),
6680
- Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""),
6681
- Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""),
6682
6676
  Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"),
6683
6677
  Declare_private_property_0: diag(90035, ts.DiagnosticCategory.Message, "Declare_private_property_0_90035", "Declare private property '{0}'"),
6684
6678
  Replace_0_with_Promise_1: diag(90036, ts.DiagnosticCategory.Message, "Replace_0_with_Promise_1_90036", "Replace '{0}' with 'Promise<{1}>'"),
@@ -6690,6 +6684,8 @@ var ts;
6690
6684
  Includes_imports_of_types_referenced_by_0: diag(90054, ts.DiagnosticCategory.Message, "Includes_imports_of_types_referenced_by_0_90054", "Includes imports of types referenced by '{0}'"),
6691
6685
  Remove_type_from_import_declaration_from_0: diag(90055, ts.DiagnosticCategory.Message, "Remove_type_from_import_declaration_from_0_90055", "Remove 'type' from import declaration from \"{0}\""),
6692
6686
  Remove_type_from_import_of_0_from_1: diag(90056, ts.DiagnosticCategory.Message, "Remove_type_from_import_of_0_from_1_90056", "Remove 'type' from import of '{0}' from \"{1}\""),
6687
+ Add_import_from_0: diag(90057, ts.DiagnosticCategory.Message, "Add_import_from_0_90057", "Add import from \"{0}\""),
6688
+ Update_import_from_0: diag(90058, ts.DiagnosticCategory.Message, "Update_import_from_0_90058", "Update import from \"{0}\""),
6693
6689
  Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
6694
6690
  Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
6695
6691
  Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
@@ -6853,6 +6849,7 @@ var ts;
6853
6849
  Add_missing_attributes: diag(95167, ts.DiagnosticCategory.Message, "Add_missing_attributes_95167", "Add missing attributes"),
6854
6850
  Add_all_missing_attributes: diag(95168, ts.DiagnosticCategory.Message, "Add_all_missing_attributes_95168", "Add all missing attributes"),
6855
6851
  Add_undefined_to_optional_property_type: diag(95169, ts.DiagnosticCategory.Message, "Add_undefined_to_optional_property_type_95169", "Add 'undefined' to optional property type"),
6852
+ Convert_named_imports_to_default_import: diag(95170, ts.DiagnosticCategory.Message, "Convert_named_imports_to_default_import_95170", "Convert named imports to default import"),
6856
6853
  No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
6857
6854
  Classes_may_not_have_a_field_named_constructor: diag(18006, ts.DiagnosticCategory.Error, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
6858
6855
  JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts.DiagnosticCategory.Error, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
@@ -9585,11 +9582,17 @@ var ts;
9585
9582
  ts.getAllJSDocTagsOfKind = getAllJSDocTagsOfKind;
9586
9583
  function getTextOfJSDocComment(comment) {
9587
9584
  return typeof comment === "string" ? comment
9588
- : comment === null || comment === void 0 ? void 0 : comment.map(function (c) {
9589
- return c.kind === 319 ? c.text : "{@link " + (c.name ? ts.entityNameToString(c.name) + " " : "") + c.text + "}";
9590
- }).join("");
9585
+ : comment === null || comment === void 0 ? void 0 : comment.map(function (c) { return c.kind === 319 ? c.text : formatJSDocLink(c); }).join("");
9591
9586
  }
9592
9587
  ts.getTextOfJSDocComment = getTextOfJSDocComment;
9588
+ function formatJSDocLink(link) {
9589
+ var kind = link.kind === 322 ? "link"
9590
+ : link.kind === 323 ? "linkcode"
9591
+ : "linkplain";
9592
+ var name = link.name ? ts.entityNameToString(link.name) : "";
9593
+ var space = link.name && link.text.startsWith("://") ? "" : " ";
9594
+ return "{@" + kind + " " + name + space + link.text + "}";
9595
+ }
9593
9596
  function getEffectiveTypeParameterDeclarations(node) {
9594
9597
  if (ts.isJSDocSignature(node)) {
9595
9598
  return ts.emptyArray;
@@ -16601,6 +16604,49 @@ var ts;
16601
16604
  return !!(type.flags & 262144 && type.isThisType);
16602
16605
  }
16603
16606
  ts.isThisTypeParameter = isThisTypeParameter;
16607
+ function getNodeModulePathParts(fullPath) {
16608
+ var topLevelNodeModulesIndex = 0;
16609
+ var topLevelPackageNameIndex = 0;
16610
+ var packageRootIndex = 0;
16611
+ var fileNameIndex = 0;
16612
+ var partStart = 0;
16613
+ var partEnd = 0;
16614
+ var state = 0;
16615
+ while (partEnd >= 0) {
16616
+ partStart = partEnd;
16617
+ partEnd = fullPath.indexOf("/", partStart + 1);
16618
+ switch (state) {
16619
+ case 0:
16620
+ if (fullPath.indexOf(ts.nodeModulesPathPart, partStart) === partStart) {
16621
+ topLevelNodeModulesIndex = partStart;
16622
+ topLevelPackageNameIndex = partEnd;
16623
+ state = 1;
16624
+ }
16625
+ break;
16626
+ case 1:
16627
+ case 2:
16628
+ if (state === 1 && fullPath.charAt(partStart + 1) === "@") {
16629
+ state = 2;
16630
+ }
16631
+ else {
16632
+ packageRootIndex = partEnd;
16633
+ state = 3;
16634
+ }
16635
+ break;
16636
+ case 3:
16637
+ if (fullPath.indexOf(ts.nodeModulesPathPart, partStart) === partStart) {
16638
+ state = 1;
16639
+ }
16640
+ else {
16641
+ state = 3;
16642
+ }
16643
+ break;
16644
+ }
16645
+ }
16646
+ fileNameIndex = partStart;
16647
+ return state > 1 ? { topLevelNodeModulesIndex: topLevelNodeModulesIndex, topLevelPackageNameIndex: topLevelPackageNameIndex, packageRootIndex: packageRootIndex, fileNameIndex: fileNameIndex } : undefined;
16648
+ }
16649
+ ts.getNodeModulePathParts = getNodeModulePathParts;
16604
16650
  })(ts || (ts = {}));
16605
16651
  var ts;
16606
16652
  (function (ts) {
@@ -27705,19 +27751,28 @@ var ts;
27705
27751
  expression = parsePropertyAccessExpressionRest(pos, expression, questionDotToken);
27706
27752
  continue;
27707
27753
  }
27708
- if (!questionDotToken && token() === 53 && !scanner.hasPrecedingLineBreak()) {
27709
- nextToken();
27710
- expression = finishNode(factory.createNonNullExpression(expression), pos);
27711
- continue;
27712
- }
27713
27754
  if ((questionDotToken || !inDecoratorContext()) && parseOptional(22)) {
27714
27755
  expression = parseElementAccessExpressionRest(pos, expression, questionDotToken);
27715
27756
  continue;
27716
27757
  }
27717
27758
  if (isTemplateStartOfTaggedTemplate()) {
27718
- expression = parseTaggedTemplateRest(pos, expression, questionDotToken, undefined);
27759
+ expression = !questionDotToken && expression.kind === 227 ?
27760
+ parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) :
27761
+ parseTaggedTemplateRest(pos, expression, questionDotToken, undefined);
27719
27762
  continue;
27720
27763
  }
27764
+ if (!questionDotToken) {
27765
+ if (token() === 53 && !scanner.hasPrecedingLineBreak()) {
27766
+ nextToken();
27767
+ expression = finishNode(factory.createNonNullExpression(expression), pos);
27768
+ continue;
27769
+ }
27770
+ var typeArguments = tryParse(parseTypeArgumentsInExpression);
27771
+ if (typeArguments) {
27772
+ expression = finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);
27773
+ continue;
27774
+ }
27775
+ }
27721
27776
  return expression;
27722
27777
  }
27723
27778
  }
@@ -27737,31 +27792,24 @@ var ts;
27737
27792
  function parseCallExpressionRest(pos, expression) {
27738
27793
  while (true) {
27739
27794
  expression = parseMemberExpressionRest(pos, expression, true);
27795
+ var typeArguments = void 0;
27740
27796
  var questionDotToken = parseOptionalToken(28);
27741
- if ((contextFlags & 131072) === 0 && (token() === 29 || token() === 47)) {
27742
- var typeArguments = tryParse(parseTypeArgumentsInExpression);
27743
- if (typeArguments) {
27744
- if (isTemplateStartOfTaggedTemplate()) {
27745
- expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments);
27746
- continue;
27747
- }
27748
- if (questionDotToken || token() === 20) {
27749
- var argumentList = parseArgumentList();
27750
- var callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
27751
- factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) :
27752
- factory.createCallExpression(expression, typeArguments, argumentList);
27753
- expression = finishNode(callExpr, pos);
27754
- continue;
27755
- }
27756
- expression = finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);
27757
- break;
27797
+ if (questionDotToken) {
27798
+ typeArguments = tryParse(parseTypeArgumentsInExpression);
27799
+ if (isTemplateStartOfTaggedTemplate()) {
27800
+ expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments);
27801
+ continue;
27758
27802
  }
27759
27803
  }
27760
- else if (token() === 20) {
27804
+ if (typeArguments || token() === 20) {
27805
+ if (!questionDotToken && expression.kind === 227) {
27806
+ typeArguments = expression.typeArguments;
27807
+ expression = expression.expression;
27808
+ }
27761
27809
  var argumentList = parseArgumentList();
27762
27810
  var callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
27763
- factory.createCallChain(expression, questionDotToken, undefined, argumentList) :
27764
- factory.createCallExpression(expression, undefined, argumentList);
27811
+ factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) :
27812
+ factory.createCallExpression(expression, typeArguments, argumentList);
27765
27813
  expression = finishNode(callExpr, pos);
27766
27814
  continue;
27767
27815
  }
@@ -27800,6 +27848,7 @@ var ts;
27800
27848
  case 15:
27801
27849
  case 27:
27802
27850
  case 24:
27851
+ case 28:
27803
27852
  case 21:
27804
27853
  case 23:
27805
27854
  case 58:
@@ -27984,20 +28033,13 @@ var ts;
27984
28033
  }
27985
28034
  var expressionPos = getNodePos();
27986
28035
  var expression = parseMemberExpressionRest(expressionPos, parsePrimaryExpression(), false);
27987
- var typeArguments = tryParse(parseTypeArgumentsInExpression);
27988
- if (isTemplateStartOfTaggedTemplate()) {
27989
- ts.Debug.assert(!!typeArguments, "Expected a type argument list; all plain tagged template starts should be consumed in 'parseMemberExpressionRest'");
27990
- expression = parseTaggedTemplateRest(expressionPos, expression, undefined, typeArguments);
27991
- typeArguments = undefined;
27992
- }
27993
- var argumentsArray;
27994
- if (token() === 20) {
27995
- argumentsArray = parseArgumentList();
27996
- }
27997
- else if (typeArguments) {
27998
- parseErrorAt(pos, scanner.getStartPos(), ts.Diagnostics.A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list);
28036
+ var typeArguments;
28037
+ if (expression.kind === 227) {
28038
+ typeArguments = expression.typeArguments;
28039
+ expression = expression.expression;
27999
28040
  }
28000
- return finishNode(factory.createNewExpression(expression, typeArguments, argumentsArray), pos);
28041
+ var argumentList = token() === 20 ? parseArgumentList() : undefined;
28042
+ return finishNode(factory.createNewExpression(expression, typeArguments, argumentList), pos);
28001
28043
  }
28002
28044
  function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
28003
28045
  var pos = getNodePos();
@@ -39975,24 +40017,19 @@ var ts;
39975
40017
  error(errorLocation, ts.Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name), ts.declarationNameToString(errorLocation));
39976
40018
  }
39977
40019
  }
39978
- if (result && errorLocation && meaning & 111551 && result.flags & 2097152) {
39979
- checkSymbolUsageInExpressionContext(result, name, errorLocation);
40020
+ if (result && errorLocation && meaning & 111551 && result.flags & 2097152 && !(result.flags & 111551) && !ts.isValidTypeOnlyAliasUseSite(errorLocation)) {
40021
+ var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result);
40022
+ if (typeOnlyDeclaration) {
40023
+ var message = typeOnlyDeclaration.kind === 274
40024
+ ? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type
40025
+ : ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
40026
+ var unescapedName = ts.unescapeLeadingUnderscores(name);
40027
+ addTypeOnlyDeclarationRelatedInfo(error(errorLocation, message, unescapedName), typeOnlyDeclaration, unescapedName);
40028
+ }
39980
40029
  }
39981
40030
  }
39982
40031
  return result;
39983
40032
  }
39984
- function checkSymbolUsageInExpressionContext(symbol, name, useSite) {
39985
- if (!ts.isValidTypeOnlyAliasUseSite(useSite)) {
39986
- var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(symbol);
39987
- if (typeOnlyDeclaration) {
39988
- var message = typeOnlyDeclaration.kind === 274
39989
- ? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type
39990
- : ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
39991
- var unescapedName = ts.unescapeLeadingUnderscores(name);
39992
- addTypeOnlyDeclarationRelatedInfo(error(useSite, message, unescapedName), typeOnlyDeclaration, unescapedName);
39993
- }
39994
- }
39995
- }
39996
40033
  function addTypeOnlyDeclarationRelatedInfo(diagnostic, typeOnlyDeclaration, unescapedName) {
39997
40034
  if (!typeOnlyDeclaration)
39998
40035
  return diagnostic;
@@ -56698,7 +56735,10 @@ var ts;
56698
56735
  (type === falseType || type === regularFalseType) ? 12121864 : 7927560 :
56699
56736
  (type === falseType || type === regularFalseType) ? 12580616 : 16774920;
56700
56737
  }
56701
- if (flags & 524288 && !ignoreObjects) {
56738
+ if (flags & 524288) {
56739
+ if (ignoreObjects) {
56740
+ return 16768959;
56741
+ }
56702
56742
  return ts.getObjectFlags(type) & 16 && isEmptyObjectType(type) ?
56703
56743
  strictNullChecks ? 16318463 : 16777215 :
56704
56744
  isFunctionObjectType(type) ?
@@ -56742,7 +56782,7 @@ var ts;
56742
56782
  oredFacts |= f;
56743
56783
  andedFacts &= f;
56744
56784
  }
56745
- return oredFacts & 8288 | andedFacts & 16768927;
56785
+ return oredFacts & 8256 | andedFacts & 16768959;
56746
56786
  }
56747
56787
  function getTypeWithFacts(type, include) {
56748
56788
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
@@ -58421,6 +58461,9 @@ var ts;
58421
58461
  return getTypeOfSymbol(symbol);
58422
58462
  }
58423
58463
  function checkIdentifier(node, checkMode) {
58464
+ if (ts.isThisInTypeQuery(node)) {
58465
+ return checkThisExpression(node);
58466
+ }
58424
58467
  var symbol = getResolvedSymbol(node);
58425
58468
  if (symbol === unknownSymbol) {
58426
58469
  return errorType;
@@ -59917,7 +59960,8 @@ var ts;
59917
59960
  var links = getNodeLinks(node.expression);
59918
59961
  if (!links.resolvedType) {
59919
59962
  if ((ts.isTypeLiteralNode(node.parent.parent) || ts.isClassLike(node.parent.parent) || ts.isInterfaceDeclaration(node.parent.parent))
59920
- && ts.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 101) {
59963
+ && ts.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 101
59964
+ && node.parent.kind !== 171 && node.parent.kind !== 172) {
59921
59965
  return links.resolvedType = errorType;
59922
59966
  }
59923
59967
  links.resolvedType = checkExpression(node.expression);
@@ -60898,23 +60942,6 @@ var ts;
60898
60942
  if (assignmentKind && lexicallyScopedSymbol && lexicallyScopedSymbol.valueDeclaration && ts.isMethodDeclaration(lexicallyScopedSymbol.valueDeclaration)) {
60899
60943
  grammarErrorOnNode(right, ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable, ts.idText(right));
60900
60944
  }
60901
- if ((lexicallyScopedSymbol === null || lexicallyScopedSymbol === void 0 ? void 0 : lexicallyScopedSymbol.valueDeclaration) && (ts.getEmitScriptTarget(compilerOptions) === 99 && !useDefineForClassFields)) {
60902
- var lexicalClass_1 = ts.getContainingClass(lexicallyScopedSymbol.valueDeclaration);
60903
- var parentStaticFieldInitializer = ts.findAncestor(node, function (n) {
60904
- if (n === lexicalClass_1)
60905
- return "quit";
60906
- if (ts.isPropertyDeclaration(n.parent) && ts.hasStaticModifier(n.parent) && n.parent.initializer === n && n.parent.parent === lexicalClass_1) {
60907
- return true;
60908
- }
60909
- return false;
60910
- });
60911
- if (parentStaticFieldInitializer) {
60912
- var parentStaticFieldInitializerSymbol = getSymbolOfNode(parentStaticFieldInitializer.parent);
60913
- ts.Debug.assert(parentStaticFieldInitializerSymbol, "Initializer without declaration symbol");
60914
- var diagnostic = error(node, ts.Diagnostics.Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnext_and_useDefineForClassFields_is_false, ts.symbolName(lexicallyScopedSymbol));
60915
- ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(parentStaticFieldInitializer.parent, ts.Diagnostics.Initializer_for_property_0, ts.symbolName(parentStaticFieldInitializerSymbol)));
60916
- }
60917
- }
60918
60945
  if (isAnyLike) {
60919
60946
  if (lexicallyScopedSymbol) {
60920
60947
  return isErrorType(apparentType) ? errorType : apparentType;
@@ -63219,51 +63246,57 @@ var ts;
63219
63246
  ts.isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) :
63220
63247
  checkExpression(node.exprName);
63221
63248
  var typeArguments = node.typeArguments;
63222
- if (!ts.some(typeArguments)) {
63249
+ if (exprType === silentNeverType || isErrorType(exprType) || !ts.some(typeArguments)) {
63223
63250
  return exprType;
63224
63251
  }
63225
- var funcType = getApparentType(exprType);
63226
- if (funcType === silentNeverType || isErrorType(funcType)) {
63227
- return funcType;
63228
- }
63229
63252
  var hasSomeApplicableSignature = false;
63230
63253
  var nonApplicableType;
63231
- var hasSignatures;
63232
- var hasApplicableSignature;
63233
- var result = mapType(funcType, getInstantiatedType);
63234
- var errorType = hasSomeApplicableSignature ? nonApplicableType : funcType;
63254
+ var result = getInstantiatedType(exprType);
63255
+ var errorType = hasSomeApplicableSignature ? nonApplicableType : exprType;
63235
63256
  if (errorType) {
63236
63257
  diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable, typeToString(errorType)));
63237
63258
  }
63238
63259
  return result;
63239
63260
  function getInstantiatedType(type) {
63240
- hasSignatures = false;
63241
- hasApplicableSignature = false;
63242
- var result = getInstantiatedTypeWorker(type);
63261
+ var hasSignatures = false;
63262
+ var hasApplicableSignature = false;
63263
+ var result = getInstantiatedTypePart(type);
63243
63264
  hasSomeApplicableSignature || (hasSomeApplicableSignature = hasApplicableSignature);
63244
63265
  if (hasSignatures && !hasApplicableSignature) {
63245
63266
  nonApplicableType !== null && nonApplicableType !== void 0 ? nonApplicableType : (nonApplicableType = type);
63246
63267
  }
63247
63268
  return result;
63248
- }
63249
- function getInstantiatedTypeWorker(type) {
63250
- if (type.flags & 524288) {
63251
- var resolved = resolveStructuredTypeMembers(type);
63252
- var callSignatures = getInstantiatedSignatures(resolved.callSignatures);
63253
- var constructSignatures = getInstantiatedSignatures(resolved.constructSignatures);
63254
- hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
63255
- hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
63256
- if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
63257
- var result_11 = createAnonymousType(undefined, resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
63258
- result_11.objectFlags |= 16777216;
63259
- result_11.node = node;
63260
- return result_11;
63269
+ function getInstantiatedTypePart(type) {
63270
+ if (type.flags & 524288) {
63271
+ var resolved = resolveStructuredTypeMembers(type);
63272
+ var callSignatures = getInstantiatedSignatures(resolved.callSignatures);
63273
+ var constructSignatures = getInstantiatedSignatures(resolved.constructSignatures);
63274
+ hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
63275
+ hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
63276
+ if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
63277
+ var result_11 = createAnonymousType(undefined, resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
63278
+ result_11.objectFlags |= 16777216;
63279
+ result_11.node = node;
63280
+ return result_11;
63281
+ }
63282
+ }
63283
+ else if (type.flags & 58982400) {
63284
+ var constraint = getBaseConstraintOfType(type);
63285
+ if (constraint) {
63286
+ var instantiated = getInstantiatedTypePart(constraint);
63287
+ if (instantiated !== constraint) {
63288
+ return instantiated;
63289
+ }
63290
+ }
63261
63291
  }
63292
+ else if (type.flags & 1048576) {
63293
+ return mapType(type, getInstantiatedType);
63294
+ }
63295
+ else if (type.flags & 2097152) {
63296
+ return getIntersectionType(ts.sameMap(type.types, getInstantiatedTypePart));
63297
+ }
63298
+ return type;
63262
63299
  }
63263
- else if (type.flags & 2097152) {
63264
- return getIntersectionType(ts.sameMap(type.types, getInstantiatedTypeWorker));
63265
- }
63266
- return type;
63267
63300
  }
63268
63301
  function getInstantiatedSignatures(signatures) {
63269
63302
  var applicableSignatures = ts.filter(signatures, function (sig) { return !!sig.typeParameters && hasCorrectTypeArgumentArity(sig, typeArguments); });
@@ -63351,6 +63384,10 @@ var ts;
63351
63384
  return restParameter.escapedName;
63352
63385
  }
63353
63386
  function getParameterIdentifierNameAtPosition(signature, pos) {
63387
+ var _a;
63388
+ if (((_a = signature.declaration) === null || _a === void 0 ? void 0 : _a.kind) === 315) {
63389
+ return undefined;
63390
+ }
63354
63391
  var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
63355
63392
  if (pos < paramCount) {
63356
63393
  var param = signature.parameters[pos];
@@ -65899,9 +65936,6 @@ var ts;
65899
65936
  checkGrammarComputedPropertyName(node.name);
65900
65937
  checkVariableLikeDeclaration(node);
65901
65938
  setNodeLinksForPrivateIdentifierScope(node);
65902
- if (ts.isPrivateIdentifier(node.name) && ts.hasStaticModifier(node) && node.initializer && languageVersion === 99 && !compilerOptions.useDefineForClassFields) {
65903
- error(node.initializer, ts.Diagnostics.Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_not_specified_with_a_target_of_esnext_Consider_adding_the_useDefineForClassFields_flag);
65904
- }
65905
65939
  if (ts.hasSyntacticModifier(node, 128) && node.kind === 166 && node.initializer) {
65906
65940
  error(node, ts.Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, ts.declarationNameToString(node.name));
65907
65941
  }
@@ -70899,7 +70933,9 @@ var ts;
70899
70933
  case 80:
70900
70934
  case 205:
70901
70935
  case 160:
70902
- return getSymbolOfNameOrPropertyAccessExpression(node);
70936
+ if (!ts.isThisInTypeQuery(node)) {
70937
+ return getSymbolOfNameOrPropertyAccessExpression(node);
70938
+ }
70903
70939
  case 108:
70904
70940
  var container = ts.getThisContainer(node, false);
70905
70941
  if (ts.isFunctionLike(container)) {
@@ -71995,7 +72031,7 @@ var ts;
71995
72031
  if (quickResult !== undefined) {
71996
72032
  return quickResult;
71997
72033
  }
71998
- var lastStatic, lastDeclare, lastAsync, lastReadonly, lastOverride;
72034
+ var lastStatic, lastDeclare, lastAsync, lastOverride;
71999
72035
  var flags = 0;
72000
72036
  for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) {
72001
72037
  var modifier = _a[_i];
@@ -72097,7 +72133,6 @@ var ts;
72097
72133
  return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
72098
72134
  }
72099
72135
  flags |= 64;
72100
- lastReadonly = modifier;
72101
72136
  break;
72102
72137
  case 93:
72103
72138
  if (flags & 1) {
@@ -72210,18 +72245,12 @@ var ts;
72210
72245
  if (flags & 32) {
72211
72246
  return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
72212
72247
  }
72213
- if (flags & 128) {
72214
- return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "abstract");
72215
- }
72216
72248
  if (flags & 16384) {
72217
72249
  return grammarErrorOnNode(lastOverride, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "override");
72218
72250
  }
72219
- else if (flags & 256) {
72251
+ if (flags & 256) {
72220
72252
  return grammarErrorOnNode(lastAsync, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async");
72221
72253
  }
72222
- else if (flags & 64) {
72223
- return grammarErrorOnNode(lastReadonly, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "readonly");
72224
- }
72225
72254
  return false;
72226
72255
  }
72227
72256
  else if ((node.kind === 265 || node.kind === 264) && flags & 2) {
@@ -77077,8 +77106,8 @@ var ts;
77077
77106
  var languageVersion = ts.getEmitScriptTarget(compilerOptions);
77078
77107
  var useDefineForClassFields = ts.getUseDefineForClassFields(compilerOptions);
77079
77108
  var shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9;
77080
- var shouldTransformSuperInStaticInitializers = (languageVersion <= 8 || !useDefineForClassFields) && languageVersion >= 2;
77081
- var shouldTransformThisInStaticInitializers = languageVersion <= 8 || !useDefineForClassFields;
77109
+ var shouldTransformThisInStaticInitializers = languageVersion < 9;
77110
+ var shouldTransformSuperInStaticInitializers = shouldTransformThisInStaticInitializers && languageVersion >= 2;
77082
77111
  var previousOnSubstituteNode = context.onSubstituteNode;
77083
77112
  context.onSubstituteNode = onSubstituteNode;
77084
77113
  var previousOnEmitNode = context.onEmitNode;
@@ -77278,6 +77307,9 @@ var ts;
77278
77307
  ts.Debug.assert(!ts.some(node.decorators));
77279
77308
  if (ts.isPrivateIdentifier(node.name)) {
77280
77309
  if (!shouldTransformPrivateElementsOrClassStaticBlocks) {
77310
+ if (ts.isStatic(node)) {
77311
+ return ts.visitEachChild(node, visitor, context);
77312
+ }
77281
77313
  return factory.updatePropertyDeclaration(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, undefined, undefined, undefined);
77282
77314
  }
77283
77315
  var info = accessPrivateIdentifier(node.name);
@@ -77290,6 +77322,18 @@ var ts;
77290
77322
  if (expr && !ts.isSimpleInlineableExpression(expr)) {
77291
77323
  getPendingExpressions().push(expr);
77292
77324
  }
77325
+ if (ts.isStatic(node) && !shouldTransformPrivateElementsOrClassStaticBlocks && !useDefineForClassFields) {
77326
+ var initializerStatement = transformPropertyOrClassStaticBlock(node, factory.createThis());
77327
+ if (initializerStatement) {
77328
+ var staticBlock = factory.createClassStaticBlockDeclaration(undefined, undefined, factory.createBlock([initializerStatement]));
77329
+ ts.setOriginalNode(staticBlock, node);
77330
+ ts.setCommentRange(staticBlock, node);
77331
+ ts.setCommentRange(initializerStatement, { pos: -1, end: -1 });
77332
+ ts.setSyntheticLeadingComments(initializerStatement, undefined);
77333
+ ts.setSyntheticTrailingComments(initializerStatement, undefined);
77334
+ return staticBlock;
77335
+ }
77336
+ }
77293
77337
  return undefined;
77294
77338
  }
77295
77339
  function createPrivateIdentifierAccess(info, receiver) {
@@ -77648,7 +77692,6 @@ var ts;
77648
77692
  if (facts & 8) {
77649
77693
  enableSubstitutionForClassStaticThisOrSuperReference();
77650
77694
  }
77651
- var staticProperties = ts.getStaticPropertiesAndClassStaticBlock(node);
77652
77695
  var pendingClassReferenceAssignment;
77653
77696
  if (facts & 2) {
77654
77697
  var temp = factory.createTempVariable(hoistVariableDeclaration, true);
@@ -77666,6 +77709,7 @@ var ts;
77666
77709
  if (ts.some(pendingExpressions)) {
77667
77710
  statements.push(factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions)));
77668
77711
  }
77712
+ var staticProperties = ts.getStaticPropertiesAndClassStaticBlock(node);
77669
77713
  if (ts.some(staticProperties)) {
77670
77714
  addPropertyOrClassStaticBlockStatements(statements, staticProperties, factory.getInternalName(node));
77671
77715
  }
@@ -77696,7 +77740,7 @@ var ts;
77696
77740
  getClassLexicalEnvironment().classConstructor = factory.cloneNode(temp);
77697
77741
  }
77698
77742
  var classExpression = factory.updateClassExpression(node, ts.visitNodes(node.decorators, visitor, ts.isDecorator), node.modifiers, node.name, undefined, ts.visitNodes(node.heritageClauses, heritageClauseVisitor, ts.isHeritageClause), transformClassMembers(node, isDerivedClass));
77699
- var hasTransformableStatics = ts.some(staticPropertiesOrClassStaticBlocks, function (p) { return ts.isClassStaticBlockDeclaration(p) || !!p.initializer || (shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifier(p.name)); });
77743
+ var hasTransformableStatics = shouldTransformPrivateElementsOrClassStaticBlocks && ts.some(staticPropertiesOrClassStaticBlocks, function (p) { return ts.isClassStaticBlockDeclaration(p) || !!p.initializer || ts.isPrivateIdentifier(p.name); });
77700
77744
  if (hasTransformableStatics || ts.some(pendingExpressions)) {
77701
77745
  if (isDecoratedClassDeclaration) {
77702
77746
  ts.Debug.assertIsDefined(pendingStatements, "Decorated classes transformed by TypeScript are expected to be within a variable declaration.");
@@ -77737,6 +77781,7 @@ var ts;
77737
77781
  return undefined;
77738
77782
  }
77739
77783
  function transformClassMembers(node, isDerivedClass) {
77784
+ var members = [];
77740
77785
  if (shouldTransformPrivateElementsOrClassStaticBlocks) {
77741
77786
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
77742
77787
  var member = _a[_i];
@@ -77748,12 +77793,18 @@ var ts;
77748
77793
  createBrandCheckWeakSetForPrivateMethods();
77749
77794
  }
77750
77795
  }
77751
- var members = [];
77752
77796
  var constructor = transformConstructor(node, isDerivedClass);
77797
+ var visitedMembers = ts.visitNodes(node.members, classElementVisitor, ts.isClassElement);
77753
77798
  if (constructor) {
77754
77799
  members.push(constructor);
77755
77800
  }
77756
- ts.addRange(members, ts.visitNodes(node.members, classElementVisitor, ts.isClassElement));
77801
+ if (!shouldTransformPrivateElementsOrClassStaticBlocks && ts.some(pendingExpressions)) {
77802
+ members.push(factory.createClassStaticBlockDeclaration(undefined, undefined, factory.createBlock([
77803
+ factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))
77804
+ ])));
77805
+ pendingExpressions = undefined;
77806
+ }
77807
+ ts.addRange(members, visitedMembers);
77757
77808
  return ts.setTextRange(factory.createNodeArray(members), node.members);
77758
77809
  }
77759
77810
  function createBrandCheckWeakSetForPrivateMethods() {
@@ -77858,21 +77909,31 @@ var ts;
77858
77909
  function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) {
77859
77910
  for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) {
77860
77911
  var property = properties_7[_i];
77861
- var expression = ts.isClassStaticBlockDeclaration(property) ?
77862
- transformClassStaticBlockDeclaration(property) :
77863
- transformProperty(property, receiver);
77864
- if (!expression) {
77912
+ if (ts.isStatic(property) && !shouldTransformPrivateElementsOrClassStaticBlocks && !useDefineForClassFields) {
77913
+ continue;
77914
+ }
77915
+ var statement = transformPropertyOrClassStaticBlock(property, receiver);
77916
+ if (!statement) {
77865
77917
  continue;
77866
77918
  }
77867
- var statement = factory.createExpressionStatement(expression);
77868
- ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));
77869
- ts.setCommentRange(statement, property);
77870
- ts.setOriginalNode(statement, property);
77871
- ts.setSyntheticLeadingComments(expression, undefined);
77872
- ts.setSyntheticTrailingComments(expression, undefined);
77873
77919
  statements.push(statement);
77874
77920
  }
77875
77921
  }
77922
+ function transformPropertyOrClassStaticBlock(property, receiver) {
77923
+ var expression = ts.isClassStaticBlockDeclaration(property) ?
77924
+ transformClassStaticBlockDeclaration(property) :
77925
+ transformProperty(property, receiver);
77926
+ if (!expression) {
77927
+ return undefined;
77928
+ }
77929
+ var statement = factory.createExpressionStatement(expression);
77930
+ ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));
77931
+ ts.setCommentRange(statement, property);
77932
+ ts.setOriginalNode(statement, property);
77933
+ ts.setSyntheticLeadingComments(expression, undefined);
77934
+ ts.setSyntheticTrailingComments(expression, undefined);
77935
+ return statement;
77936
+ }
77876
77937
  function generateInitializedPropertyExpressionsOrClassStaticBlock(propertiesOrClassStaticBlocks, receiver) {
77877
77938
  var expressions = [];
77878
77939
  for (var _i = 0, propertiesOrClassStaticBlocks_1 = propertiesOrClassStaticBlocks; _i < propertiesOrClassStaticBlocks_1.length; _i++) {
@@ -78891,6 +78952,7 @@ var ts;
78891
78952
  var exportedVariableStatement = false;
78892
78953
  var enabledSubstitutions;
78893
78954
  var enclosingFunctionFlags;
78955
+ var parametersWithPrecedingObjectRestOrSpread;
78894
78956
  var enclosingSuperContainerFlags = 0;
78895
78957
  var hierarchyFacts = 0;
78896
78958
  var currentSourceFile;
@@ -79271,6 +79333,7 @@ var ts;
79271
79333
  ts.setTextRange(factory.createVariableDeclaration(iterator, undefined, undefined, initializer), node.expression),
79272
79334
  factory.createVariableDeclaration(result)
79273
79335
  ]), node.expression), 2097152), factory.createComma(factory.createAssignment(result, createDownlevelAwait(callNext)), factory.createLogicalNot(getDone)), undefined, convertForOfStatementHead(node, getValue)), node), 256);
79336
+ ts.setOriginalNode(forStatement, node);
79274
79337
  return factory.createTryStatement(factory.createBlock([
79275
79338
  factory.restoreEnclosingLabel(forStatement, outermostLabeledStatement)
79276
79339
  ]), factory.createCatchClause(factory.createVariableDeclaration(catchVariable), ts.setEmitFlags(factory.createBlock([
@@ -79285,77 +79348,118 @@ var ts;
79285
79348
  ]), 1))
79286
79349
  ]));
79287
79350
  }
79351
+ function parameterVisitor(node) {
79352
+ ts.Debug.assertNode(node, ts.isParameter);
79353
+ return visitParameter(node);
79354
+ }
79288
79355
  function visitParameter(node) {
79356
+ if (parametersWithPrecedingObjectRestOrSpread === null || parametersWithPrecedingObjectRestOrSpread === void 0 ? void 0 : parametersWithPrecedingObjectRestOrSpread.has(node)) {
79357
+ return factory.updateParameterDeclaration(node, undefined, undefined, node.dotDotDotToken, ts.isBindingPattern(node.name) ? factory.getGeneratedNameForNode(node) : node.name, undefined, undefined, undefined);
79358
+ }
79289
79359
  if (node.transformFlags & 32768) {
79290
79360
  return factory.updateParameterDeclaration(node, undefined, undefined, node.dotDotDotToken, factory.getGeneratedNameForNode(node), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
79291
79361
  }
79292
79362
  return ts.visitEachChild(node, visitor, context);
79293
79363
  }
79364
+ function collectParametersWithPrecedingObjectRestOrSpread(node) {
79365
+ var parameters;
79366
+ for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
79367
+ var parameter = _a[_i];
79368
+ if (parameters) {
79369
+ parameters.add(parameter);
79370
+ }
79371
+ else if (parameter.transformFlags & 32768) {
79372
+ parameters = new ts.Set();
79373
+ }
79374
+ }
79375
+ return parameters;
79376
+ }
79294
79377
  function visitConstructorDeclaration(node) {
79295
79378
  var savedEnclosingFunctionFlags = enclosingFunctionFlags;
79296
- enclosingFunctionFlags = 0;
79297
- var updated = factory.updateConstructorDeclaration(node, undefined, node.modifiers, ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node));
79379
+ var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
79380
+ enclosingFunctionFlags = ts.getFunctionFlags(node);
79381
+ parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
79382
+ var updated = factory.updateConstructorDeclaration(node, undefined, node.modifiers, ts.visitParameterList(node.parameters, parameterVisitor, context), transformFunctionBody(node));
79298
79383
  enclosingFunctionFlags = savedEnclosingFunctionFlags;
79384
+ parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
79299
79385
  return updated;
79300
79386
  }
79301
79387
  function visitGetAccessorDeclaration(node) {
79302
79388
  var savedEnclosingFunctionFlags = enclosingFunctionFlags;
79303
- enclosingFunctionFlags = 0;
79304
- var updated = factory.updateGetAccessorDeclaration(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node));
79389
+ var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
79390
+ enclosingFunctionFlags = ts.getFunctionFlags(node);
79391
+ parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
79392
+ var updated = factory.updateGetAccessorDeclaration(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, transformFunctionBody(node));
79305
79393
  enclosingFunctionFlags = savedEnclosingFunctionFlags;
79394
+ parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
79306
79395
  return updated;
79307
79396
  }
79308
79397
  function visitSetAccessorDeclaration(node) {
79309
79398
  var savedEnclosingFunctionFlags = enclosingFunctionFlags;
79310
- enclosingFunctionFlags = 0;
79311
- var updated = factory.updateSetAccessorDeclaration(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node));
79399
+ var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
79400
+ enclosingFunctionFlags = ts.getFunctionFlags(node);
79401
+ parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
79402
+ var updated = factory.updateSetAccessorDeclaration(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, parameterVisitor, context), transformFunctionBody(node));
79312
79403
  enclosingFunctionFlags = savedEnclosingFunctionFlags;
79404
+ parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
79313
79405
  return updated;
79314
79406
  }
79315
79407
  function visitMethodDeclaration(node) {
79316
79408
  var savedEnclosingFunctionFlags = enclosingFunctionFlags;
79409
+ var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
79317
79410
  enclosingFunctionFlags = ts.getFunctionFlags(node);
79411
+ parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
79318
79412
  var updated = factory.updateMethodDeclaration(node, undefined, enclosingFunctionFlags & 1
79319
79413
  ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)
79320
79414
  : node.modifiers, enclosingFunctionFlags & 2
79321
79415
  ? undefined
79322
- : node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(undefined, visitor, ts.isToken), undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1
79416
+ : node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(undefined, visitor, ts.isToken), undefined, ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1
79323
79417
  ? transformAsyncGeneratorFunctionBody(node)
79324
79418
  : transformFunctionBody(node));
79325
79419
  enclosingFunctionFlags = savedEnclosingFunctionFlags;
79420
+ parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
79326
79421
  return updated;
79327
79422
  }
79328
79423
  function visitFunctionDeclaration(node) {
79329
79424
  var savedEnclosingFunctionFlags = enclosingFunctionFlags;
79425
+ var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
79330
79426
  enclosingFunctionFlags = ts.getFunctionFlags(node);
79427
+ parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
79331
79428
  var updated = factory.updateFunctionDeclaration(node, undefined, enclosingFunctionFlags & 1
79332
79429
  ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)
79333
79430
  : node.modifiers, enclosingFunctionFlags & 2
79334
79431
  ? undefined
79335
- : node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1
79432
+ : node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1
79336
79433
  ? transformAsyncGeneratorFunctionBody(node)
79337
79434
  : transformFunctionBody(node));
79338
79435
  enclosingFunctionFlags = savedEnclosingFunctionFlags;
79436
+ parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
79339
79437
  return updated;
79340
79438
  }
79341
79439
  function visitArrowFunction(node) {
79342
79440
  var savedEnclosingFunctionFlags = enclosingFunctionFlags;
79441
+ var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
79343
79442
  enclosingFunctionFlags = ts.getFunctionFlags(node);
79344
- var updated = factory.updateArrowFunction(node, node.modifiers, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, node.equalsGreaterThanToken, transformFunctionBody(node));
79443
+ parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
79444
+ var updated = factory.updateArrowFunction(node, node.modifiers, undefined, ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, node.equalsGreaterThanToken, transformFunctionBody(node));
79345
79445
  enclosingFunctionFlags = savedEnclosingFunctionFlags;
79446
+ parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
79346
79447
  return updated;
79347
79448
  }
79348
79449
  function visitFunctionExpression(node) {
79349
79450
  var savedEnclosingFunctionFlags = enclosingFunctionFlags;
79451
+ var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
79350
79452
  enclosingFunctionFlags = ts.getFunctionFlags(node);
79453
+ parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
79351
79454
  var updated = factory.updateFunctionExpression(node, enclosingFunctionFlags & 1
79352
79455
  ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)
79353
79456
  : node.modifiers, enclosingFunctionFlags & 2
79354
79457
  ? undefined
79355
- : node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1
79458
+ : node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1
79356
79459
  ? transformAsyncGeneratorFunctionBody(node)
79357
79460
  : transformFunctionBody(node));
79358
79461
  enclosingFunctionFlags = savedEnclosingFunctionFlags;
79462
+ parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
79359
79463
  return updated;
79360
79464
  }
79361
79465
  function transformAsyncGeneratorFunctionBody(node) {
@@ -79410,13 +79514,55 @@ var ts;
79410
79514
  return body;
79411
79515
  }
79412
79516
  function appendObjectRestAssignmentsIfNeeded(statements, node) {
79517
+ var containsPrecedingObjectRestOrSpread = false;
79413
79518
  for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
79414
79519
  var parameter = _a[_i];
79415
- if (parameter.transformFlags & 32768) {
79416
- var temp = factory.getGeneratedNameForNode(parameter);
79417
- var declarations = ts.flattenDestructuringBinding(parameter, visitor, context, 1, temp, false, true);
79520
+ if (containsPrecedingObjectRestOrSpread) {
79521
+ if (ts.isBindingPattern(parameter.name)) {
79522
+ if (parameter.name.elements.length > 0) {
79523
+ var declarations = ts.flattenDestructuringBinding(parameter, visitor, context, 0, factory.getGeneratedNameForNode(parameter));
79524
+ if (ts.some(declarations)) {
79525
+ var declarationList = factory.createVariableDeclarationList(declarations);
79526
+ var statement = factory.createVariableStatement(undefined, declarationList);
79527
+ ts.setEmitFlags(statement, 1048576);
79528
+ statements = ts.append(statements, statement);
79529
+ }
79530
+ }
79531
+ else if (parameter.initializer) {
79532
+ var name = factory.getGeneratedNameForNode(parameter);
79533
+ var initializer = ts.visitNode(parameter.initializer, visitor, ts.isExpression);
79534
+ var assignment = factory.createAssignment(name, initializer);
79535
+ var statement = factory.createExpressionStatement(assignment);
79536
+ ts.setEmitFlags(statement, 1048576);
79537
+ statements = ts.append(statements, statement);
79538
+ }
79539
+ }
79540
+ else if (parameter.initializer) {
79541
+ var name = factory.cloneNode(parameter.name);
79542
+ ts.setTextRange(name, parameter.name);
79543
+ ts.setEmitFlags(name, 48);
79544
+ var initializer = ts.visitNode(parameter.initializer, visitor, ts.isExpression);
79545
+ ts.addEmitFlags(initializer, 48 | 1536);
79546
+ var assignment = factory.createAssignment(name, initializer);
79547
+ ts.setTextRange(assignment, parameter);
79548
+ ts.setEmitFlags(assignment, 1536);
79549
+ var block = factory.createBlock([factory.createExpressionStatement(assignment)]);
79550
+ ts.setTextRange(block, parameter);
79551
+ ts.setEmitFlags(block, 1 | 32 | 384 | 1536);
79552
+ var typeCheck = factory.createTypeCheck(factory.cloneNode(parameter.name), "undefined");
79553
+ var statement = factory.createIfStatement(typeCheck, block);
79554
+ ts.startOnNewLine(statement);
79555
+ ts.setTextRange(statement, parameter);
79556
+ ts.setEmitFlags(statement, 384 | 32 | 1048576 | 1536);
79557
+ statements = ts.append(statements, statement);
79558
+ }
79559
+ }
79560
+ else if (parameter.transformFlags & 32768) {
79561
+ containsPrecedingObjectRestOrSpread = true;
79562
+ var declarations = ts.flattenDestructuringBinding(parameter, visitor, context, 1, factory.getGeneratedNameForNode(parameter), false, true);
79418
79563
  if (ts.some(declarations)) {
79419
- var statement = factory.createVariableStatement(undefined, factory.createVariableDeclarationList(declarations));
79564
+ var declarationList = factory.createVariableDeclarationList(declarations);
79565
+ var statement = factory.createVariableStatement(undefined, declarationList);
79420
79566
  ts.setEmitFlags(statement, 1048576);
79421
79567
  statements = ts.append(statements, statement);
79422
79568
  }
@@ -81824,10 +81970,12 @@ var ts;
81824
81970
  var loopParameters = [];
81825
81971
  var loopOutParameters = [];
81826
81972
  if (loopInitializer && (ts.getCombinedNodeFlags(loopInitializer) & 3)) {
81827
- var hasCapturedBindingsInForInitializer = shouldConvertInitializerOfForStatement(node);
81973
+ var hasCapturedBindingsInForHead = shouldConvertInitializerOfForStatement(node) ||
81974
+ shouldConvertConditionOfForStatement(node) ||
81975
+ shouldConvertIncrementorOfForStatement(node);
81828
81976
  for (var _i = 0, _a = loopInitializer.declarations; _i < _a.length; _i++) {
81829
81977
  var decl = _a[_i];
81830
- processLoopVariableDeclaration(node, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForInitializer);
81978
+ processLoopVariableDeclaration(node, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForHead);
81831
81979
  }
81832
81980
  }
81833
81981
  var currentState = { loopParameters: loopParameters, loopOutParameters: loopOutParameters };
@@ -82048,27 +82196,33 @@ var ts;
82048
82196
  caseClauses.push(factory.createCaseClause(factory.createStringLiteral(labelMarker), statements));
82049
82197
  });
82050
82198
  }
82051
- function processLoopVariableDeclaration(container, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForInitializer) {
82199
+ function processLoopVariableDeclaration(container, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForHead) {
82052
82200
  var name = decl.name;
82053
82201
  if (ts.isBindingPattern(name)) {
82054
82202
  for (var _i = 0, _a = name.elements; _i < _a.length; _i++) {
82055
82203
  var element = _a[_i];
82056
82204
  if (!ts.isOmittedExpression(element)) {
82057
- processLoopVariableDeclaration(container, element, loopParameters, loopOutParameters, hasCapturedBindingsInForInitializer);
82205
+ processLoopVariableDeclaration(container, element, loopParameters, loopOutParameters, hasCapturedBindingsInForHead);
82058
82206
  }
82059
82207
  }
82060
82208
  }
82061
82209
  else {
82062
82210
  loopParameters.push(factory.createParameterDeclaration(undefined, undefined, undefined, name));
82063
82211
  var checkFlags = resolver.getNodeCheckFlags(decl);
82064
- if (checkFlags & 4194304 || hasCapturedBindingsInForInitializer) {
82212
+ if (checkFlags & 4194304 || hasCapturedBindingsInForHead) {
82065
82213
  var outParamName = factory.createUniqueName("out_" + ts.idText(name));
82066
82214
  var flags = 0;
82067
82215
  if (checkFlags & 4194304) {
82068
82216
  flags |= 1;
82069
82217
  }
82070
- if (ts.isForStatement(container) && container.initializer && resolver.isBindingCapturedByNode(container.initializer, decl)) {
82071
- flags |= 2;
82218
+ if (ts.isForStatement(container)) {
82219
+ if (container.initializer && resolver.isBindingCapturedByNode(container.initializer, decl)) {
82220
+ flags |= 2;
82221
+ }
82222
+ if (container.condition && resolver.isBindingCapturedByNode(container.condition, decl) ||
82223
+ container.incrementor && resolver.isBindingCapturedByNode(container.incrementor, decl)) {
82224
+ flags |= 1;
82225
+ }
82072
82226
  }
82073
82227
  loopOutParameters.push({ flags: flags, originalName: name, outParamName: outParamName });
82074
82228
  }
@@ -99268,7 +99422,7 @@ var ts;
99268
99422
  if (!host.fileExists || !host.readFile) {
99269
99423
  return undefined;
99270
99424
  }
99271
- var parts = getNodeModulePathParts(path);
99425
+ var parts = ts.getNodeModulePathParts(path);
99272
99426
  if (!parts) {
99273
99427
  return undefined;
99274
99428
  }
@@ -99375,48 +99529,6 @@ var ts;
99375
99529
  }
99376
99530
  }
99377
99531
  }
99378
- function getNodeModulePathParts(fullPath) {
99379
- var topLevelNodeModulesIndex = 0;
99380
- var topLevelPackageNameIndex = 0;
99381
- var packageRootIndex = 0;
99382
- var fileNameIndex = 0;
99383
- var partStart = 0;
99384
- var partEnd = 0;
99385
- var state = 0;
99386
- while (partEnd >= 0) {
99387
- partStart = partEnd;
99388
- partEnd = fullPath.indexOf("/", partStart + 1);
99389
- switch (state) {
99390
- case 0:
99391
- if (fullPath.indexOf(ts.nodeModulesPathPart, partStart) === partStart) {
99392
- topLevelNodeModulesIndex = partStart;
99393
- topLevelPackageNameIndex = partEnd;
99394
- state = 1;
99395
- }
99396
- break;
99397
- case 1:
99398
- case 2:
99399
- if (state === 1 && fullPath.charAt(partStart + 1) === "@") {
99400
- state = 2;
99401
- }
99402
- else {
99403
- packageRootIndex = partEnd;
99404
- state = 3;
99405
- }
99406
- break;
99407
- case 3:
99408
- if (fullPath.indexOf(ts.nodeModulesPathPart, partStart) === partStart) {
99409
- state = 1;
99410
- }
99411
- else {
99412
- state = 3;
99413
- }
99414
- break;
99415
- }
99416
- }
99417
- fileNameIndex = partStart;
99418
- return state > 1 ? { topLevelNodeModulesIndex: topLevelNodeModulesIndex, topLevelPackageNameIndex: topLevelPackageNameIndex, packageRootIndex: packageRootIndex, fileNameIndex: fileNameIndex } : undefined;
99419
- }
99420
99532
  function getPathRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {
99421
99533
  return ts.firstDefined(rootDirs, function (rootDir) {
99422
99534
  var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName);