-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f8321d
commit 7dc58a2
Showing
14 changed files
with
376 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
const importModuleRegexp = /^import [^'"]* from ['"]([^'"\n ][^'"\n ]*)['"]/gm; | ||
|
||
function extractImports(code, ignoredModules = []) { | ||
return (code.match(importModuleRegexp) || []) | ||
.map((x) => x.replace(importModuleRegexp, '$1')) | ||
.filter((x) => !ignoredModules.includes(x)); | ||
function extractImports(code) { | ||
return (code.match(importModuleRegexp) || []).map((x) => x.replace(importModuleRegexp, '$1')); | ||
} | ||
|
||
module.exports = { | ||
extractImports, | ||
}; | ||
module.exports = extractImports; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.