Skip to content

Commit

Permalink
fix: remove types of the instrumented libs form public apis (#1221)
Browse files Browse the repository at this point in the history
* fix: remove types of the instrumented libs form public apis

* fix: revert mongoose instrumentation utils.ts change

Co-authored-by: Amir Blum <amir@aspecto.io>
  • Loading branch information
rauno56 and Amir Blum authored Oct 19, 2022
1 parent 6300733 commit 682d610
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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

0 comments on commit 682d610

Please sign in to comment.