lib/process-node.js
function processNode(node) {

  // check if the function is part of a variable assignment
  var isVarAssignment = (node.parent.type === 'VariableDeclarator');

  // the parameters of the function, converted to literal strings
  var params = node.params
    .map(paramToLiteral);

  // [ 'arg', ..., function(arg) {} ]
  //  place inline
  if ((node.type === 'FunctionExpression') && !isVarAssignment) {
    esprimaTools.nodeSplicer(node)({
      parent  : node.parent,
      type    : 'ArrayExpression',
      elements: params.concat(node)
    });
  }

  // fn.$inject = [ 'arg', ... ]
  //  hoist before any intervening return statement
  else {
    var appendTo = isVarAssignment ? node.parent.parent : node;
    esprimaTools.nodeSplicer(appendTo, offset)({
      type      : 'ExpressionStatement',
      expression: {
        type    : 'AssignmentExpression',
        operator: '=',
        left    : {
          type    : 'MemberExpression',
          computed: false,
          object  : {
            type: 'Identifier',
            name: node.id.name
          },
          property: {
            type: 'Identifier',
            name: '$inject'
          }
        },
        right   : {
          type    : 'ArrayExpression',
          elements: params
        }
      }
    });
  }
}
function processNode(node) {

  // check if the function is part of a variable assignment
  var isVarAssignment = (node.parent.type === 'VariableDeclarator');

  // the parameters of the function, converted to literal strings
  var params = node.params
    .map(paramToLiteral);

  // [ 'arg', ..., function(arg) {} ]
  //  place inline
  if ((node.type === 'FunctionExpression') && !isVarAssignment) {
    esprimaTools.nodeSplicer(node)({
      parent  : node.parent,
      type    : 'ArrayExpression',
      elements: params.concat(node)
    });
  }

  // fn.$inject = [ 'arg', ... ]
  //  hoist before any intervening return statement
  else {
    var appendTo = isVarAssignment ? node.parent.parent : node;
    esprimaTools.nodeSplicer(appendTo, offset)({
      type      : 'ExpressionStatement',
      expression: {
        type    : 'AssignmentExpression',
        operator: '=',
        left    : {
          type    : 'MemberExpression',
          computed: false,
          object  : {
            type: 'Identifier',
            name: node.id.name
          },
          property: {
            type: 'Identifier',
            name: '$inject'
          }
        },
        right   : {
          type    : 'ArrayExpression',
          elements: params
        }
      }
    });
  }
}
Add explicit dependency statements to the node.
@param {object} node An esprima AST function-type node