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:
Claude
2026-01-20 02:05:14 +00:00
parent a934be9bc9
commit dd59a7fe65
6 changed files with 35 additions and 19 deletions
+6 -3
View File
@@ -554,11 +554,14 @@ export function extractTraceHeaders(headers: Record<string, string | undefined>)
}
// Parse baggage
if (headers[TRACE_HEADERS.BAGGAGE]) {
const baggageHeader = headers[TRACE_HEADERS.BAGGAGE]
if (baggageHeader) {
options.baggage = {}
const pairs = headers[TRACE_HEADERS.BAGGAGE].split(',')
const pairs = baggageHeader.split(',')
for (const pair of pairs) {
const [key, value] = pair.split('=')
const parts = pair.split('=')
const key = parts[0]
const value = parts[1]
if (key && value) {
options.baggage[key.trim()] = decodeURIComponent(value.trim())
}