Open cmp-ams opened 6 years ago
I worked around the problem by editing index.js:121
and changing it as follows:
if(issue.comments.forEach instanceof Function) issue.comments.forEach(function (comment) {
I was also required to make a similar fix to writehtml.js:60
That definitely helps, although I still get the issue on some repos, such as Wilfred/helpful
. It works on the other repos I've tried though. Here's a diff:
diff --git i/src/index.js w/src/index.js
index 88d11fb..6d036e0 100644
--- i/src/index.js
+++ w/src/index.js
@@ -118,7 +118,7 @@ module.exports = function (token, options, cb) {
if (err) return cb(err, 'Error in request for comments.')
issue.comments = body
- issue.comments.forEach(function (comment) {
+ if(issue.comments.forEach instanceof Function) issue.comments.forEach(function (comment) {
comment.created_at = new Date(comment.created_at).toLocaleDateString()
})
issueData.push(issue)
diff --git i/src/writehtml.js w/src/writehtml.js
index 721a1ff..085649c 100644
--- i/src/writehtml.js
+++ w/src/writehtml.js
@@ -63,9 +63,12 @@ function repoDetails (issue) {
function parseBody (issue) {
if (issue.body === null) issue.body = ''
else issue.body = marked(issue.body)
- issue.comments = issue.comments.map(function (issue) {
- issue.body = marked(issue.body)
- return issue
- })
+
+ if(issue.comments.map instanceof Function) {
+ issue.comments = issue.comments.map(function (issue) {
+ issue.body = marked(issue.body)
+ return issue
+ })
+ }
return issue
}
Hello,
Executing the following command ends in an error:
Any idea on how to get around this?
Thanks!