@asyncapi/parser
Advanced tools
Comparing version 1.15.0-2022-04-release.2 to 1.15.0-2022-04-release.3
@@ -13,2 +13,3 @@ const { createMapOfType, getMapValueOfType, mix } = require('./utils'); | ||
const MessageTrait = require('./message-trait'); | ||
const ServerVariable = require('./server-variable'); | ||
@@ -223,4 +224,29 @@ const MixinSpecificationExtensions = require('../mixins/specification-extensions'); | ||
} | ||
/** | ||
* | ||
* @returns {Object<string, ServerVariable>} | ||
*/ | ||
serverVariables() { | ||
return createMapOfType(this._json.serverVariables, ServerVariable); | ||
} | ||
/** | ||
* | ||
* @returns {boolean} | ||
*/ | ||
hasServerVariables() { | ||
return !!this._json.serverVariables; | ||
} | ||
/** | ||
* | ||
* @param {string} name - Name of the server variable. | ||
* @returns {ServerVariable} | ||
*/ | ||
serverVariable(name) { | ||
return getMapValueOfType(this._json.serverVariables, name, ServerVariable); | ||
} | ||
} | ||
module.exports = mix(Components, MixinSpecificationExtensions); |
{ | ||
"name": "@asyncapi/parser", | ||
"version": "1.15.0-2022-04-release.2", | ||
"version": "1.15.0-2022-04-release.3", | ||
"description": "JavaScript AsyncAPI parser.", | ||
@@ -70,3 +70,3 @@ "main": "lib/index.js", | ||
"@apidevtools/json-schema-ref-parser": "^9.0.6", | ||
"@asyncapi/specs": "v2.14.0-2022-04-release.1", | ||
"@asyncapi/specs": "^v2.14.0-2022-04-release.2", | ||
"@fmvilas/pseudo-yaml-ast": "^0.3.1", | ||
@@ -98,2 +98,6 @@ "ajv": "^6.10.1", | ||
"prerelease": true | ||
}, | ||
{ | ||
"name": "next-major-spec", | ||
"prerelease": true | ||
} | ||
@@ -100,0 +104,0 @@ ], |
@@ -467,2 +467,10 @@ /** | ||
messageTrait(name: string): MessageTrait; | ||
serverVariables(): { | ||
[key: string]: ServerVariable; | ||
}; | ||
hasServerVariables(): boolean; | ||
/** | ||
* @param name - Name of the server variable. | ||
*/ | ||
serverVariable(name: string): ServerVariable; | ||
hasExtensions(): boolean; | ||
@@ -469,0 +477,0 @@ extensions(): { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1289245
8208
+ Added@asyncapi/specs@2.14.0(transitive)