Patch methods of an object or prototype in place, e.g. a database client:
instrumentMethods(tp, pg.Client.prototype, ['query'], { labelFor: (_m, [q]) => pg ${String(q?.text ?? q).trim().split(/\s+/)[0]}, });
pg ${String(q?.text ?? q).trim().split(/\s+/)[0]}
methods defaults to every own function property except the constructor.
methods
Optional
Patch methods of an object or prototype in place, e.g. a database client:
instrumentMethods(tp, pg.Client.prototype, ['query'], { labelFor: (_m, [q]) =>
pg ${String(q?.text ?? q).trim().split(/\s+/)[0]}, });methodsdefaults to every own function property except the constructor.