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:
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user