Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

chore: updated recordParamware to construct spec #175

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions lib/router-instrumentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@ module.exports = function instrumentRouter(shim, Router) {
}

function wrapParamware(shim, paramware, fnName, route) {
return shim.recordParamware(paramware, {
name: route,
next: shim.LAST,
promise: true,
appendPath: false,
req: function getReq(shim, fn, _fnName, args) {
return args[1] && args[1].req
}
})
return shim.recordParamware(
paramware,
new shim.specs.MiddlewareSpec({
name: route,
next: shim.LAST,
promise: true,
appendPath: false,
req: function getReq(shim, fn, _fnName, args) {
return args[1] && args[1].req
}
})
)
}

function wrapMiddleware(shim, fn, name, layer) {
Expand Down
Loading