Skip to content

Commit

Permalink
style: rename the object records to be the singular record
Browse files Browse the repository at this point in the history
  • Loading branch information
zimeg committed Jun 25, 2024
1 parent b4718d8 commit e7a1166
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/socket-mode/src/SocketModeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ export class SocketModeClient extends EventEmitter {
if (body === undefined || body === null) {
return body;
}

Check warning on line 411 in packages/socket-mode/src/SocketModeClient.ts

View check run for this annotation

Codecov / codecov/patch

packages/socket-mode/src/SocketModeClient.ts#L410-L411

Added lines #L410 - L411 were not covered by tests
const records = Object.create(body);
const record = Object.create(body);
if (Array.isArray(body)) {
return body.map((item) => (
(typeof item === 'object' && item !== null) ?
Expand All @@ -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<string, unknown>);
record[key] = SocketModeClient.redact(value as Record<string, unknown>);
} 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;
}
}

Expand Down

0 comments on commit e7a1166

Please sign in to comment.