@middy/input-output-logger
Advanced tools
Comparing version 5.0.2 to 5.0.3
10
index.js
@@ -30,4 +30,3 @@ const defaults = { | ||
if (omitPaths.length) { | ||
cloneMessage = structuredClone(message, replacer) // Full clone to prevent nested mutations | ||
; | ||
cloneMessage = structuredClone(message, replacer); | ||
omit(cloneMessage, { | ||
@@ -70,3 +69,2 @@ [param]: omitPathTree[param] | ||
}; | ||
// https://docs.aws.amazon.com/lambda/latest/dg/nodejs-context.html | ||
const awsContextKeys = [ | ||
@@ -84,7 +82,5 @@ 'functionName', | ||
]; | ||
// move to util, if ever used elsewhere | ||
const pick = (originalObject = {}, keysToPick = [])=>{ | ||
const newObject = {}; | ||
for (const path of keysToPick){ | ||
// only supports first level | ||
if (originalObject[path] !== undefined) { | ||
@@ -99,7 +95,5 @@ newObject[path] = originalObject[path]; | ||
for (let path of paths.sort().reverse()){ | ||
// reverse to ensure conflicting paths don't cause issues | ||
if (!Array.isArray(path)) path = path.split('.'); | ||
if (path.includes('__proto__')) continue; | ||
path.slice(0) // clone | ||
.reduce((a, b, idx)=>{ | ||
path.slice(0).reduce((a, b, idx)=>{ | ||
if (idx < path.length - 1) { | ||
@@ -106,0 +100,0 @@ a[b] ??= {}; |
{ | ||
"name": "@middy/input-output-logger", | ||
"version": "5.0.2", | ||
"version": "5.0.3", | ||
"description": "Input and output logger middleware for the middy framework", | ||
@@ -63,6 +63,6 @@ "type": "module", | ||
"devDependencies": { | ||
"@middy/core": "5.0.2", | ||
"@middy/core": "5.0.3", | ||
"@types/node": "^20.0.0" | ||
}, | ||
"gitHead": "6d17e155237022f2a0abd095ac7cd99ebfc7fc71" | ||
"gitHead": "87660575a7ac2b52e4153c407a4c63c9449dcd0d" | ||
} |
9247
116