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

26 lines
562 B
JavaScript

const { getMapValueOfType } = require('../models/utils');
const ExternalDocs = require('../models/external-docs');
/**
* Implements functions to deal with the ExternalDocs object.
* @mixin
*/
const MixinExternalDocs = {
/**
* @returns {boolean}
*/
hasExternalDocs() {
return !!(this._json.externalDocs && Object.keys(this._json.externalDocs).length);
},
/**
* @returns {(ExternalDocs | null)}
*/
externalDocs() {
return getMapValueOfType(this._json, 'externalDocs', ExternalDocs);
},
};
module.exports = MixinExternalDocs;