| 1 | module.exports = function convertComments(comments) { |
| 2 | for (const comment of comments) { |
| 3 | if (comment.type === "CommentBlock") { |
| 4 | comment.type = "Block"; |
| 5 | } else if (comment.type === "CommentLine") { |
| 6 | comment.type = "Line"; |
| 7 | } |
| 8 | // sometimes comments don't get ranges computed, |
| 9 | // even with options.ranges === true |
| 10 | if (!comment.range) { |
| 11 | comment.range = [comment.start, comment.end]; |
| 12 | } |
| 13 | } |
| 14 | }; |