fix(utils): resolve TypeScript compilation errors
- baileys-event-stream.ts: Add null check for buffer item in priority insertion - baileys-logger.ts: Handle 'silent' log level and fix JID sanitization - cache-utils.ts: Fix type incompatibility in global cache with any type - logger-adapter.ts: Add nullish coalescing for level mapping and fix console type cast - prometheus-metrics.ts: Rename private 'metrics' property to 'metricsMap' to avoid conflict with method - trace-context.ts: Store baggage header in variable before accessing to fix undefined check
This commit is contained in:
@@ -500,11 +500,12 @@ export function withCache<T extends (...args: unknown[]) => unknown>(
|
||||
/**
|
||||
* Global singleton cache by namespace
|
||||
*/
|
||||
const globalCaches: Map<string, Cache<unknown>> = new Map()
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const globalCaches: Map<string, Cache<any>> = new Map()
|
||||
|
||||
export function getGlobalCache<V>(namespace: string, options?: CacheOptions<V>): Cache<V> {
|
||||
if (!globalCaches.has(namespace)) {
|
||||
globalCaches.set(namespace, new Cache<V>({ ...options, namespace }))
|
||||
globalCaches.set(namespace, new Cache<V>({ ...options, namespace }) as Cache<V>)
|
||||
}
|
||||
return globalCaches.get(namespace) as Cache<V>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user