File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ export const createLogger = (
7979 ...parentContext ,
8080 } ;
8181 } else {
82- context = parentContext || defaultContext ;
82+ context = parentContext ?? defaultContext ;
8383 }
8484 } else {
8585 context = {
@@ -161,7 +161,7 @@ export const createLogger = (
161161 log . getContext = ( ) => {
162162 return {
163163 ...getAsyncLocalContext ( ) ,
164- ...parentContext || defaultContext ,
164+ ...parentContext ?? defaultContext ,
165165 } ;
166166 } ;
167167
Original file line number Diff line number Diff line change @@ -2,9 +2,13 @@ import type {
22 AsyncLocalStorage ,
33} from 'async_hooks' ;
44
5+ export type JsonObject = { [ key : string ] : JsonValue , } ;
6+
7+ export type JsonValue = JsonObject | JsonValue [ ] | boolean | number | string | null ;
8+
59export type LogWriter = ( message : string ) => void ;
610
7- export type MessageContext = any ;
11+ export type MessageContext = JsonObject ;
812
913export type RoarrGlobalState = {
1014 asyncLocalStorage ?: AsyncLocalStorage < MessageContext > ,
You can’t perform that action at this time.
0 commit comments