-
Notifications
You must be signed in to change notification settings - Fork 9
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
Check instructions length before setting option value #1196
Conversation
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.
great spot!
let option = "file"; | ||
if (instructions.length > 0) { | ||
option = "instructions"; | ||
} |
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.
you could make this a one liner again with
const option = instructions.length > 0 ? "instructions" : "file";
but happy with it either way 😄
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.
Approving as it's all fine, but added a suggestion which you can take or leave!
## What's Changed * Check instructions length before setting option value by @jamiebenstead in #1196 **Full Changelog**: v0.29.0...v0.29.1
closes
I found that
const option = instructions ? "instructions" : "file";
was always being set to true because it was receiving an empty array