typescript 4.6.0-dev.20220201 → 4.6.0-dev.20220202
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 +617 -511
- package/lib/tsserver.js +854 -729
- package/lib/tsserverlibrary.js +854 -729
- package/lib/typescript.js +854 -729
- package/lib/typescriptServices.js +854 -729
- package/lib/typingsInstaller.js +921 -796
- package/package.json +1 -1
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.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220202";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -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 };
|
|
@@ -56725,7 +56725,10 @@ var ts;
|
|
|
56725
56725
|
(type === falseType || type === regularFalseType) ? 12121864 : 7927560 :
|
|
56726
56726
|
(type === falseType || type === regularFalseType) ? 12580616 : 16774920;
|
|
56727
56727
|
}
|
|
56728
|
-
if (flags & 524288
|
|
56728
|
+
if (flags & 524288) {
|
|
56729
|
+
if (ignoreObjects) {
|
|
56730
|
+
return 16768959;
|
|
56731
|
+
}
|
|
56729
56732
|
return ts.getObjectFlags(type) & 16 && isEmptyObjectType(type) ?
|
|
56730
56733
|
strictNullChecks ? 16318463 : 16777215 :
|
|
56731
56734
|
isFunctionObjectType(type) ?
|
|
@@ -56769,7 +56772,7 @@ var ts;
|
|
|
56769
56772
|
oredFacts |= f;
|
|
56770
56773
|
andedFacts &= f;
|
|
56771
56774
|
}
|
|
56772
|
-
return oredFacts &
|
|
56775
|
+
return oredFacts & 8256 | andedFacts & 16768959;
|
|
56773
56776
|
}
|
|
56774
56777
|
function getTypeWithFacts(type, include) {
|
|
56775
56778
|
return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
|
|
@@ -58448,6 +58451,9 @@ var ts;
|
|
|
58448
58451
|
return getTypeOfSymbol(symbol);
|
|
58449
58452
|
}
|
|
58450
58453
|
function checkIdentifier(node, checkMode) {
|
|
58454
|
+
if (ts.isThisInTypeQuery(node)) {
|
|
58455
|
+
return checkThisExpression(node);
|
|
58456
|
+
}
|
|
58451
58457
|
var symbol = getResolvedSymbol(node);
|
|
58452
58458
|
if (symbol === unknownSymbol) {
|
|
58453
58459
|
return errorType;
|
|
@@ -59944,7 +59950,8 @@ var ts;
|
|
|
59944
59950
|
var links = getNodeLinks(node.expression);
|
|
59945
59951
|
if (!links.resolvedType) {
|
|
59946
59952
|
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
|
|
59953
|
+
&& ts.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 101
|
|
59954
|
+
&& node.parent.kind !== 171 && node.parent.kind !== 172) {
|
|
59948
59955
|
return links.resolvedType = errorType;
|
|
59949
59956
|
}
|
|
59950
59957
|
links.resolvedType = checkExpression(node.expression);
|
|
@@ -63318,6 +63325,10 @@ var ts;
|
|
|
63318
63325
|
return restParameter.escapedName;
|
|
63319
63326
|
}
|
|
63320
63327
|
function getParameterIdentifierNameAtPosition(signature, pos) {
|
|
63328
|
+
var _a;
|
|
63329
|
+
if (((_a = signature.declaration) === null || _a === void 0 ? void 0 : _a.kind) === 315) {
|
|
63330
|
+
return undefined;
|
|
63331
|
+
}
|
|
63321
63332
|
var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
|
|
63322
63333
|
if (pos < paramCount) {
|
|
63323
63334
|
var param = signature.parameters[pos];
|
|
@@ -70864,7 +70875,9 @@ var ts;
|
|
|
70864
70875
|
case 80:
|
|
70865
70876
|
case 205:
|
|
70866
70877
|
case 160:
|
|
70867
|
-
|
|
70878
|
+
if (!ts.isThisInTypeQuery(node)) {
|
|
70879
|
+
return getSymbolOfNameOrPropertyAccessExpression(node);
|
|
70880
|
+
}
|
|
70868
70881
|
case 108:
|
|
70869
70882
|
var container = ts.getThisContainer(node, false);
|
|
70870
70883
|
if (ts.isFunctionLike(container)) {
|
|
@@ -78849,6 +78862,7 @@ var ts;
|
|
|
78849
78862
|
var exportedVariableStatement = false;
|
|
78850
78863
|
var enabledSubstitutions;
|
|
78851
78864
|
var enclosingFunctionFlags;
|
|
78865
|
+
var parametersWithPrecedingObjectRestOrSpread;
|
|
78852
78866
|
var enclosingSuperContainerFlags = 0;
|
|
78853
78867
|
var hierarchyFacts = 0;
|
|
78854
78868
|
var currentSourceFile;
|
|
@@ -79229,6 +79243,7 @@ var ts;
|
|
|
79229
79243
|
ts.setTextRange(factory.createVariableDeclaration(iterator, undefined, undefined, initializer), node.expression),
|
|
79230
79244
|
factory.createVariableDeclaration(result)
|
|
79231
79245
|
]), node.expression), 2097152), factory.createComma(factory.createAssignment(result, createDownlevelAwait(callNext)), factory.createLogicalNot(getDone)), undefined, convertForOfStatementHead(node, getValue)), node), 256);
|
|
79246
|
+
ts.setOriginalNode(forStatement, node);
|
|
79232
79247
|
return factory.createTryStatement(factory.createBlock([
|
|
79233
79248
|
factory.restoreEnclosingLabel(forStatement, outermostLabeledStatement)
|
|
79234
79249
|
]), factory.createCatchClause(factory.createVariableDeclaration(catchVariable), ts.setEmitFlags(factory.createBlock([
|
|
@@ -79243,77 +79258,118 @@ var ts;
|
|
|
79243
79258
|
]), 1))
|
|
79244
79259
|
]));
|
|
79245
79260
|
}
|
|
79261
|
+
function parameterVisitor(node) {
|
|
79262
|
+
ts.Debug.assertNode(node, ts.isParameter);
|
|
79263
|
+
return visitParameter(node);
|
|
79264
|
+
}
|
|
79246
79265
|
function visitParameter(node) {
|
|
79266
|
+
if (parametersWithPrecedingObjectRestOrSpread === null || parametersWithPrecedingObjectRestOrSpread === void 0 ? void 0 : parametersWithPrecedingObjectRestOrSpread.has(node)) {
|
|
79267
|
+
return factory.updateParameterDeclaration(node, undefined, undefined, node.dotDotDotToken, ts.isBindingPattern(node.name) ? factory.getGeneratedNameForNode(node) : node.name, undefined, undefined, undefined);
|
|
79268
|
+
}
|
|
79247
79269
|
if (node.transformFlags & 32768) {
|
|
79248
79270
|
return factory.updateParameterDeclaration(node, undefined, undefined, node.dotDotDotToken, factory.getGeneratedNameForNode(node), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
|
|
79249
79271
|
}
|
|
79250
79272
|
return ts.visitEachChild(node, visitor, context);
|
|
79251
79273
|
}
|
|
79274
|
+
function collectParametersWithPrecedingObjectRestOrSpread(node) {
|
|
79275
|
+
var parameters;
|
|
79276
|
+
for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
|
|
79277
|
+
var parameter = _a[_i];
|
|
79278
|
+
if (parameters) {
|
|
79279
|
+
parameters.add(parameter);
|
|
79280
|
+
}
|
|
79281
|
+
else if (parameter.transformFlags & 32768) {
|
|
79282
|
+
parameters = new ts.Set();
|
|
79283
|
+
}
|
|
79284
|
+
}
|
|
79285
|
+
return parameters;
|
|
79286
|
+
}
|
|
79252
79287
|
function visitConstructorDeclaration(node) {
|
|
79253
79288
|
var savedEnclosingFunctionFlags = enclosingFunctionFlags;
|
|
79254
|
-
|
|
79255
|
-
|
|
79289
|
+
var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
|
|
79290
|
+
enclosingFunctionFlags = ts.getFunctionFlags(node);
|
|
79291
|
+
parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
|
|
79292
|
+
var updated = factory.updateConstructorDeclaration(node, undefined, node.modifiers, ts.visitParameterList(node.parameters, parameterVisitor, context), transformFunctionBody(node));
|
|
79256
79293
|
enclosingFunctionFlags = savedEnclosingFunctionFlags;
|
|
79294
|
+
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
79257
79295
|
return updated;
|
|
79258
79296
|
}
|
|
79259
79297
|
function visitGetAccessorDeclaration(node) {
|
|
79260
79298
|
var savedEnclosingFunctionFlags = enclosingFunctionFlags;
|
|
79261
|
-
|
|
79262
|
-
|
|
79299
|
+
var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
|
|
79300
|
+
enclosingFunctionFlags = ts.getFunctionFlags(node);
|
|
79301
|
+
parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
|
|
79302
|
+
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
79303
|
enclosingFunctionFlags = savedEnclosingFunctionFlags;
|
|
79304
|
+
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
79264
79305
|
return updated;
|
|
79265
79306
|
}
|
|
79266
79307
|
function visitSetAccessorDeclaration(node) {
|
|
79267
79308
|
var savedEnclosingFunctionFlags = enclosingFunctionFlags;
|
|
79268
|
-
|
|
79269
|
-
|
|
79309
|
+
var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
|
|
79310
|
+
enclosingFunctionFlags = ts.getFunctionFlags(node);
|
|
79311
|
+
parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
|
|
79312
|
+
var updated = factory.updateSetAccessorDeclaration(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, parameterVisitor, context), transformFunctionBody(node));
|
|
79270
79313
|
enclosingFunctionFlags = savedEnclosingFunctionFlags;
|
|
79314
|
+
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
79271
79315
|
return updated;
|
|
79272
79316
|
}
|
|
79273
79317
|
function visitMethodDeclaration(node) {
|
|
79274
79318
|
var savedEnclosingFunctionFlags = enclosingFunctionFlags;
|
|
79319
|
+
var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
|
|
79275
79320
|
enclosingFunctionFlags = ts.getFunctionFlags(node);
|
|
79321
|
+
parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
|
|
79276
79322
|
var updated = factory.updateMethodDeclaration(node, undefined, enclosingFunctionFlags & 1
|
|
79277
79323
|
? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)
|
|
79278
79324
|
: node.modifiers, enclosingFunctionFlags & 2
|
|
79279
79325
|
? undefined
|
|
79280
|
-
: node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(undefined, visitor, ts.isToken), undefined, ts.visitParameterList(node.parameters,
|
|
79326
|
+
: 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
79327
|
? transformAsyncGeneratorFunctionBody(node)
|
|
79282
79328
|
: transformFunctionBody(node));
|
|
79283
79329
|
enclosingFunctionFlags = savedEnclosingFunctionFlags;
|
|
79330
|
+
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
79284
79331
|
return updated;
|
|
79285
79332
|
}
|
|
79286
79333
|
function visitFunctionDeclaration(node) {
|
|
79287
79334
|
var savedEnclosingFunctionFlags = enclosingFunctionFlags;
|
|
79335
|
+
var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
|
|
79288
79336
|
enclosingFunctionFlags = ts.getFunctionFlags(node);
|
|
79337
|
+
parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
|
|
79289
79338
|
var updated = factory.updateFunctionDeclaration(node, undefined, enclosingFunctionFlags & 1
|
|
79290
79339
|
? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)
|
|
79291
79340
|
: node.modifiers, enclosingFunctionFlags & 2
|
|
79292
79341
|
? undefined
|
|
79293
|
-
: node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters,
|
|
79342
|
+
: node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1
|
|
79294
79343
|
? transformAsyncGeneratorFunctionBody(node)
|
|
79295
79344
|
: transformFunctionBody(node));
|
|
79296
79345
|
enclosingFunctionFlags = savedEnclosingFunctionFlags;
|
|
79346
|
+
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
79297
79347
|
return updated;
|
|
79298
79348
|
}
|
|
79299
79349
|
function visitArrowFunction(node) {
|
|
79300
79350
|
var savedEnclosingFunctionFlags = enclosingFunctionFlags;
|
|
79351
|
+
var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
|
|
79301
79352
|
enclosingFunctionFlags = ts.getFunctionFlags(node);
|
|
79302
|
-
|
|
79353
|
+
parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
|
|
79354
|
+
var updated = factory.updateArrowFunction(node, node.modifiers, undefined, ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, node.equalsGreaterThanToken, transformFunctionBody(node));
|
|
79303
79355
|
enclosingFunctionFlags = savedEnclosingFunctionFlags;
|
|
79356
|
+
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
79304
79357
|
return updated;
|
|
79305
79358
|
}
|
|
79306
79359
|
function visitFunctionExpression(node) {
|
|
79307
79360
|
var savedEnclosingFunctionFlags = enclosingFunctionFlags;
|
|
79361
|
+
var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
|
|
79308
79362
|
enclosingFunctionFlags = ts.getFunctionFlags(node);
|
|
79363
|
+
parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
|
|
79309
79364
|
var updated = factory.updateFunctionExpression(node, enclosingFunctionFlags & 1
|
|
79310
79365
|
? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)
|
|
79311
79366
|
: node.modifiers, enclosingFunctionFlags & 2
|
|
79312
79367
|
? undefined
|
|
79313
|
-
: node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters,
|
|
79368
|
+
: node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1
|
|
79314
79369
|
? transformAsyncGeneratorFunctionBody(node)
|
|
79315
79370
|
: transformFunctionBody(node));
|
|
79316
79371
|
enclosingFunctionFlags = savedEnclosingFunctionFlags;
|
|
79372
|
+
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
79317
79373
|
return updated;
|
|
79318
79374
|
}
|
|
79319
79375
|
function transformAsyncGeneratorFunctionBody(node) {
|
|
@@ -79368,13 +79424,55 @@ var ts;
|
|
|
79368
79424
|
return body;
|
|
79369
79425
|
}
|
|
79370
79426
|
function appendObjectRestAssignmentsIfNeeded(statements, node) {
|
|
79427
|
+
var containsPrecedingObjectRestOrSpread = false;
|
|
79371
79428
|
for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
|
|
79372
79429
|
var parameter = _a[_i];
|
|
79373
|
-
if (
|
|
79374
|
-
|
|
79375
|
-
|
|
79430
|
+
if (containsPrecedingObjectRestOrSpread) {
|
|
79431
|
+
if (ts.isBindingPattern(parameter.name)) {
|
|
79432
|
+
if (parameter.name.elements.length > 0) {
|
|
79433
|
+
var declarations = ts.flattenDestructuringBinding(parameter, visitor, context, 0, factory.getGeneratedNameForNode(parameter));
|
|
79434
|
+
if (ts.some(declarations)) {
|
|
79435
|
+
var declarationList = factory.createVariableDeclarationList(declarations);
|
|
79436
|
+
var statement = factory.createVariableStatement(undefined, declarationList);
|
|
79437
|
+
ts.setEmitFlags(statement, 1048576);
|
|
79438
|
+
statements = ts.append(statements, statement);
|
|
79439
|
+
}
|
|
79440
|
+
}
|
|
79441
|
+
else if (parameter.initializer) {
|
|
79442
|
+
var name = factory.getGeneratedNameForNode(parameter);
|
|
79443
|
+
var initializer = ts.visitNode(parameter.initializer, visitor, ts.isExpression);
|
|
79444
|
+
var assignment = factory.createAssignment(name, initializer);
|
|
79445
|
+
var statement = factory.createExpressionStatement(assignment);
|
|
79446
|
+
ts.setEmitFlags(statement, 1048576);
|
|
79447
|
+
statements = ts.append(statements, statement);
|
|
79448
|
+
}
|
|
79449
|
+
}
|
|
79450
|
+
else if (parameter.initializer) {
|
|
79451
|
+
var name = factory.cloneNode(parameter.name);
|
|
79452
|
+
ts.setTextRange(name, parameter.name);
|
|
79453
|
+
ts.setEmitFlags(name, 48);
|
|
79454
|
+
var initializer = ts.visitNode(parameter.initializer, visitor, ts.isExpression);
|
|
79455
|
+
ts.addEmitFlags(initializer, 48 | 1536);
|
|
79456
|
+
var assignment = factory.createAssignment(name, initializer);
|
|
79457
|
+
ts.setTextRange(assignment, parameter);
|
|
79458
|
+
ts.setEmitFlags(assignment, 1536);
|
|
79459
|
+
var block = factory.createBlock([factory.createExpressionStatement(assignment)]);
|
|
79460
|
+
ts.setTextRange(block, parameter);
|
|
79461
|
+
ts.setEmitFlags(block, 1 | 32 | 384 | 1536);
|
|
79462
|
+
var typeCheck = factory.createTypeCheck(factory.cloneNode(parameter.name), "undefined");
|
|
79463
|
+
var statement = factory.createIfStatement(typeCheck, block);
|
|
79464
|
+
ts.startOnNewLine(statement);
|
|
79465
|
+
ts.setTextRange(statement, parameter);
|
|
79466
|
+
ts.setEmitFlags(statement, 384 | 32 | 1048576 | 1536);
|
|
79467
|
+
statements = ts.append(statements, statement);
|
|
79468
|
+
}
|
|
79469
|
+
}
|
|
79470
|
+
else if (parameter.transformFlags & 32768) {
|
|
79471
|
+
containsPrecedingObjectRestOrSpread = true;
|
|
79472
|
+
var declarations = ts.flattenDestructuringBinding(parameter, visitor, context, 1, factory.getGeneratedNameForNode(parameter), false, true);
|
|
79376
79473
|
if (ts.some(declarations)) {
|
|
79377
|
-
var
|
|
79474
|
+
var declarationList = factory.createVariableDeclarationList(declarations);
|
|
79475
|
+
var statement = factory.createVariableStatement(undefined, declarationList);
|
|
79378
79476
|
ts.setEmitFlags(statement, 1048576);
|
|
79379
79477
|
statements = ts.append(statements, statement);
|
|
79380
79478
|
}
|
|
@@ -81782,10 +81880,12 @@ var ts;
|
|
|
81782
81880
|
var loopParameters = [];
|
|
81783
81881
|
var loopOutParameters = [];
|
|
81784
81882
|
if (loopInitializer && (ts.getCombinedNodeFlags(loopInitializer) & 3)) {
|
|
81785
|
-
var
|
|
81883
|
+
var hasCapturedBindingsInForHead = shouldConvertInitializerOfForStatement(node) ||
|
|
81884
|
+
shouldConvertConditionOfForStatement(node) ||
|
|
81885
|
+
shouldConvertIncrementorOfForStatement(node);
|
|
81786
81886
|
for (var _i = 0, _a = loopInitializer.declarations; _i < _a.length; _i++) {
|
|
81787
81887
|
var decl = _a[_i];
|
|
81788
|
-
processLoopVariableDeclaration(node, decl, loopParameters, loopOutParameters,
|
|
81888
|
+
processLoopVariableDeclaration(node, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForHead);
|
|
81789
81889
|
}
|
|
81790
81890
|
}
|
|
81791
81891
|
var currentState = { loopParameters: loopParameters, loopOutParameters: loopOutParameters };
|
|
@@ -82006,27 +82106,33 @@ var ts;
|
|
|
82006
82106
|
caseClauses.push(factory.createCaseClause(factory.createStringLiteral(labelMarker), statements));
|
|
82007
82107
|
});
|
|
82008
82108
|
}
|
|
82009
|
-
function processLoopVariableDeclaration(container, decl, loopParameters, loopOutParameters,
|
|
82109
|
+
function processLoopVariableDeclaration(container, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForHead) {
|
|
82010
82110
|
var name = decl.name;
|
|
82011
82111
|
if (ts.isBindingPattern(name)) {
|
|
82012
82112
|
for (var _i = 0, _a = name.elements; _i < _a.length; _i++) {
|
|
82013
82113
|
var element = _a[_i];
|
|
82014
82114
|
if (!ts.isOmittedExpression(element)) {
|
|
82015
|
-
processLoopVariableDeclaration(container, element, loopParameters, loopOutParameters,
|
|
82115
|
+
processLoopVariableDeclaration(container, element, loopParameters, loopOutParameters, hasCapturedBindingsInForHead);
|
|
82016
82116
|
}
|
|
82017
82117
|
}
|
|
82018
82118
|
}
|
|
82019
82119
|
else {
|
|
82020
82120
|
loopParameters.push(factory.createParameterDeclaration(undefined, undefined, undefined, name));
|
|
82021
82121
|
var checkFlags = resolver.getNodeCheckFlags(decl);
|
|
82022
|
-
if (checkFlags & 4194304 ||
|
|
82122
|
+
if (checkFlags & 4194304 || hasCapturedBindingsInForHead) {
|
|
82023
82123
|
var outParamName = factory.createUniqueName("out_" + ts.idText(name));
|
|
82024
82124
|
var flags = 0;
|
|
82025
82125
|
if (checkFlags & 4194304) {
|
|
82026
82126
|
flags |= 1;
|
|
82027
82127
|
}
|
|
82028
|
-
if (ts.isForStatement(container)
|
|
82029
|
-
|
|
82128
|
+
if (ts.isForStatement(container)) {
|
|
82129
|
+
if (container.initializer && resolver.isBindingCapturedByNode(container.initializer, decl)) {
|
|
82130
|
+
flags |= 2;
|
|
82131
|
+
}
|
|
82132
|
+
if (container.condition && resolver.isBindingCapturedByNode(container.condition, decl) ||
|
|
82133
|
+
container.incrementor && resolver.isBindingCapturedByNode(container.incrementor, decl)) {
|
|
82134
|
+
flags |= 1;
|
|
82135
|
+
}
|
|
82030
82136
|
}
|
|
82031
82137
|
loopOutParameters.push({ flags: flags, originalName: name, outParamName: outParamName });
|
|
82032
82138
|
}
|