🎨 Format ternaries
This commit is contained in:
parent
8dfaa5619f
commit
752c8f97e6
1 changed files with 4 additions and 2 deletions
|
@ -40,7 +40,8 @@ exports.initializeSchemaVersion = (message) => {
|
|||
}
|
||||
|
||||
const numAttachments = Array.isArray(message.attachments)
|
||||
? message.attachments.length : 0;
|
||||
? message.attachments.length
|
||||
: 0;
|
||||
const hasAttachments = numAttachments > 0;
|
||||
if (!hasAttachments) {
|
||||
return Object.assign(
|
||||
|
@ -54,7 +55,8 @@ exports.initializeSchemaVersion = (message) => {
|
|||
// the first one:
|
||||
const firstAttachment = message.attachments[0];
|
||||
const inheritedSchemaVersion = SchemaVersion.isValid(firstAttachment.schemaVersion)
|
||||
? firstAttachment.schemaVersion : INITIAL_SCHEMA_VERSION;
|
||||
? firstAttachment.schemaVersion
|
||||
: INITIAL_SCHEMA_VERSION;
|
||||
const messageWithInitialSchema = Object.assign(
|
||||
{},
|
||||
message,
|
||||
|
|
Loading…
Reference in a new issue