Skip to content

Commit

Permalink
resolve type mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
KhudaDad414 committed Aug 30, 2023
1 parent 49183a4 commit d85452f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/models/v2/asyncapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ export class AsyncAPIDocument extends BaseModel<v2.AsyncAPIObject> implements As
}

allServers(): ServersInterface {
const servers: ServerInterface[] = this.servers();
const servers: ServerInterface[] = this.servers().all();
this.components().servers().forEach(server =>
!servers.some(s => s.json() === server.json()) && servers.push(server)
);
return new Servers(servers);
}

allChannels(): ChannelsInterface {
const channels: ChannelInterface[] = this.channels();
const channels: ChannelInterface[] = this.channels().all();
this.components().channels().forEach(channel =>
!channels.some(c => c.json() === channel.json()) && channels.push(channel)
);
Expand Down
4 changes: 2 additions & 2 deletions src/models/v3/asyncapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ export class AsyncAPIDocument extends BaseModel<v3.AsyncAPIObject> implements As
}

allServers(): ServersInterface {
const servers: ServerInterface[] = this.servers();
const servers: ServerInterface[] = this.servers().all();
this.components().servers().forEach(server =>
!servers.some(s => s.json() === server.json()) && servers.push(server)
);
return new Servers(servers);
}

allChannels(): ChannelsInterface {
const channels: ChannelInterface[] = this.channels();
const channels: ChannelInterface[] = this.channels().all();
this.components().channels().forEach(channel =>
!channels.some(c => c.json() === channel.json()) && channels.push(channel)
);
Expand Down

0 comments on commit d85452f

Please sign in to comment.