Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} catch (e) {
// In case a previous call had it populated
precinct.ast = null;
debug('could not parse content: %s', e.message);
return dependencies;
}
// SASS files shouldn't be parsed by Acorn
} else {
ast = content;
if (typeof content === 'object') {
precinct.ast = content;
}
}
type = type || getModuleType.fromSource(ast);
debug('module type: ', type);
var theDetective;
var mixedMode = options.es6 && options.es6.mixedImports;
switch (type) {
case 'commonjs':
theDetective = mixedMode ? detectiveEs6Cjs : detectiveCjs;
break;
case 'css':
theDetective = detectivePostcss;
break;
case 'amd':
theDetective = detectiveAmd;
break;
case 'es6':