Skip to content

Commit

Permalink
fix(bug): handle wildcards like semver
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankcorn committed Sep 28, 2023
1 parent b1fc3a0 commit 6c29fb4
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ import { Hook } from 'require-in-the-middle';
*/
export abstract class InstrumentationBase<T = any>
extends InstrumentationAbstract
implements types.Instrumentation
{
implements types.Instrumentation {
private _modules: InstrumentationModuleDefinition<T>[];
private _hooks: (Hooked | Hook)[] = [];
private _requireInTheMiddleSingleton: RequireInTheMiddleSingleton =
Expand All @@ -62,8 +61,8 @@ export abstract class InstrumentationBase<T = any>
if (this._modules.length === 0) {
diag.debug(
'No modules instrumentation has been defined for ' +
`'${this.instrumentationName}@${this.instrumentationVersion}'` +
', nothing will be patched'
`'${this.instrumentationName}@${this.instrumentationVersion}'` +
', nothing will be patched'
);
}

Expand Down Expand Up @@ -309,6 +308,6 @@ function isSupported(
}

return supportedVersions.some(supportedVersion => {
return satisfies(version, supportedVersion);
return supportedVersion === '*' || satisfies(version, supportedVersion);
});
}

0 comments on commit 6c29fb4

Please sign in to comment.