Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// export var name = value
case Syntax.VariableDeclaration:
utils.move(node.declaration.range[0], state);
node.declaration.declarations.forEach(function(declaration) {
utils.catchup(declaration.id.range[1], state);
utils.append(' = module.exports.' + declaration.id.name, state);
traverse(declaration.init, path, state);
});
break;
case Syntax.FunctionDeclaration:
name = node.declaration.id.name;
utils.move(node.declaration.range[0], state);
traverse(node.declaration, path, state);
utils.append(' module.exports.' + name + ' = ' + name + ';', state);
break;
case Syntax.ClassDeclaration:
name = node.declaration.id.name;
utils.move(node.declaration.range[0], state);
traverse(node.declaration, path, state);
utils.append('module.exports.' + name + ' = ' + name + ';', state);
break;
default:
assert(false, "unknown declaration: " + node.declaration.type);
}
}
} else if (node.source) {
var modID;
// export * from "module"
if (node.specifiers.length === 1 &&
visitClassDeclaration.test = function(object, path, state) {
return object.type === Syntax.ClassDeclaration;
};
visitClassDeclaration.test = function(node, path, state) {
return node.type === Syntax.ClassDeclaration;
};
visitClassDeclaration.test = function(node, path, state) {
return node.type === Syntax.ClassDeclaration;
};
visitClassDeclaration.test = function(node, path, state) {
return node.type === Syntax.ClassDeclaration;
};
visitClassDeclaration.test = function(node, path, state) {
return node.type === Syntax.ClassDeclaration;
};
visitClassDeclaration.test = function(node, path, state) {
return node.type === Syntax.ClassDeclaration;
};