Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/analyze-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/database-upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ export async function cleanupAndUploadDatabases(
reports.push({
language,
error: util.getErrorMessage(e),
...(bundledDbSize ? { zipped_upload_size_bytes: bundledDbSize } : {}),
...(bundledDbSize !== undefined
? { zipped_upload_size_bytes: bundledDbSize }
: {}),
Comment on lines +148 to +150
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not equivalent to just

Suggested change
...(bundledDbSize !== undefined
? { zipped_upload_size_bytes: bundledDbSize }
: {}),
zipped_upload_size_bytes: bundledDbSize

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

➜  ~ node
Welcome to Node.js v25.2.1.
Type ".help" for more information.
> let x = {}
undefined
> x["a"] = undefined
undefined
> x
{ a: undefined }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but practically speaking there is not typically a difference in using an object with a key that has undefined as value vs a key that is absent. Asking for the value of the key gives undefined in both cases. The question is whether we care about the distinction that the key itself exists or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair. I'd prefer to leave this to the future and address it across the codebase.

});
}
}
Expand Down
Loading