(extensions, moduleName, directory, state, cache, redirectedReference)
| 43924 | return !ts.some(ts.getOwnKeys(obj), function (k) { return ts.startsWith(k, "."); }); |
| 43925 | } |
| 43926 | function loadModuleFromSelfNameReference(extensions, moduleName, directory, state, cache, redirectedReference) { |
| 43927 | var _a, _b; |
| 43928 | var useCaseSensitiveFileNames = typeof state.host.useCaseSensitiveFileNames === "function" ? state.host.useCaseSensitiveFileNames() : state.host.useCaseSensitiveFileNames; |
| 43929 | var directoryPath = ts.toPath(ts.combinePaths(directory, "dummy"), (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a), ts.createGetCanonicalFileName(useCaseSensitiveFileNames === undefined ? true : useCaseSensitiveFileNames)); |
| 43930 | var scope = getPackageScopeForPath(directoryPath, state.packageJsonInfoCache, state.host, state.compilerOptions); |
| 43931 | if (!scope || !scope.packageJsonContent.exports) { |
| 43932 | return undefined; |
| 43933 | } |
| 43934 | if (typeof scope.packageJsonContent.name !== "string") { |
| 43935 | return undefined; |
| 43936 | } |
| 43937 | var parts = ts.getPathComponents(moduleName); // unrooted paths should have `""` as their 0th entry |
| 43938 | var nameParts = ts.getPathComponents(scope.packageJsonContent.name); |
| 43939 | if (!ts.every(nameParts, function (p, i) { return parts[i] === p; })) { |
| 43940 | return undefined; |
| 43941 | } |
| 43942 | var trailingParts = parts.slice(nameParts.length); |
| 43943 | return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : ".".concat(ts.directorySeparator).concat(trailingParts.join(ts.directorySeparator)), state, cache, redirectedReference); |
| 43944 | } |
| 43945 | function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) { |
| 43946 | if (!scope.packageJsonContent.exports) { |
| 43947 | return undefined; |
no test coverage detected
searching dependent graphs…