Skip to content

Commit

Permalink
fix isInstrumented
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr committed Apr 3, 2024
1 parent f599f14 commit 1438e53
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lib/shimmer.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ const shimmer = (module.exports = {
},

/**
* Checks all registered instrumentation for a module and returns true
* Checks all registered instrumentations for a module and returns true
* only if every hook succeeded.
*
* @param {string} moduleName name of registered instrumentation
Expand All @@ -476,13 +476,12 @@ const shimmer = (module.exports = {
* module
*/
isInstrumented(moduleName, resolvedName) {
const items = shimmer.registeredInstrumentations
.getAllByName(moduleName)
.filter(
(item) =>
item.instrumentation.resolvedName === resolvedName && item.meta.instrumented === true
)
return items.length > 0
const allItems = shimmer.registeredInstrumentations.getAllByName(moduleName)
const items = allItems.filter(
(item) =>
item.instrumentation.resolvedName === resolvedName && item.meta.instrumented === true
)
return items.length === allItems.length
},

instrumentPostLoad(agent, module, moduleName, resolvedName, returnModule = false) {
Expand Down

0 comments on commit 1438e53

Please sign in to comment.