express-jsdoc-swagger
Version:
Swagger OpenAPI 3.x generator
17 lines (12 loc) • 410 B
JavaScript
const mapDescription = require('./mapDescription');
const getTagInfo = (tags, key) => tags.find(({ title }) => title === key);
const getTagsInfo = (tags, key) => tags.filter(({ title }) => title === key);
const formatDescriptionTag = desc => {
const [name, description] = mapDescription(desc);
return { name, description };
};
module.exports = {
getTagInfo,
getTagsInfo,
formatDescriptionTag,
};