Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@asyncapi/parser

Package Overview
Dependencies
Maintainers
3
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asyncapi/parser - npm Package Compare versions

Comparing version 2.1.0-next-major-spec.8 to 2.1.0-next-major-spec.9

18

cjs/models/v3/message.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Message = void 0;
const channel_1 = require("./channel");
const channels_1 = require("./channels");

@@ -46,9 +47,11 @@ const operations_1 = require("./operations");

channels() {
var _a, _b;
const channels = [];
const channelData = [];
const channelsData = [];
this.operations().forEach(operation => {
operation.channels().forEach(channel => {
const channelsData = channel.json();
if (!channelData.includes(channelsData)) {
channelData.push(channelsData);
const channelData = channel.json();
// Comparing with the data (JSON) because same channel could exist but it will include the ID based on where it is declared. For example, asyncapi.channels contain ID field.
if (!channelsData.includes(channelData)) {
channelsData.push(channelData);
channels.push(channel);

@@ -58,2 +61,9 @@ }

});
Object.entries(((_b = (_a = this._meta.asyncapi) === null || _a === void 0 ? void 0 : _a.parsed) === null || _b === void 0 ? void 0 : _b.channels) || {}).forEach(([channelId, channelData]) => {
const channelModel = this.createModel(channel_1.Channel, channelData, { id: channelId, pointer: `/channels/${channelId}` });
if (!channelsData.includes(channelData) && channelModel.messages().some(m => m.json() === this._json)) {
channelsData.push(channelData);
channels.push(channelModel);
}
});
return new channels_1.Channels(channels);

@@ -60,0 +70,0 @@ }

@@ -0,1 +1,2 @@

import { Channel } from './channel';
import { Channels } from './channels';

@@ -43,9 +44,11 @@ import { Operations } from './operations';

channels() {
var _a, _b;
const channels = [];
const channelData = [];
const channelsData = [];
this.operations().forEach(operation => {
operation.channels().forEach(channel => {
const channelsData = channel.json();
if (!channelData.includes(channelsData)) {
channelData.push(channelsData);
const channelData = channel.json();
// Comparing with the data (JSON) because same channel could exist but it will include the ID based on where it is declared. For example, asyncapi.channels contain ID field.
if (!channelsData.includes(channelData)) {
channelsData.push(channelData);
channels.push(channel);

@@ -55,2 +58,9 @@ }

});
Object.entries(((_b = (_a = this._meta.asyncapi) === null || _a === void 0 ? void 0 : _a.parsed) === null || _b === void 0 ? void 0 : _b.channels) || {}).forEach(([channelId, channelData]) => {
const channelModel = this.createModel(Channel, channelData, { id: channelId, pointer: `/channels/${channelId}` });
if (!channelsData.includes(channelData) && channelModel.messages().some(m => m.json() === this._json)) {
channelsData.push(channelData);
channels.push(channelModel);
}
});
return new Channels(channels);

@@ -57,0 +67,0 @@ }

{
"name": "@asyncapi/parser",
"version": "2.1.0-next-major-spec.8",
"version": "2.1.0-next-major-spec.9",
"description": "JavaScript AsyncAPI parser.",

@@ -5,0 +5,0 @@ "bugs": {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc