export-loader
Version:
A webpack loader that allowes to write a Golang style exports.
15 lines (14 loc) • 403 B
JavaScript
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 if(declarations){
name = declarations[0].init.callee.name
}
debug(`Function: ${name}`)
insertKeyFunc(name)
}
module.exports = {
handleFunctionDeclaration
}