Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.processController = function(code, file) {
var baseController = '',
moduleCodes = '',
newCode = '',
exportSpecifiers = [];
try {
var ast = babylon.parse(code, { sourceFilename: file, sourceType: 'unambiguous' });
const hub = new Hub();
hub.buildError = function (node, message, Error) {
const loc = node && node.loc;
const err = new Error(message);
if (loc) {
err.loc = loc.start;
}
return err;
};
const path = NodePath.get({
hub: hub,
parent: ast,
container: ast,
key: 'program'
}).setContext();