function translateCode(code) {
  // Replace 'postman' with 'pm' using regex before creating the AST
  // This is more efficient than an AST traversal
  code = code.replace(/\bpostman\b/g, 'pm');
  
  const ast = j(code);
  
  // Keep track of transformed nodes to avoid double-processing
  const transformedNodes = new Set();

  // Preprocess the code to resolve all aliases
  preprocessAliases(ast);

  // Process all transformations in a single pass
  processTransformations(ast, transformedNodes);
  
  // Handle special Postman syntax patterns
  handleTestsBracketNotation(ast);
  
  return ast.toSource();
}
Translates Postman script code to Bruno script code
@param {string} code - The Postman script code to translate
@returns {string} The translated Bruno script code