All files / src handle-function-declaration.js

100% Statements 9/9
87.5% Branches 7/8
100% Functions 1/1
100% Lines 8/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  4x   3x 2x 1x 1x   3x 3x     2x    
function handleFunctionDeclaration(insertKeyFunc, debug, { id, declarations }){
  if(!id && !declarations) throw new Error('handleFunctionDeclaration:id or declarations were not passed')
  let name
  if(id){
    name = id.name
  }else Eif(declarations){
    name = declarations[0].init.callee.name
  }
  debug(`Function: ${name}`)
  insertKeyFunc(name)
}
 
module.exports = {
  handleFunctionDeclaration
}