File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ const headerRedact = fastRedact({
1919 '["x-forwarded-for"]' ,
2020 '["proxy-authorization"]'
2121 ] ,
22- serialize : ( val ) => JSON . parse ( JSON . stringify ( val ) )
22+ serialize : ( val ) => typeof structuredClone === 'function'
23+ ? structuredClone ( val )
24+ : JSON . parse ( JSON . stringify ( val ) )
2325} )
2426
2527const rawSymbol = Symbol ( 'pino-raw-req-ref' )
Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ const headerRedact = fastRedact({
1313 '["x-real-ip"]' ,
1414 '["x-forwarded-for"]'
1515 ] ,
16- serialize : ( val ) => JSON . parse ( JSON . stringify ( val ) )
16+ serialize : ( val ) => typeof structuredClone === 'function'
17+ ? structuredClone ( val )
18+ : JSON . parse ( JSON . stringify ( val ) )
1719} )
1820
1921const rawSymbol = Symbol ( 'pino-raw-res-ref' )
You can’t perform that action at this time.
0 commit comments