2015-11-09 13:08:56 -05:00

22 lines
512 B
JavaScript

'use strict';
var walk = require('../walk');
/**
* Formats documentation as a JSON string.
*
* @param {Array<Object>} comments parsed comments
* @param {Object} opts Options that can customize the output
* @param {Function} callback called with null, string
* @name json
* @return {undefined} calls callback
*/
module.exports = function (comments, opts, callback) {
walk(comments, function (comment) {
delete comment.errors;
});
return callback(null, JSON.stringify(comments, null, 2));
};