diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 4593902..9bccdbf 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -1,5 +1,4 @@ import { bunyamin, isDebug, threadGroups } from 'bunyamin'; -import { noop } from './noop'; threadGroups.add({ id: 'ipc-server', displayName: 'IPC Server (jest-metadata)' }); threadGroups.add({ id: 'ipc-client', displayName: 'IPC Client (jest-metadata)' }); @@ -14,8 +13,10 @@ function isTraceEnabled(): boolean { return isDebug('jest-metadata'); } -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export const optimizeTracing: (f: F) => F = isTraceEnabled() ? (f) => f : ((() => noop) as any); +const EMPTY = {}; +const NOOP: any = () => EMPTY; + +export const optimizeTracing: (f: F) => F = isTraceEnabled() ? (f) => f : () => NOOP; export const logger = bunyamin.child({ cat: 'jest-metadata' }); diff --git a/src/utils/noop.ts b/src/utils/noop.ts deleted file mode 100644 index dbad2ad..0000000 --- a/src/utils/noop.ts +++ /dev/null @@ -1,4 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -export const noop: (...args: any[]) => any = () => { - /* no-op */ -};