Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushik-rishi committed Apr 30, 2024
1 parent 8bc93ab commit 78f4e44
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions helpers/channels-topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ export function toHermesTopic(str) {
}

export function channelNamesWithReceive(asyncapi) {
const result = asyncapi.channels().filterByReceive().map(channel => channel.id());
return result;
return asyncapi.channels().filterByReceive().map(channel => channel.id());
}

export function host(url) {
Expand Down
2 changes: 1 addition & 1 deletion template/src/api/handlers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default function handlerRender({
${general}
`;

for (let operation of channel.operations()) {
for (const operation of channel.operations()) {
if (operation.isSend()) {
routeHandler += sendHandler(operation);
}
Expand Down
2 changes: 1 addition & 1 deletion template/src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default function indexEntrypointFile({asyncapi, params}) {
const handlers = asyncapi.channels().all().map(channel => {
const channelName = channel.id();
const x = channel.operations().all().map(operation => {
let operationId = operation.id();
const operationId = operation.id();
return `${convertOpertionIdToMiddlewareFn(operationId)} : require('./handlers/${convertToFilename(channelName)}').${convertOpertionIdToMiddlewareFn(operationId)}`
});
return x;
Expand Down
4 changes: 2 additions & 2 deletions template/src/api/routes/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function sendHandler(operation, channelName) {
${
operation.messages().all().map(message => `try {
nValidated = await validateMessage(message.payload,'${ channelName }','${ operation.message(i).name() }','subscribe', nValidated);
nValidated = await validateMessage(message.payload,'${ channelName }','${ message.name() }','subscribe', nValidated);
} catch { };`).join('\n')
}
Expand Down Expand Up @@ -118,7 +118,7 @@ function routeCode(channel) {
${generalImport}
`;

for (let operation of channel.operations()) {
for (const operation of channel.operations()) {
if (operation.isSend()) {
routeHandler += sendHandler(operation, channel.id());
}
Expand Down

0 comments on commit 78f4e44

Please sign in to comment.