Skip to content

Commit

Permalink
chore: fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinee21 committed Jul 17, 2020
1 parent 4056324 commit 67169cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions plugins/node/opentelemetry-koa-instrumentation/src/koa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
} from './types';
import { VERSION } from './version';
import { getMiddlewareMetadata } from './utils';
import Router = require('@koa/router');

/** Koa instrumentation for OpenTelemetry */
export class KoaInstrumentation extends BasePlugin<typeof koa> {
Expand Down Expand Up @@ -101,8 +100,7 @@ export class KoaInstrumentation extends BasePlugin<typeof koa> {
const router = dispatchLayer.router;

const routesStack = router?.stack ?? [];
for (let i = 0; i < routesStack.length; i++) {
const pathLayer: Router.Layer = routesStack[i];
for (const pathLayer of routesStack) {
const path = pathLayer.path;
const pathStack = pathLayer.stack;
for (let j = 0; j < pathStack.length; j++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ describe('Koa Instrumentation - Router Tests', () => {

const router = new KoaRouter();
router.get('/post/:id', ctx => {
const id = ctx.params.id;
ctx.body = 'Post id: ' + id;
ctx.body = `Post id: ${ctx.params.id}`;
});

app.use(router.routes());
Expand Down

0 comments on commit 67169cb

Please sign in to comment.