typescript 4.6.0-dev.20220201 → 4.6.0-dev.20220205

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-dev.20220201";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20220205";
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 };
@@ -5895,12 +5895,10 @@ var ts;
5895
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."),
5896
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."),
5897
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."),
5898
- 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."),
5899
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."),
5900
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}'."),
5901
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"),
5902
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."),
5903
- 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'."),
5904
5902
  Initializer_for_property_0: diag(2811, ts.DiagnosticCategory.Error, "Initializer_for_property_0_2811", "Initializer for property '{0}'"),
5905
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'."),
5906
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}'."),
@@ -6851,6 +6849,7 @@ var ts;
6851
6849
  Add_missing_attributes: diag(95167, ts.DiagnosticCategory.Message, "Add_missing_attributes_95167", "Add missing attributes"),
6852
6850
  Add_all_missing_attributes: diag(95168, ts.DiagnosticCategory.Message, "Add_all_missing_attributes_95168", "Add all missing attributes"),
6853
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"),
6854
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."),
6855
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'."),
6856
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?"),
@@ -9583,11 +9582,17 @@ var ts;
9583
9582
  ts.getAllJSDocTagsOfKind = getAllJSDocTagsOfKind;
9584
9583
  function getTextOfJSDocComment(comment) {
9585
9584
  return typeof comment === "string" ? comment
9586
- : comment === null || comment === void 0 ? void 0 : comment.map(function (c) {
9587
- return c.kind === 319 ? c.text : "{@link " + (c.name ? ts.entityNameToString(c.name) + " " : "") + c.text + "}";
9588
- }).join("");
9585
+ : comment === null || comment === void 0 ? void 0 : comment.map(function (c) { return c.kind === 319 ? c.text : formatJSDocLink(c); }).join("");
9589
9586
  }
9590
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
+ }
9591
9596
  function getEffectiveTypeParameterDeclarations(node) {
9592
9597
  if (ts.isJSDocSignature(node)) {
9593
9598
  return ts.emptyArray;
@@ -56725,7 +56730,10 @@ var ts;
56725
56730
  (type === falseType || type === regularFalseType) ? 12121864 : 7927560 :
56726
56731
  (type === falseType || type === regularFalseType) ? 12580616 : 16774920;
56727
56732
  }
56728
- if (flags & 524288 && !ignoreObjects) {
56733
+ if (flags & 524288) {
56734
+ if (ignoreObjects) {
56735
+ return 16768959;
56736
+ }
56729
56737
  return ts.getObjectFlags(type) & 16 && isEmptyObjectType(type) ?
56730
56738
  strictNullChecks ? 16318463 : 16777215 :
56731
56739
  isFunctionObjectType(type) ?
@@ -56769,7 +56777,7 @@ var ts;
56769
56777
  oredFacts |= f;
56770
56778
  andedFacts &= f;
56771
56779
  }
56772
- return oredFacts & 8288 | andedFacts & 16768927;
56780
+ return oredFacts & 8256 | andedFacts & 16768959;
56773
56781
  }
56774
56782
  function getTypeWithFacts(type, include) {
56775
56783
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
@@ -58448,6 +58456,9 @@ var ts;
58448
58456
  return getTypeOfSymbol(symbol);
58449
58457
  }
58450
58458
  function checkIdentifier(node, checkMode) {
58459
+ if (ts.isThisInTypeQuery(node)) {
58460
+ return checkThisExpression(node);
58461
+ }
58451
58462
  var symbol = getResolvedSymbol(node);
58452
58463
  if (symbol === unknownSymbol) {
58453
58464
  return errorType;
@@ -59944,7 +59955,8 @@ var ts;
59944
59955
  var links = getNodeLinks(node.expression);
59945
59956
  if (!links.resolvedType) {
59946
59957
  if ((ts.isTypeLiteralNode(node.parent.parent) || ts.isClassLike(node.parent.parent) || ts.isInterfaceDeclaration(node.parent.parent))
59947
- && ts.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 101) {
59958
+ && ts.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 101
59959
+ && node.parent.kind !== 171 && node.parent.kind !== 172) {
59948
59960
  return links.resolvedType = errorType;
59949
59961
  }
59950
59962
  links.resolvedType = checkExpression(node.expression);
@@ -60925,23 +60937,6 @@ var ts;
60925
60937
  if (assignmentKind && lexicallyScopedSymbol && lexicallyScopedSymbol.valueDeclaration && ts.isMethodDeclaration(lexicallyScopedSymbol.valueDeclaration)) {
60926
60938
  grammarErrorOnNode(right, ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable, ts.idText(right));
60927
60939
  }
60928
- if ((lexicallyScopedSymbol === null || lexicallyScopedSymbol === void 0 ? void 0 : lexicallyScopedSymbol.valueDeclaration) && (ts.getEmitScriptTarget(compilerOptions) === 99 && !useDefineForClassFields)) {
60929
- var lexicalClass_1 = ts.getContainingClass(lexicallyScopedSymbol.valueDeclaration);
60930
- var parentStaticFieldInitializer = ts.findAncestor(node, function (n) {
60931
- if (n === lexicalClass_1)
60932
- return "quit";
60933
- if (ts.isPropertyDeclaration(n.parent) && ts.hasStaticModifier(n.parent) && n.parent.initializer === n && n.parent.parent === lexicalClass_1) {
60934
- return true;
60935
- }
60936
- return false;
60937
- });
60938
- if (parentStaticFieldInitializer) {
60939
- var parentStaticFieldInitializerSymbol = getSymbolOfNode(parentStaticFieldInitializer.parent);
60940
- ts.Debug.assert(parentStaticFieldInitializerSymbol, "Initializer without declaration symbol");
60941
- 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));
60942
- ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(parentStaticFieldInitializer.parent, ts.Diagnostics.Initializer_for_property_0, ts.symbolName(parentStaticFieldInitializerSymbol)));
60943
- }
60944
- }
60945
60940
  if (isAnyLike) {
60946
60941
  if (lexicallyScopedSymbol) {
60947
60942
  return isErrorType(apparentType) ? errorType : apparentType;
@@ -63318,6 +63313,10 @@ var ts;
63318
63313
  return restParameter.escapedName;
63319
63314
  }
63320
63315
  function getParameterIdentifierNameAtPosition(signature, pos) {
63316
+ var _a;
63317
+ if (((_a = signature.declaration) === null || _a === void 0 ? void 0 : _a.kind) === 315) {
63318
+ return undefined;
63319
+ }
63321
63320
  var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
63322
63321
  if (pos < paramCount) {
63323
63322
  var param = signature.parameters[pos];
@@ -65864,9 +65863,6 @@ var ts;
65864
65863
  checkGrammarComputedPropertyName(node.name);
65865
65864
  checkVariableLikeDeclaration(node);
65866
65865
  setNodeLinksForPrivateIdentifierScope(node);
65867
- if (ts.isPrivateIdentifier(node.name) && ts.hasStaticModifier(node) && node.initializer && languageVersion === 99 && !compilerOptions.useDefineForClassFields) {
65868
- 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);
65869
- }
65870
65866
  if (ts.hasSyntacticModifier(node, 128) && node.kind === 166 && node.initializer) {
65871
65867
  error(node, ts.Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, ts.declarationNameToString(node.name));
65872
65868
  }
@@ -70864,7 +70860,9 @@ var ts;
70864
70860
  case 80:
70865
70861
  case 205:
70866
70862
  case 160:
70867
- return getSymbolOfNameOrPropertyAccessExpression(node);
70863
+ if (!ts.isThisInTypeQuery(node)) {
70864
+ return getSymbolOfNameOrPropertyAccessExpression(node);
70865
+ }
70868
70866
  case 108:
70869
70867
  var container = ts.getThisContainer(node, false);
70870
70868
  if (ts.isFunctionLike(container)) {
@@ -77035,8 +77033,8 @@ var ts;
77035
77033
  var languageVersion = ts.getEmitScriptTarget(compilerOptions);
77036
77034
  var useDefineForClassFields = ts.getUseDefineForClassFields(compilerOptions);
77037
77035
  var shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9;
77038
- var shouldTransformSuperInStaticInitializers = (languageVersion <= 8 || !useDefineForClassFields) && languageVersion >= 2;
77039
- var shouldTransformThisInStaticInitializers = languageVersion <= 8 || !useDefineForClassFields;
77036
+ var shouldTransformThisInStaticInitializers = languageVersion < 9;
77037
+ var shouldTransformSuperInStaticInitializers = shouldTransformThisInStaticInitializers && languageVersion >= 2;
77040
77038
  var previousOnSubstituteNode = context.onSubstituteNode;
77041
77039
  context.onSubstituteNode = onSubstituteNode;
77042
77040
  var previousOnEmitNode = context.onEmitNode;
@@ -77236,6 +77234,9 @@ var ts;
77236
77234
  ts.Debug.assert(!ts.some(node.decorators));
77237
77235
  if (ts.isPrivateIdentifier(node.name)) {
77238
77236
  if (!shouldTransformPrivateElementsOrClassStaticBlocks) {
77237
+ if (ts.isStatic(node)) {
77238
+ return ts.visitEachChild(node, visitor, context);
77239
+ }
77239
77240
  return factory.updatePropertyDeclaration(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, undefined, undefined, undefined);
77240
77241
  }
77241
77242
  var info = accessPrivateIdentifier(node.name);
@@ -77248,6 +77249,18 @@ var ts;
77248
77249
  if (expr && !ts.isSimpleInlineableExpression(expr)) {
77249
77250
  getPendingExpressions().push(expr);
77250
77251
  }
77252
+ if (ts.isStatic(node) && !shouldTransformPrivateElementsOrClassStaticBlocks && !useDefineForClassFields) {
77253
+ var initializerStatement = transformPropertyOrClassStaticBlock(node, factory.createThis());
77254
+ if (initializerStatement) {
77255
+ var staticBlock = factory.createClassStaticBlockDeclaration(undefined, undefined, factory.createBlock([initializerStatement]));
77256
+ ts.setOriginalNode(staticBlock, node);
77257
+ ts.setCommentRange(staticBlock, node);
77258
+ ts.setCommentRange(initializerStatement, { pos: -1, end: -1 });
77259
+ ts.setSyntheticLeadingComments(initializerStatement, undefined);
77260
+ ts.setSyntheticTrailingComments(initializerStatement, undefined);
77261
+ return staticBlock;
77262
+ }
77263
+ }
77251
77264
  return undefined;
77252
77265
  }
77253
77266
  function createPrivateIdentifierAccess(info, receiver) {
@@ -77606,7 +77619,6 @@ var ts;
77606
77619
  if (facts & 8) {
77607
77620
  enableSubstitutionForClassStaticThisOrSuperReference();
77608
77621
  }
77609
- var staticProperties = ts.getStaticPropertiesAndClassStaticBlock(node);
77610
77622
  var pendingClassReferenceAssignment;
77611
77623
  if (facts & 2) {
77612
77624
  var temp = factory.createTempVariable(hoistVariableDeclaration, true);
@@ -77624,6 +77636,7 @@ var ts;
77624
77636
  if (ts.some(pendingExpressions)) {
77625
77637
  statements.push(factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions)));
77626
77638
  }
77639
+ var staticProperties = ts.getStaticPropertiesAndClassStaticBlock(node);
77627
77640
  if (ts.some(staticProperties)) {
77628
77641
  addPropertyOrClassStaticBlockStatements(statements, staticProperties, factory.getInternalName(node));
77629
77642
  }
@@ -77654,7 +77667,7 @@ var ts;
77654
77667
  getClassLexicalEnvironment().classConstructor = factory.cloneNode(temp);
77655
77668
  }
77656
77669
  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));
77657
- var hasTransformableStatics = ts.some(staticPropertiesOrClassStaticBlocks, function (p) { return ts.isClassStaticBlockDeclaration(p) || !!p.initializer || (shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifier(p.name)); });
77670
+ var hasTransformableStatics = shouldTransformPrivateElementsOrClassStaticBlocks && ts.some(staticPropertiesOrClassStaticBlocks, function (p) { return ts.isClassStaticBlockDeclaration(p) || !!p.initializer || ts.isPrivateIdentifier(p.name); });
77658
77671
  if (hasTransformableStatics || ts.some(pendingExpressions)) {
77659
77672
  if (isDecoratedClassDeclaration) {
77660
77673
  ts.Debug.assertIsDefined(pendingStatements, "Decorated classes transformed by TypeScript are expected to be within a variable declaration.");
@@ -77695,6 +77708,7 @@ var ts;
77695
77708
  return undefined;
77696
77709
  }
77697
77710
  function transformClassMembers(node, isDerivedClass) {
77711
+ var members = [];
77698
77712
  if (shouldTransformPrivateElementsOrClassStaticBlocks) {
77699
77713
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
77700
77714
  var member = _a[_i];
@@ -77706,12 +77720,18 @@ var ts;
77706
77720
  createBrandCheckWeakSetForPrivateMethods();
77707
77721
  }
77708
77722
  }
77709
- var members = [];
77710
77723
  var constructor = transformConstructor(node, isDerivedClass);
77724
+ var visitedMembers = ts.visitNodes(node.members, classElementVisitor, ts.isClassElement);
77711
77725
  if (constructor) {
77712
77726
  members.push(constructor);
77713
77727
  }
77714
- ts.addRange(members, ts.visitNodes(node.members, classElementVisitor, ts.isClassElement));
77728
+ if (!shouldTransformPrivateElementsOrClassStaticBlocks && ts.some(pendingExpressions)) {
77729
+ members.push(factory.createClassStaticBlockDeclaration(undefined, undefined, factory.createBlock([
77730
+ factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))
77731
+ ])));
77732
+ pendingExpressions = undefined;
77733
+ }
77734
+ ts.addRange(members, visitedMembers);
77715
77735
  return ts.setTextRange(factory.createNodeArray(members), node.members);
77716
77736
  }
77717
77737
  function createBrandCheckWeakSetForPrivateMethods() {
@@ -77816,21 +77836,31 @@ var ts;
77816
77836
  function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) {
77817
77837
  for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) {
77818
77838
  var property = properties_7[_i];
77819
- var expression = ts.isClassStaticBlockDeclaration(property) ?
77820
- transformClassStaticBlockDeclaration(property) :
77821
- transformProperty(property, receiver);
77822
- if (!expression) {
77839
+ if (ts.isStatic(property) && !shouldTransformPrivateElementsOrClassStaticBlocks && !useDefineForClassFields) {
77840
+ continue;
77841
+ }
77842
+ var statement = transformPropertyOrClassStaticBlock(property, receiver);
77843
+ if (!statement) {
77823
77844
  continue;
77824
77845
  }
77825
- var statement = factory.createExpressionStatement(expression);
77826
- ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));
77827
- ts.setCommentRange(statement, property);
77828
- ts.setOriginalNode(statement, property);
77829
- ts.setSyntheticLeadingComments(expression, undefined);
77830
- ts.setSyntheticTrailingComments(expression, undefined);
77831
77846
  statements.push(statement);
77832
77847
  }
77833
77848
  }
77849
+ function transformPropertyOrClassStaticBlock(property, receiver) {
77850
+ var expression = ts.isClassStaticBlockDeclaration(property) ?
77851
+ transformClassStaticBlockDeclaration(property) :
77852
+ transformProperty(property, receiver);
77853
+ if (!expression) {
77854
+ return undefined;
77855
+ }
77856
+ var statement = factory.createExpressionStatement(expression);
77857
+ ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));
77858
+ ts.setCommentRange(statement, property);
77859
+ ts.setOriginalNode(statement, property);
77860
+ ts.setSyntheticLeadingComments(expression, undefined);
77861
+ ts.setSyntheticTrailingComments(expression, undefined);
77862
+ return statement;
77863
+ }
77834
77864
  function generateInitializedPropertyExpressionsOrClassStaticBlock(propertiesOrClassStaticBlocks, receiver) {
77835
77865
  var expressions = [];
77836
77866
  for (var _i = 0, propertiesOrClassStaticBlocks_1 = propertiesOrClassStaticBlocks; _i < propertiesOrClassStaticBlocks_1.length; _i++) {
@@ -78849,6 +78879,7 @@ var ts;
78849
78879
  var exportedVariableStatement = false;
78850
78880
  var enabledSubstitutions;
78851
78881
  var enclosingFunctionFlags;
78882
+ var parametersWithPrecedingObjectRestOrSpread;
78852
78883
  var enclosingSuperContainerFlags = 0;
78853
78884
  var hierarchyFacts = 0;
78854
78885
  var currentSourceFile;
@@ -79229,6 +79260,7 @@ var ts;
79229
79260
  ts.setTextRange(factory.createVariableDeclaration(iterator, undefined, undefined, initializer), node.expression),
79230
79261
  factory.createVariableDeclaration(result)
79231
79262
  ]), node.expression), 2097152), factory.createComma(factory.createAssignment(result, createDownlevelAwait(callNext)), factory.createLogicalNot(getDone)), undefined, convertForOfStatementHead(node, getValue)), node), 256);
79263
+ ts.setOriginalNode(forStatement, node);
79232
79264
  return factory.createTryStatement(factory.createBlock([
79233
79265
  factory.restoreEnclosingLabel(forStatement, outermostLabeledStatement)
79234
79266
  ]), factory.createCatchClause(factory.createVariableDeclaration(catchVariable), ts.setEmitFlags(factory.createBlock([
@@ -79243,77 +79275,118 @@ var ts;
79243
79275
  ]), 1))
79244
79276
  ]));
79245
79277
  }
79278
+ function parameterVisitor(node) {
79279
+ ts.Debug.assertNode(node, ts.isParameter);
79280
+ return visitParameter(node);
79281
+ }
79246
79282
  function visitParameter(node) {
79283
+ if (parametersWithPrecedingObjectRestOrSpread === null || parametersWithPrecedingObjectRestOrSpread === void 0 ? void 0 : parametersWithPrecedingObjectRestOrSpread.has(node)) {
79284
+ return factory.updateParameterDeclaration(node, undefined, undefined, node.dotDotDotToken, ts.isBindingPattern(node.name) ? factory.getGeneratedNameForNode(node) : node.name, undefined, undefined, undefined);
79285
+ }
79247
79286
  if (node.transformFlags & 32768) {
79248
79287
  return factory.updateParameterDeclaration(node, undefined, undefined, node.dotDotDotToken, factory.getGeneratedNameForNode(node), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
79249
79288
  }
79250
79289
  return ts.visitEachChild(node, visitor, context);
79251
79290
  }
79291
+ function collectParametersWithPrecedingObjectRestOrSpread(node) {
79292
+ var parameters;
79293
+ for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
79294
+ var parameter = _a[_i];
79295
+ if (parameters) {
79296
+ parameters.add(parameter);
79297
+ }
79298
+ else if (parameter.transformFlags & 32768) {
79299
+ parameters = new ts.Set();
79300
+ }
79301
+ }
79302
+ return parameters;
79303
+ }
79252
79304
  function visitConstructorDeclaration(node) {
79253
79305
  var savedEnclosingFunctionFlags = enclosingFunctionFlags;
79254
- enclosingFunctionFlags = 0;
79255
- var updated = factory.updateConstructorDeclaration(node, undefined, node.modifiers, ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node));
79306
+ var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
79307
+ enclosingFunctionFlags = ts.getFunctionFlags(node);
79308
+ parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
79309
+ var updated = factory.updateConstructorDeclaration(node, undefined, node.modifiers, ts.visitParameterList(node.parameters, parameterVisitor, context), transformFunctionBody(node));
79256
79310
  enclosingFunctionFlags = savedEnclosingFunctionFlags;
79311
+ parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
79257
79312
  return updated;
79258
79313
  }
79259
79314
  function visitGetAccessorDeclaration(node) {
79260
79315
  var savedEnclosingFunctionFlags = enclosingFunctionFlags;
79261
- enclosingFunctionFlags = 0;
79262
- var updated = factory.updateGetAccessorDeclaration(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), undefined, transformFunctionBody(node));
79316
+ var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
79317
+ enclosingFunctionFlags = ts.getFunctionFlags(node);
79318
+ parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
79319
+ var updated = factory.updateGetAccessorDeclaration(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, transformFunctionBody(node));
79263
79320
  enclosingFunctionFlags = savedEnclosingFunctionFlags;
79321
+ parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
79264
79322
  return updated;
79265
79323
  }
79266
79324
  function visitSetAccessorDeclaration(node) {
79267
79325
  var savedEnclosingFunctionFlags = enclosingFunctionFlags;
79268
- enclosingFunctionFlags = 0;
79269
- var updated = factory.updateSetAccessorDeclaration(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, visitor, context), transformFunctionBody(node));
79326
+ var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
79327
+ enclosingFunctionFlags = ts.getFunctionFlags(node);
79328
+ parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
79329
+ var updated = factory.updateSetAccessorDeclaration(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, parameterVisitor, context), transformFunctionBody(node));
79270
79330
  enclosingFunctionFlags = savedEnclosingFunctionFlags;
79331
+ parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
79271
79332
  return updated;
79272
79333
  }
79273
79334
  function visitMethodDeclaration(node) {
79274
79335
  var savedEnclosingFunctionFlags = enclosingFunctionFlags;
79336
+ var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
79275
79337
  enclosingFunctionFlags = ts.getFunctionFlags(node);
79338
+ parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
79276
79339
  var updated = factory.updateMethodDeclaration(node, undefined, enclosingFunctionFlags & 1
79277
79340
  ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)
79278
79341
  : node.modifiers, enclosingFunctionFlags & 2
79279
79342
  ? undefined
79280
- : 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
79343
+ : 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
79281
79344
  ? transformAsyncGeneratorFunctionBody(node)
79282
79345
  : transformFunctionBody(node));
79283
79346
  enclosingFunctionFlags = savedEnclosingFunctionFlags;
79347
+ parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
79284
79348
  return updated;
79285
79349
  }
79286
79350
  function visitFunctionDeclaration(node) {
79287
79351
  var savedEnclosingFunctionFlags = enclosingFunctionFlags;
79352
+ var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
79288
79353
  enclosingFunctionFlags = ts.getFunctionFlags(node);
79354
+ parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
79289
79355
  var updated = factory.updateFunctionDeclaration(node, undefined, enclosingFunctionFlags & 1
79290
79356
  ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)
79291
79357
  : node.modifiers, enclosingFunctionFlags & 2
79292
79358
  ? undefined
79293
- : node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1
79359
+ : node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1
79294
79360
  ? transformAsyncGeneratorFunctionBody(node)
79295
79361
  : transformFunctionBody(node));
79296
79362
  enclosingFunctionFlags = savedEnclosingFunctionFlags;
79363
+ parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
79297
79364
  return updated;
79298
79365
  }
79299
79366
  function visitArrowFunction(node) {
79300
79367
  var savedEnclosingFunctionFlags = enclosingFunctionFlags;
79368
+ var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
79301
79369
  enclosingFunctionFlags = ts.getFunctionFlags(node);
79302
- var updated = factory.updateArrowFunction(node, node.modifiers, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, node.equalsGreaterThanToken, transformFunctionBody(node));
79370
+ parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
79371
+ var updated = factory.updateArrowFunction(node, node.modifiers, undefined, ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, node.equalsGreaterThanToken, transformFunctionBody(node));
79303
79372
  enclosingFunctionFlags = savedEnclosingFunctionFlags;
79373
+ parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
79304
79374
  return updated;
79305
79375
  }
79306
79376
  function visitFunctionExpression(node) {
79307
79377
  var savedEnclosingFunctionFlags = enclosingFunctionFlags;
79378
+ var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
79308
79379
  enclosingFunctionFlags = ts.getFunctionFlags(node);
79380
+ parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
79309
79381
  var updated = factory.updateFunctionExpression(node, enclosingFunctionFlags & 1
79310
79382
  ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)
79311
79383
  : node.modifiers, enclosingFunctionFlags & 2
79312
79384
  ? undefined
79313
- : node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1
79385
+ : node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1
79314
79386
  ? transformAsyncGeneratorFunctionBody(node)
79315
79387
  : transformFunctionBody(node));
79316
79388
  enclosingFunctionFlags = savedEnclosingFunctionFlags;
79389
+ parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
79317
79390
  return updated;
79318
79391
  }
79319
79392
  function transformAsyncGeneratorFunctionBody(node) {
@@ -79368,13 +79441,55 @@ var ts;
79368
79441
  return body;
79369
79442
  }
79370
79443
  function appendObjectRestAssignmentsIfNeeded(statements, node) {
79444
+ var containsPrecedingObjectRestOrSpread = false;
79371
79445
  for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
79372
79446
  var parameter = _a[_i];
79373
- if (parameter.transformFlags & 32768) {
79374
- var temp = factory.getGeneratedNameForNode(parameter);
79375
- var declarations = ts.flattenDestructuringBinding(parameter, visitor, context, 1, temp, false, true);
79447
+ if (containsPrecedingObjectRestOrSpread) {
79448
+ if (ts.isBindingPattern(parameter.name)) {
79449
+ if (parameter.name.elements.length > 0) {
79450
+ var declarations = ts.flattenDestructuringBinding(parameter, visitor, context, 0, factory.getGeneratedNameForNode(parameter));
79451
+ if (ts.some(declarations)) {
79452
+ var declarationList = factory.createVariableDeclarationList(declarations);
79453
+ var statement = factory.createVariableStatement(undefined, declarationList);
79454
+ ts.setEmitFlags(statement, 1048576);
79455
+ statements = ts.append(statements, statement);
79456
+ }
79457
+ }
79458
+ else if (parameter.initializer) {
79459
+ var name = factory.getGeneratedNameForNode(parameter);
79460
+ var initializer = ts.visitNode(parameter.initializer, visitor, ts.isExpression);
79461
+ var assignment = factory.createAssignment(name, initializer);
79462
+ var statement = factory.createExpressionStatement(assignment);
79463
+ ts.setEmitFlags(statement, 1048576);
79464
+ statements = ts.append(statements, statement);
79465
+ }
79466
+ }
79467
+ else if (parameter.initializer) {
79468
+ var name = factory.cloneNode(parameter.name);
79469
+ ts.setTextRange(name, parameter.name);
79470
+ ts.setEmitFlags(name, 48);
79471
+ var initializer = ts.visitNode(parameter.initializer, visitor, ts.isExpression);
79472
+ ts.addEmitFlags(initializer, 48 | 1536);
79473
+ var assignment = factory.createAssignment(name, initializer);
79474
+ ts.setTextRange(assignment, parameter);
79475
+ ts.setEmitFlags(assignment, 1536);
79476
+ var block = factory.createBlock([factory.createExpressionStatement(assignment)]);
79477
+ ts.setTextRange(block, parameter);
79478
+ ts.setEmitFlags(block, 1 | 32 | 384 | 1536);
79479
+ var typeCheck = factory.createTypeCheck(factory.cloneNode(parameter.name), "undefined");
79480
+ var statement = factory.createIfStatement(typeCheck, block);
79481
+ ts.startOnNewLine(statement);
79482
+ ts.setTextRange(statement, parameter);
79483
+ ts.setEmitFlags(statement, 384 | 32 | 1048576 | 1536);
79484
+ statements = ts.append(statements, statement);
79485
+ }
79486
+ }
79487
+ else if (parameter.transformFlags & 32768) {
79488
+ containsPrecedingObjectRestOrSpread = true;
79489
+ var declarations = ts.flattenDestructuringBinding(parameter, visitor, context, 1, factory.getGeneratedNameForNode(parameter), false, true);
79376
79490
  if (ts.some(declarations)) {
79377
- var statement = factory.createVariableStatement(undefined, factory.createVariableDeclarationList(declarations));
79491
+ var declarationList = factory.createVariableDeclarationList(declarations);
79492
+ var statement = factory.createVariableStatement(undefined, declarationList);
79378
79493
  ts.setEmitFlags(statement, 1048576);
79379
79494
  statements = ts.append(statements, statement);
79380
79495
  }
@@ -81782,10 +81897,12 @@ var ts;
81782
81897
  var loopParameters = [];
81783
81898
  var loopOutParameters = [];
81784
81899
  if (loopInitializer && (ts.getCombinedNodeFlags(loopInitializer) & 3)) {
81785
- var hasCapturedBindingsInForInitializer = shouldConvertInitializerOfForStatement(node);
81900
+ var hasCapturedBindingsInForHead = shouldConvertInitializerOfForStatement(node) ||
81901
+ shouldConvertConditionOfForStatement(node) ||
81902
+ shouldConvertIncrementorOfForStatement(node);
81786
81903
  for (var _i = 0, _a = loopInitializer.declarations; _i < _a.length; _i++) {
81787
81904
  var decl = _a[_i];
81788
- processLoopVariableDeclaration(node, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForInitializer);
81905
+ processLoopVariableDeclaration(node, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForHead);
81789
81906
  }
81790
81907
  }
81791
81908
  var currentState = { loopParameters: loopParameters, loopOutParameters: loopOutParameters };
@@ -82006,27 +82123,33 @@ var ts;
82006
82123
  caseClauses.push(factory.createCaseClause(factory.createStringLiteral(labelMarker), statements));
82007
82124
  });
82008
82125
  }
82009
- function processLoopVariableDeclaration(container, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForInitializer) {
82126
+ function processLoopVariableDeclaration(container, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForHead) {
82010
82127
  var name = decl.name;
82011
82128
  if (ts.isBindingPattern(name)) {
82012
82129
  for (var _i = 0, _a = name.elements; _i < _a.length; _i++) {
82013
82130
  var element = _a[_i];
82014
82131
  if (!ts.isOmittedExpression(element)) {
82015
- processLoopVariableDeclaration(container, element, loopParameters, loopOutParameters, hasCapturedBindingsInForInitializer);
82132
+ processLoopVariableDeclaration(container, element, loopParameters, loopOutParameters, hasCapturedBindingsInForHead);
82016
82133
  }
82017
82134
  }
82018
82135
  }
82019
82136
  else {
82020
82137
  loopParameters.push(factory.createParameterDeclaration(undefined, undefined, undefined, name));
82021
82138
  var checkFlags = resolver.getNodeCheckFlags(decl);
82022
- if (checkFlags & 4194304 || hasCapturedBindingsInForInitializer) {
82139
+ if (checkFlags & 4194304 || hasCapturedBindingsInForHead) {
82023
82140
  var outParamName = factory.createUniqueName("out_" + ts.idText(name));
82024
82141
  var flags = 0;
82025
82142
  if (checkFlags & 4194304) {
82026
82143
  flags |= 1;
82027
82144
  }
82028
- if (ts.isForStatement(container) && container.initializer && resolver.isBindingCapturedByNode(container.initializer, decl)) {
82029
- flags |= 2;
82145
+ if (ts.isForStatement(container)) {
82146
+ if (container.initializer && resolver.isBindingCapturedByNode(container.initializer, decl)) {
82147
+ flags |= 2;
82148
+ }
82149
+ if (container.condition && resolver.isBindingCapturedByNode(container.condition, decl) ||
82150
+ container.incrementor && resolver.isBindingCapturedByNode(container.incrementor, decl)) {
82151
+ flags |= 1;
82152
+ }
82030
82153
  }
82031
82154
  loopOutParameters.push({ flags: flags, originalName: name, outParamName: outParamName });
82032
82155
  }