charlike
Version:
Small, fast, simple and streaming project scaffolder for myself, but not only. Supports hundreds of template engines through the @JSTransformers API or if you want custom `render` function passed through options
15 lines (12 loc) • 436 B
JavaScript
/**
* Library: Has Promis eCallback
* Makes sure that an Expression node is part of a promise
* with callback functions (like then() or catch())
*/
function hasPromiseCallback (node) {
if (node.type !== 'CallExpression') return
if (node.callee.type !== 'MemberExpression') return
var propertyName = node.callee.property.name
return propertyName === 'then' || propertyName === 'catch'
}
module.exports = hasPromiseCallback