Created
September 18, 2015 13:58
-
-
Save sebmck/07f5feabb52feb39481d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const parsed = { type: "File", program: parse(unsorted) }; | |
// Find all imports | |
let imports = [] | |
traverse(parsed, { | |
ImportDeclaration(node, parent) { | |
imports.push({node, text: unsorted.substring(node.start, node.end)}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment