Function
mergeCtx
(
payloadCtx: LogContext | undefined,
boundCtx: LogContext,
)
Source from the content-addressed store, hash-verified
| 388 | } |
| 389 | |
| 390 | function mergeCtx( |
| 391 | payloadCtx: LogContext | undefined, |
| 392 | boundCtx: LogContext, |
| 393 | ): LogContext | undefined { |
| 394 | const boundHasKeys = Object.keys(boundCtx).length > 0; |
| 395 | if (!boundHasKeys) return payloadCtx; |
| 396 | if (payloadCtx === undefined) return { ...boundCtx }; |
| 397 | return { ...payloadCtx, ...boundCtx }; |
| 398 | } |
| 399 | |
| 400 | /** |
| 401 | * Root logger. Import and use directly for events that don't belong to any |
Tested by
no test coverage detected