Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function parseImports(content, isIndentedSyntax) {
var tokens = tokenizer.tokenize(content);
var results = [];
var tmp = '';
var inImport = false;
var inParen = false;
var prevToken = tokens[0];
var i, token;
for (i = 1; i < tokens.length; i++) {
token = tokens[i];
if (inImport && !inParen && token[0] === 'string') {
results.push(token[1]);
}
else if (token[1] === 'import' && prevToken[1] === '@') {
if (inImport && !isIndentedSyntax) {
throw new Error('Encountered invalid @import syntax.');