Skip to content

Commit

Permalink
Fix bug where boolean false is treated as empty (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshvfleming authored Dec 5, 2024
1 parent 8cffe44 commit f3632ff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ax/dsp/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,11 @@ const isEmptyValue = (
field: Readonly<AxField>,
value?: Readonly<AxFieldValue>
) => {
// Boolean type can't be empty
if (typeof value === 'boolean') {
return false;
}

if (
!value ||
((Array.isArray(value) || typeof value === 'string') && value.length === 0)
Expand Down

0 comments on commit f3632ff

Please sign in to comment.