callback of AbstractClass.include may be executed several times
Open
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 238
- PR merge metrics
- No merged PRs in 30d
Description
/lib/include.js line 25: `AbstractClass.include = function (objects, include, cb) {`
If objects length is 0, and include is an array with multiple items, the cb will be executed several times.
While integrating with Express, this will cause the known issue "Can't set headers after they are sent."
To fix it, my suggestion is to add "return" before cb in line 53 as: `return cb(null, objects);`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.