-
Notifications
You must be signed in to change notification settings - Fork 223
[Bulk Ops CLI] remove extra newline from bulk mutation variables #6788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ interface StageFileOptions { | |
| export async function stageFile(options: StageFileOptions): Promise<string> { | ||
| const {adminSession, variablesJsonl} = options | ||
|
|
||
| const buffer = Buffer.from(variablesJsonl ? `${variablesJsonl}\n` : '', 'utf-8') | ||
| const buffer = Buffer.from(variablesJsonl ?? '', 'utf-8') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did we add an extra
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question!! That is the nullish coalescing operator. Basically, I first removed the variablesJsonl ? variablesJsonl : ''This is a common pattern, and is of course equivalent to: variablesJsonl || ''
In this case the only falsy value you'll reasonably get here is I lean towards variablesJsonl ?? '' |
||
| const filename = 'bulk-variables.jsonl' | ||
| const size = buffer.length | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This empty string right here should've been a smoking gun indicating a bug before, but we all missed it in review!)