Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove types of the instrumented libs form public apis #1221

Merged
merged 5 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export class DataloaderInstrumentation extends InstrumentationBase {
this._unwrap(dataloader.prototype, 'loadMany');
}
}
),
// cast it to module definition of unknown type to avoid exposing Dataloader types on public APIs
) as InstrumentationNodeModuleDefinition<unknown>,
];
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/node/instrumentation-mongoose/src/mongoose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class MongooseInstrumentation extends InstrumentationBase<any> {
return module;
}

protected patch(
private patch(
moduleExports: typeof mongoose,
moduleVersion: string | undefined
) {
Expand Down Expand Up @@ -127,7 +127,7 @@ export class MongooseInstrumentation extends InstrumentationBase<any> {
return moduleExports;
}

protected unpatch(moduleExports: typeof mongoose): void {
private unpatch(moduleExports: typeof mongoose): void {
this._diag.debug('mongoose instrumentation: unpatch mongoose');
this._unwrap(moduleExports.Model.prototype, 'save');
// revert the patch for $save which we applyed by aliasing it to patched `save`
Expand Down