diff --git a/packages/socket-mode/src/SocketModeClient.ts b/packages/socket-mode/src/SocketModeClient.ts index 08a72f526..786be82ad 100644 --- a/packages/socket-mode/src/SocketModeClient.ts +++ b/packages/socket-mode/src/SocketModeClient.ts @@ -409,7 +409,7 @@ export class SocketModeClient extends EventEmitter { if (body === undefined || body === null) { return body; } - const records = Object.create(body); + const record = Object.create(body); if (Array.isArray(body)) { return body.map((item) => ( (typeof item === 'object' && item !== null) ? @@ -420,14 +420,14 @@ export class SocketModeClient extends EventEmitter { Object.keys(body).forEach((key: string) => { const value = body[key]; if (typeof value === 'object' && value !== null) { - records[key] = SocketModeClient.redact(value as Record); + record[key] = SocketModeClient.redact(value as Record); } else if (key.match(/.*token.*/) !== null || key.match(/secret/)) { - records[key] = '[[REDACTED]]'; + record[key] = '[[REDACTED]]'; } else { - records[key] = value; + record[key] = value; } }); - return records; + return record; } }