Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
onurtemizkan committed Nov 28, 2024
1 parent 4b699a5 commit 71e08b3
Showing 1 changed file with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ export class PgInstrumentation extends InstrumentationBase<PgInstrumentationConf
(module: any) => {
this._unpatchPgClient(module.Client);
return module;
}, [modulePgClient, modulePgNativeClient]
},
[modulePgClient, modulePgNativeClient]
);

const modulePGPool = new InstrumentationNodeModuleDefinition(
Expand All @@ -185,9 +186,7 @@ export class PgInstrumentation extends InstrumentationBase<PgInstrumentationConf
return [modulePG, modulePGPool];
}

private _patchPgClient(
module: any,
) {
private _patchPgClient(module: any) {
const moduleExports = extractModuleExports(module);

if (isWrapped(moduleExports.prototype.query)) {
Expand All @@ -213,9 +212,7 @@ export class PgInstrumentation extends InstrumentationBase<PgInstrumentationConf
return module;
}

private _unpatchPgClient(
module: any,
) {
private _unpatchPgClient(module: any) {
const moduleExports = extractModuleExports(module);

if (isWrapped(moduleExports.prototype.query)) {
Expand All @@ -229,7 +226,6 @@ export class PgInstrumentation extends InstrumentationBase<PgInstrumentationConf
return module;
}


private _getClientConnectPatch() {
const plugin = this;
return (original: PgClientConnect) => {
Expand Down Expand Up @@ -312,12 +308,12 @@ export class PgInstrumentation extends InstrumentationBase<PgInstrumentationConf
// to properly narrow arg0, but TS 4.3.5 does not.
const queryConfig = firstArgIsString
? {
text: arg0 as string,
values: Array.isArray(args[1]) ? args[1] : undefined,
}
text: arg0 as string,
values: Array.isArray(args[1]) ? args[1] : undefined,
}
: firstArgIsQueryObjectWithText
? (arg0 as utils.ObjectWithText)
: undefined;
? (arg0 as utils.ObjectWithText)
: undefined;

const attributes: Attributes = {
[SEMATTRS_DB_SYSTEM]: DBSYSTEMVALUES_POSTGRESQL,
Expand Down

0 comments on commit 71e08b3

Please sign in to comment.