Skip to content

Commit

Permalink
🐛 Support inner access to a library
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuLemoine committed Oct 26, 2018
1 parent 3d9146d commit 03f673e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remnants",
"version": "1.2.0",
"version": "1.2.1",
"description": "Find unused files. Spot these residues, leftovers, relics of an ancient past.",
"main": "index.js",
"module": "src/index.js",
Expand Down
10 changes: 8 additions & 2 deletions src/resolver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ const findImports = filePaths => filePaths.map((filePath) => {
if (found[1][0] === '.') {
founds.push(found[1]);
} else {
usedDependencies[found[1]] = true;
const splits = found[1].split('/');
usedDependencies[
found[1][0] === '@' ? splits.slice(0, 2).join('/') : splits[0]
] = true;
}
found = importRegex.exec(content);
}
Expand All @@ -66,7 +69,10 @@ const findImports = filePaths => filePaths.map((filePath) => {
if (found[1][0] === '.') {
founds.push(found[1]);
} else {
usedDependencies[found[1]] = true;
const splits = found[1].split('/');
usedDependencies[
found[1][0] === '@' ? splits.slice(0, 2).join('/') : splits[0]
] = true;
}
found = requireRegex.exec(content);
}
Expand Down

0 comments on commit 03f673e

Please sign in to comment.