Skip to content

Commit 8560275

Browse files
committed
Rename variable to clearify intent
1 parent d146919 commit 8560275

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/agent/hooks/wrapRequire.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ function patchPackage(this: mod, id: string, originalExports: unknown) {
183183
const moduleName = pathInfo.name;
184184

185185
// Get all versioned packages for the module name
186-
const versionedPackages = packages
186+
const versionedPackagesToInstrument = packages
187187
.filter((pkg) => pkg.getName() === moduleName)
188188
.map((pkg) => pkg.getVersions())
189189
.flat();
@@ -210,13 +210,13 @@ function patchPackage(this: mod, id: string, originalExports: unknown) {
210210
agent?.onPackageRequired(moduleName, installedPkgVersion);
211211

212212
// We don't want to patch this package because we do not have any hooks for it
213-
if (!versionedPackages.length) {
213+
if (!versionedPackagesToInstrument.length) {
214214
return originalExports;
215215
}
216216

217217
// Check if the installed package version is supported (get all matching versioned packages)
218-
const matchingVersionedPackages = versionedPackages.filter((pkg) =>
219-
satisfiesVersion(pkg.getRange(), installedPkgVersion)
218+
const matchingVersionedPackages = versionedPackagesToInstrument.filter(
219+
(pkg) => satisfiesVersion(pkg.getRange(), installedPkgVersion)
220220
);
221221

222222
// Report to the agent that the package was wrapped or not if it's version is not supported

0 commit comments

Comments
 (0)