mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-18 14:17:30 +00:00
22 lines
512 B
JavaScript
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));
|
|
};
|