als-request
Version:
versatile HTTP client offering enhanced features for Node.js with functionality for speed limitation with events, CORS management, stream support, automatic data preparation, error and response handling, and more
14 lines (13 loc) • 378 B
JavaScript
const errorHandler = require('../error-handler')
module.exports = function canResponse(req,requester,processing,url,errors) {
if(!requester) return false
if(!req) {
errors.push(errorHandler({code:'NOREQ',url}))
return false
}
if(processing ) {
errors.push(errorHandler({code:'RESDOUBLE',url}))
return false
}
return true
}