Files
nats-python/openapi_templete/node_modules/@asyncapi/parser/lib/mixins/description.js
T
2026-06-01 13:17:37 +02:00

24 lines
425 B
JavaScript

const { getMapValueByKey } = require('../models/utils');
/**
* Implements functions to deal with the description field.
* @mixin
*/
const MixinDescription = {
/**
* @returns {boolean}
*/
hasDescription() {
return !!this._json.description;
},
/**
* @returns {(string | null)}
*/
description() {
return getMapValueByKey(this._json, 'description');
},
};
module.exports = MixinDescription;