Skip to content

Commit

Permalink
Remove TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
drewcorlin1 committed May 26, 2024
1 parent e106c9a commit 6138634
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 1 addition & 6 deletions packages/esbuild-plugin-node/src/config/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentation
function getModuleDefinitions(
instrumentation: Instrumentation
): InstrumentationModuleDefinition[] {
if (
// 'getModuleDefinitions' in instrumentation &&
// typeof instrumentation.getModuleDefinitions === 'function'
instrumentation instanceof InstrumentationBase
) {
if (instrumentation instanceof InstrumentationBase) {
return instrumentation.getModuleDefinitions() ?? [];
}

Expand Down Expand Up @@ -71,7 +67,6 @@ export function getOtelPackageToInstrumentationConfig() {
{
oTelInstrumentationPackage:
instrumentation.instrumentationName as keyof EsbuildInstrumentationConfigMap,
// TODO: Do we need to worry about minification/obfuscation messing with this class name?
oTelInstrumentationClass: instrumentation.constructor.name,
configGenerator,
};
Expand Down
6 changes: 3 additions & 3 deletions packages/esbuild-plugin-node/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export interface ModuleParams {
}

type _RemoveFunctions<T> = {
// TODO: Mabye:
// [P in keyof T as T[P] extends (...args: unknown[]) => unknown ? never : P]: T[P];
[P in keyof T as T[P] extends (...args: any) => any ? never : P]: T[P];
[P in keyof T as T[P] extends (...args: unknown[]) => unknown
? never
: P]: T[P];
};

// _RemoveFunctions does not work on optional fields, so first make the type required then apply Partial to the result
Expand Down

0 comments on commit 6138634

Please sign in to comment.