Skip to content

Commit 94b4f8b

Browse files
committed
Update LKG
1 parent aa40be6 commit 94b4f8b

6 files changed

+450
-240
lines changed

lib/tsc.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -2199,6 +2199,8 @@ var ts;
21992199
return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs;
22002200
}
22012201
ts.isCheckJsEnabledForFile = isCheckJsEnabledForFile;
2202+
function assertTypeIsNever(_) { }
2203+
ts.assertTypeIsNever = assertTypeIsNever;
22022204
})(ts || (ts = {}));
22032205
var ts;
22042206
(function (ts) {
@@ -18064,17 +18066,20 @@ var ts;
1806418066
return ts.combinePaths(directory, "package.json");
1806518067
}
1806618068
function loadModuleFromNodeModulesFolder(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, failedLookupLocations, state) {
18067-
var _a = getNameOfTopDirectory(moduleName), top = _a.top, rest = _a.rest;
18068-
var packageRootPath = ts.combinePaths(nodeModulesFolder, top);
18069+
var _a = getPackageName(moduleName), packageName = _a.packageName, rest = _a.rest;
18070+
var packageRootPath = ts.combinePaths(nodeModulesFolder, packageName);
1806918071
var _b = getPackageJsonInfo(packageRootPath, rest, failedLookupLocations, !nodeModulesFolderExists, state), packageJsonContent = _b.packageJsonContent, packageId = _b.packageId;
1807018072
var candidate = ts.normalizePath(ts.combinePaths(nodeModulesFolder, moduleName));
1807118073
var pathAndExtension = loadModuleFromFile(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state) ||
1807218074
loadNodeModuleFromDirectoryWorker(extensions, candidate, failedLookupLocations, !nodeModulesFolderExists, state, packageJsonContent);
1807318075
return withPackageId(packageId, pathAndExtension);
1807418076
}
18075-
function getNameOfTopDirectory(name) {
18076-
var idx = name.indexOf(ts.directorySeparator);
18077-
return idx === -1 ? { top: name, rest: "" } : { top: name.slice(0, idx), rest: name.slice(idx + 1) };
18077+
function getPackageName(moduleName) {
18078+
var idx = moduleName.indexOf(ts.directorySeparator);
18079+
if (moduleName[0] === "@") {
18080+
idx = moduleName.indexOf(ts.directorySeparator, idx + 1);
18081+
}
18082+
return idx === -1 ? { packageName: moduleName, rest: "" } : { packageName: moduleName.slice(0, idx), rest: moduleName.slice(idx + 1) };
1807818083
}
1807918084
function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) {
1808018085
return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, false, cache);

0 commit comments

Comments
 (0)