typescript 4.6.0-dev.20220131 → 4.6.0-dev.20220204
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/lib.webworker.d.ts +1 -1
- package/lib/pl/diagnosticMessages.generated.json +3 -4
- package/lib/tsc.js +626 -514
- package/lib/tsserver.js +893 -736
- package/lib/tsserverlibrary.js +893 -736
- package/lib/typescript.js +893 -736
- package/lib/typescriptServices.js +893 -736
- package/lib/typingsInstaller.js +930 -800
- 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.20220204";
|
|
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 };
|
|
@@ -9583,11 +9583,17 @@ var ts;
|
|
|
9583
9583
|
ts.getAllJSDocTagsOfKind = getAllJSDocTagsOfKind;
|
|
9584
9584
|
function getTextOfJSDocComment(comment) {
|
|
9585
9585
|
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("");
|
|
9586
|
+
: comment === null || comment === void 0 ? void 0 : comment.map(function (c) { return c.kind === 319 ? c.text : formatJSDocLink(c); }).join("");
|
|
9589
9587
|
}
|
|
9590
9588
|
ts.getTextOfJSDocComment = getTextOfJSDocComment;
|
|
9589
|
+
function formatJSDocLink(link) {
|
|
9590
|
+
var kind = link.kind === 322 ? "link"
|
|
9591
|
+
: link.kind === 323 ? "linkcode"
|
|
9592
|
+
: "linkplain";
|
|
9593
|
+
var name = link.name ? ts.entityNameToString(link.name) : "";
|
|
9594
|
+
var space = link.name && link.text.startsWith("://") ? "" : " ";
|
|
9595
|
+
return "{@" + kind + " " + name + space + link.text + "}";
|
|
9596
|
+
}
|
|
9591
9597
|
function getEffectiveTypeParameterDeclarations(node) {
|
|
9592
9598
|
if (ts.isJSDocSignature(node)) {
|
|
9593
9599
|
return ts.emptyArray;
|
|
@@ -56725,7 +56731,10 @@ var ts;
|
|
|
56725
56731
|
(type === falseType || type === regularFalseType) ? 12121864 : 7927560 :
|
|
56726
56732
|
(type === falseType || type === regularFalseType) ? 12580616 : 16774920;
|
|
56727
56733
|
}
|
|
56728
|
-
if (flags & 524288
|
|
56734
|
+
if (flags & 524288) {
|
|
56735
|
+
if (ignoreObjects) {
|
|
56736
|
+
return 16768959;
|
|
56737
|
+
}
|
|
56729
56738
|
return ts.getObjectFlags(type) & 16 && isEmptyObjectType(type) ?
|
|
56730
56739
|
strictNullChecks ? 16318463 : 16777215 :
|
|
56731
56740
|
isFunctionObjectType(type) ?
|
|
@@ -56769,7 +56778,7 @@ var ts;
|
|
|
56769
56778
|
oredFacts |= f;
|
|
56770
56779
|
andedFacts &= f;
|
|
56771
56780
|
}
|
|
56772
|
-
return oredFacts &
|
|
56781
|
+
return oredFacts & 8256 | andedFacts & 16768959;
|
|
56773
56782
|
}
|
|
56774
56783
|
function getTypeWithFacts(type, include) {
|
|
56775
56784
|
return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
|
|
@@ -58448,6 +58457,9 @@ var ts;
|
|
|
58448
58457
|
return getTypeOfSymbol(symbol);
|
|
58449
58458
|
}
|
|
58450
58459
|
function checkIdentifier(node, checkMode) {
|
|
58460
|
+
if (ts.isThisInTypeQuery(node)) {
|
|
58461
|
+
return checkThisExpression(node);
|
|
58462
|
+
}
|
|
58451
58463
|
var symbol = getResolvedSymbol(node);
|
|
58452
58464
|
if (symbol === unknownSymbol) {
|
|
58453
58465
|
return errorType;
|
|
@@ -59944,7 +59956,8 @@ var ts;
|
|
|
59944
59956
|
var links = getNodeLinks(node.expression);
|
|
59945
59957
|
if (!links.resolvedType) {
|
|
59946
59958
|
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
|
|
59959
|
+
&& ts.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 101
|
|
59960
|
+
&& node.parent.kind !== 171 && node.parent.kind !== 172) {
|
|
59948
59961
|
return links.resolvedType = errorType;
|
|
59949
59962
|
}
|
|
59950
59963
|
links.resolvedType = checkExpression(node.expression);
|
|
@@ -63318,6 +63331,10 @@ var ts;
|
|
|
63318
63331
|
return restParameter.escapedName;
|
|
63319
63332
|
}
|
|
63320
63333
|
function getParameterIdentifierNameAtPosition(signature, pos) {
|
|
63334
|
+
var _a;
|
|
63335
|
+
if (((_a = signature.declaration) === null || _a === void 0 ? void 0 : _a.kind) === 315) {
|
|
63336
|
+
return undefined;
|
|
63337
|
+
}
|
|
63321
63338
|
var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
|
|
63322
63339
|
if (pos < paramCount) {
|
|
63323
63340
|
var param = signature.parameters[pos];
|
|
@@ -70864,7 +70881,9 @@ var ts;
|
|
|
70864
70881
|
case 80:
|
|
70865
70882
|
case 205:
|
|
70866
70883
|
case 160:
|
|
70867
|
-
|
|
70884
|
+
if (!ts.isThisInTypeQuery(node)) {
|
|
70885
|
+
return getSymbolOfNameOrPropertyAccessExpression(node);
|
|
70886
|
+
}
|
|
70868
70887
|
case 108:
|
|
70869
70888
|
var container = ts.getThisContainer(node, false);
|
|
70870
70889
|
if (ts.isFunctionLike(container)) {
|
|
@@ -78849,6 +78868,7 @@ var ts;
|
|
|
78849
78868
|
var exportedVariableStatement = false;
|
|
78850
78869
|
var enabledSubstitutions;
|
|
78851
78870
|
var enclosingFunctionFlags;
|
|
78871
|
+
var parametersWithPrecedingObjectRestOrSpread;
|
|
78852
78872
|
var enclosingSuperContainerFlags = 0;
|
|
78853
78873
|
var hierarchyFacts = 0;
|
|
78854
78874
|
var currentSourceFile;
|
|
@@ -79229,6 +79249,7 @@ var ts;
|
|
|
79229
79249
|
ts.setTextRange(factory.createVariableDeclaration(iterator, undefined, undefined, initializer), node.expression),
|
|
79230
79250
|
factory.createVariableDeclaration(result)
|
|
79231
79251
|
]), node.expression), 2097152), factory.createComma(factory.createAssignment(result, createDownlevelAwait(callNext)), factory.createLogicalNot(getDone)), undefined, convertForOfStatementHead(node, getValue)), node), 256);
|
|
79252
|
+
ts.setOriginalNode(forStatement, node);
|
|
79232
79253
|
return factory.createTryStatement(factory.createBlock([
|
|
79233
79254
|
factory.restoreEnclosingLabel(forStatement, outermostLabeledStatement)
|
|
79234
79255
|
]), factory.createCatchClause(factory.createVariableDeclaration(catchVariable), ts.setEmitFlags(factory.createBlock([
|
|
@@ -79243,77 +79264,118 @@ var ts;
|
|
|
79243
79264
|
]), 1))
|
|
79244
79265
|
]));
|
|
79245
79266
|
}
|
|
79267
|
+
function parameterVisitor(node) {
|
|
79268
|
+
ts.Debug.assertNode(node, ts.isParameter);
|
|
79269
|
+
return visitParameter(node);
|
|
79270
|
+
}
|
|
79246
79271
|
function visitParameter(node) {
|
|
79272
|
+
if (parametersWithPrecedingObjectRestOrSpread === null || parametersWithPrecedingObjectRestOrSpread === void 0 ? void 0 : parametersWithPrecedingObjectRestOrSpread.has(node)) {
|
|
79273
|
+
return factory.updateParameterDeclaration(node, undefined, undefined, node.dotDotDotToken, ts.isBindingPattern(node.name) ? factory.getGeneratedNameForNode(node) : node.name, undefined, undefined, undefined);
|
|
79274
|
+
}
|
|
79247
79275
|
if (node.transformFlags & 32768) {
|
|
79248
79276
|
return factory.updateParameterDeclaration(node, undefined, undefined, node.dotDotDotToken, factory.getGeneratedNameForNode(node), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
|
|
79249
79277
|
}
|
|
79250
79278
|
return ts.visitEachChild(node, visitor, context);
|
|
79251
79279
|
}
|
|
79280
|
+
function collectParametersWithPrecedingObjectRestOrSpread(node) {
|
|
79281
|
+
var parameters;
|
|
79282
|
+
for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
|
|
79283
|
+
var parameter = _a[_i];
|
|
79284
|
+
if (parameters) {
|
|
79285
|
+
parameters.add(parameter);
|
|
79286
|
+
}
|
|
79287
|
+
else if (parameter.transformFlags & 32768) {
|
|
79288
|
+
parameters = new ts.Set();
|
|
79289
|
+
}
|
|
79290
|
+
}
|
|
79291
|
+
return parameters;
|
|
79292
|
+
}
|
|
79252
79293
|
function visitConstructorDeclaration(node) {
|
|
79253
79294
|
var savedEnclosingFunctionFlags = enclosingFunctionFlags;
|
|
79254
|
-
|
|
79255
|
-
|
|
79295
|
+
var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
|
|
79296
|
+
enclosingFunctionFlags = ts.getFunctionFlags(node);
|
|
79297
|
+
parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
|
|
79298
|
+
var updated = factory.updateConstructorDeclaration(node, undefined, node.modifiers, ts.visitParameterList(node.parameters, parameterVisitor, context), transformFunctionBody(node));
|
|
79256
79299
|
enclosingFunctionFlags = savedEnclosingFunctionFlags;
|
|
79300
|
+
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
79257
79301
|
return updated;
|
|
79258
79302
|
}
|
|
79259
79303
|
function visitGetAccessorDeclaration(node) {
|
|
79260
79304
|
var savedEnclosingFunctionFlags = enclosingFunctionFlags;
|
|
79261
|
-
|
|
79262
|
-
|
|
79305
|
+
var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
|
|
79306
|
+
enclosingFunctionFlags = ts.getFunctionFlags(node);
|
|
79307
|
+
parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
|
|
79308
|
+
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
79309
|
enclosingFunctionFlags = savedEnclosingFunctionFlags;
|
|
79310
|
+
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
79264
79311
|
return updated;
|
|
79265
79312
|
}
|
|
79266
79313
|
function visitSetAccessorDeclaration(node) {
|
|
79267
79314
|
var savedEnclosingFunctionFlags = enclosingFunctionFlags;
|
|
79268
|
-
|
|
79269
|
-
|
|
79315
|
+
var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
|
|
79316
|
+
enclosingFunctionFlags = ts.getFunctionFlags(node);
|
|
79317
|
+
parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
|
|
79318
|
+
var updated = factory.updateSetAccessorDeclaration(node, undefined, node.modifiers, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitParameterList(node.parameters, parameterVisitor, context), transformFunctionBody(node));
|
|
79270
79319
|
enclosingFunctionFlags = savedEnclosingFunctionFlags;
|
|
79320
|
+
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
79271
79321
|
return updated;
|
|
79272
79322
|
}
|
|
79273
79323
|
function visitMethodDeclaration(node) {
|
|
79274
79324
|
var savedEnclosingFunctionFlags = enclosingFunctionFlags;
|
|
79325
|
+
var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
|
|
79275
79326
|
enclosingFunctionFlags = ts.getFunctionFlags(node);
|
|
79327
|
+
parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
|
|
79276
79328
|
var updated = factory.updateMethodDeclaration(node, undefined, enclosingFunctionFlags & 1
|
|
79277
79329
|
? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)
|
|
79278
79330
|
: node.modifiers, enclosingFunctionFlags & 2
|
|
79279
79331
|
? undefined
|
|
79280
|
-
: node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(undefined, visitor, ts.isToken), undefined, ts.visitParameterList(node.parameters,
|
|
79332
|
+
: 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
79333
|
? transformAsyncGeneratorFunctionBody(node)
|
|
79282
79334
|
: transformFunctionBody(node));
|
|
79283
79335
|
enclosingFunctionFlags = savedEnclosingFunctionFlags;
|
|
79336
|
+
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
79284
79337
|
return updated;
|
|
79285
79338
|
}
|
|
79286
79339
|
function visitFunctionDeclaration(node) {
|
|
79287
79340
|
var savedEnclosingFunctionFlags = enclosingFunctionFlags;
|
|
79341
|
+
var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
|
|
79288
79342
|
enclosingFunctionFlags = ts.getFunctionFlags(node);
|
|
79343
|
+
parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
|
|
79289
79344
|
var updated = factory.updateFunctionDeclaration(node, undefined, enclosingFunctionFlags & 1
|
|
79290
79345
|
? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)
|
|
79291
79346
|
: node.modifiers, enclosingFunctionFlags & 2
|
|
79292
79347
|
? undefined
|
|
79293
|
-
: node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters,
|
|
79348
|
+
: node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1
|
|
79294
79349
|
? transformAsyncGeneratorFunctionBody(node)
|
|
79295
79350
|
: transformFunctionBody(node));
|
|
79296
79351
|
enclosingFunctionFlags = savedEnclosingFunctionFlags;
|
|
79352
|
+
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
79297
79353
|
return updated;
|
|
79298
79354
|
}
|
|
79299
79355
|
function visitArrowFunction(node) {
|
|
79300
79356
|
var savedEnclosingFunctionFlags = enclosingFunctionFlags;
|
|
79357
|
+
var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
|
|
79301
79358
|
enclosingFunctionFlags = ts.getFunctionFlags(node);
|
|
79302
|
-
|
|
79359
|
+
parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
|
|
79360
|
+
var updated = factory.updateArrowFunction(node, node.modifiers, undefined, ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, node.equalsGreaterThanToken, transformFunctionBody(node));
|
|
79303
79361
|
enclosingFunctionFlags = savedEnclosingFunctionFlags;
|
|
79362
|
+
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
79304
79363
|
return updated;
|
|
79305
79364
|
}
|
|
79306
79365
|
function visitFunctionExpression(node) {
|
|
79307
79366
|
var savedEnclosingFunctionFlags = enclosingFunctionFlags;
|
|
79367
|
+
var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread;
|
|
79308
79368
|
enclosingFunctionFlags = ts.getFunctionFlags(node);
|
|
79369
|
+
parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node);
|
|
79309
79370
|
var updated = factory.updateFunctionExpression(node, enclosingFunctionFlags & 1
|
|
79310
79371
|
? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifier)
|
|
79311
79372
|
: node.modifiers, enclosingFunctionFlags & 2
|
|
79312
79373
|
? undefined
|
|
79313
|
-
: node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters,
|
|
79374
|
+
: node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, parameterVisitor, context), undefined, enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1
|
|
79314
79375
|
? transformAsyncGeneratorFunctionBody(node)
|
|
79315
79376
|
: transformFunctionBody(node));
|
|
79316
79377
|
enclosingFunctionFlags = savedEnclosingFunctionFlags;
|
|
79378
|
+
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
79317
79379
|
return updated;
|
|
79318
79380
|
}
|
|
79319
79381
|
function transformAsyncGeneratorFunctionBody(node) {
|
|
@@ -79368,13 +79430,55 @@ var ts;
|
|
|
79368
79430
|
return body;
|
|
79369
79431
|
}
|
|
79370
79432
|
function appendObjectRestAssignmentsIfNeeded(statements, node) {
|
|
79433
|
+
var containsPrecedingObjectRestOrSpread = false;
|
|
79371
79434
|
for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {
|
|
79372
79435
|
var parameter = _a[_i];
|
|
79373
|
-
if (
|
|
79374
|
-
|
|
79375
|
-
|
|
79436
|
+
if (containsPrecedingObjectRestOrSpread) {
|
|
79437
|
+
if (ts.isBindingPattern(parameter.name)) {
|
|
79438
|
+
if (parameter.name.elements.length > 0) {
|
|
79439
|
+
var declarations = ts.flattenDestructuringBinding(parameter, visitor, context, 0, factory.getGeneratedNameForNode(parameter));
|
|
79440
|
+
if (ts.some(declarations)) {
|
|
79441
|
+
var declarationList = factory.createVariableDeclarationList(declarations);
|
|
79442
|
+
var statement = factory.createVariableStatement(undefined, declarationList);
|
|
79443
|
+
ts.setEmitFlags(statement, 1048576);
|
|
79444
|
+
statements = ts.append(statements, statement);
|
|
79445
|
+
}
|
|
79446
|
+
}
|
|
79447
|
+
else if (parameter.initializer) {
|
|
79448
|
+
var name = factory.getGeneratedNameForNode(parameter);
|
|
79449
|
+
var initializer = ts.visitNode(parameter.initializer, visitor, ts.isExpression);
|
|
79450
|
+
var assignment = factory.createAssignment(name, initializer);
|
|
79451
|
+
var statement = factory.createExpressionStatement(assignment);
|
|
79452
|
+
ts.setEmitFlags(statement, 1048576);
|
|
79453
|
+
statements = ts.append(statements, statement);
|
|
79454
|
+
}
|
|
79455
|
+
}
|
|
79456
|
+
else if (parameter.initializer) {
|
|
79457
|
+
var name = factory.cloneNode(parameter.name);
|
|
79458
|
+
ts.setTextRange(name, parameter.name);
|
|
79459
|
+
ts.setEmitFlags(name, 48);
|
|
79460
|
+
var initializer = ts.visitNode(parameter.initializer, visitor, ts.isExpression);
|
|
79461
|
+
ts.addEmitFlags(initializer, 48 | 1536);
|
|
79462
|
+
var assignment = factory.createAssignment(name, initializer);
|
|
79463
|
+
ts.setTextRange(assignment, parameter);
|
|
79464
|
+
ts.setEmitFlags(assignment, 1536);
|
|
79465
|
+
var block = factory.createBlock([factory.createExpressionStatement(assignment)]);
|
|
79466
|
+
ts.setTextRange(block, parameter);
|
|
79467
|
+
ts.setEmitFlags(block, 1 | 32 | 384 | 1536);
|
|
79468
|
+
var typeCheck = factory.createTypeCheck(factory.cloneNode(parameter.name), "undefined");
|
|
79469
|
+
var statement = factory.createIfStatement(typeCheck, block);
|
|
79470
|
+
ts.startOnNewLine(statement);
|
|
79471
|
+
ts.setTextRange(statement, parameter);
|
|
79472
|
+
ts.setEmitFlags(statement, 384 | 32 | 1048576 | 1536);
|
|
79473
|
+
statements = ts.append(statements, statement);
|
|
79474
|
+
}
|
|
79475
|
+
}
|
|
79476
|
+
else if (parameter.transformFlags & 32768) {
|
|
79477
|
+
containsPrecedingObjectRestOrSpread = true;
|
|
79478
|
+
var declarations = ts.flattenDestructuringBinding(parameter, visitor, context, 1, factory.getGeneratedNameForNode(parameter), false, true);
|
|
79376
79479
|
if (ts.some(declarations)) {
|
|
79377
|
-
var
|
|
79480
|
+
var declarationList = factory.createVariableDeclarationList(declarations);
|
|
79481
|
+
var statement = factory.createVariableStatement(undefined, declarationList);
|
|
79378
79482
|
ts.setEmitFlags(statement, 1048576);
|
|
79379
79483
|
statements = ts.append(statements, statement);
|
|
79380
79484
|
}
|
|
@@ -81782,10 +81886,12 @@ var ts;
|
|
|
81782
81886
|
var loopParameters = [];
|
|
81783
81887
|
var loopOutParameters = [];
|
|
81784
81888
|
if (loopInitializer && (ts.getCombinedNodeFlags(loopInitializer) & 3)) {
|
|
81785
|
-
var
|
|
81889
|
+
var hasCapturedBindingsInForHead = shouldConvertInitializerOfForStatement(node) ||
|
|
81890
|
+
shouldConvertConditionOfForStatement(node) ||
|
|
81891
|
+
shouldConvertIncrementorOfForStatement(node);
|
|
81786
81892
|
for (var _i = 0, _a = loopInitializer.declarations; _i < _a.length; _i++) {
|
|
81787
81893
|
var decl = _a[_i];
|
|
81788
|
-
processLoopVariableDeclaration(node, decl, loopParameters, loopOutParameters,
|
|
81894
|
+
processLoopVariableDeclaration(node, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForHead);
|
|
81789
81895
|
}
|
|
81790
81896
|
}
|
|
81791
81897
|
var currentState = { loopParameters: loopParameters, loopOutParameters: loopOutParameters };
|
|
@@ -82006,27 +82112,33 @@ var ts;
|
|
|
82006
82112
|
caseClauses.push(factory.createCaseClause(factory.createStringLiteral(labelMarker), statements));
|
|
82007
82113
|
});
|
|
82008
82114
|
}
|
|
82009
|
-
function processLoopVariableDeclaration(container, decl, loopParameters, loopOutParameters,
|
|
82115
|
+
function processLoopVariableDeclaration(container, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForHead) {
|
|
82010
82116
|
var name = decl.name;
|
|
82011
82117
|
if (ts.isBindingPattern(name)) {
|
|
82012
82118
|
for (var _i = 0, _a = name.elements; _i < _a.length; _i++) {
|
|
82013
82119
|
var element = _a[_i];
|
|
82014
82120
|
if (!ts.isOmittedExpression(element)) {
|
|
82015
|
-
processLoopVariableDeclaration(container, element, loopParameters, loopOutParameters,
|
|
82121
|
+
processLoopVariableDeclaration(container, element, loopParameters, loopOutParameters, hasCapturedBindingsInForHead);
|
|
82016
82122
|
}
|
|
82017
82123
|
}
|
|
82018
82124
|
}
|
|
82019
82125
|
else {
|
|
82020
82126
|
loopParameters.push(factory.createParameterDeclaration(undefined, undefined, undefined, name));
|
|
82021
82127
|
var checkFlags = resolver.getNodeCheckFlags(decl);
|
|
82022
|
-
if (checkFlags & 4194304 ||
|
|
82128
|
+
if (checkFlags & 4194304 || hasCapturedBindingsInForHead) {
|
|
82023
82129
|
var outParamName = factory.createUniqueName("out_" + ts.idText(name));
|
|
82024
82130
|
var flags = 0;
|
|
82025
82131
|
if (checkFlags & 4194304) {
|
|
82026
82132
|
flags |= 1;
|
|
82027
82133
|
}
|
|
82028
|
-
if (ts.isForStatement(container)
|
|
82029
|
-
|
|
82134
|
+
if (ts.isForStatement(container)) {
|
|
82135
|
+
if (container.initializer && resolver.isBindingCapturedByNode(container.initializer, decl)) {
|
|
82136
|
+
flags |= 2;
|
|
82137
|
+
}
|
|
82138
|
+
if (container.condition && resolver.isBindingCapturedByNode(container.condition, decl) ||
|
|
82139
|
+
container.incrementor && resolver.isBindingCapturedByNode(container.incrementor, decl)) {
|
|
82140
|
+
flags |= 1;
|
|
82141
|
+
}
|
|
82030
82142
|
}
|
|
82031
82143
|
loopOutParameters.push({ flags: flags, originalName: name, outParamName: outParamName });
|
|
82032
82144
|
}
|