From f3632ff2a37036172e23d864da26577c9383302f Mon Sep 17 00:00:00 2001 From: Josh Fleming Date: Thu, 5 Dec 2024 13:35:22 -0500 Subject: [PATCH] Fix bug where boolean false is treated as empty (#72) --- src/ax/dsp/prompt.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ax/dsp/prompt.ts b/src/ax/dsp/prompt.ts index 0be01a2..c21810e 100644 --- a/src/ax/dsp/prompt.ts +++ b/src/ax/dsp/prompt.ts @@ -416,6 +416,11 @@ const isEmptyValue = ( field: Readonly, value?: Readonly ) => { + // Boolean type can't be empty + if (typeof value === 'boolean') { + return false; + } + if ( !value || ((Array.isArray(value) || typeof value === 'string') && value.length === 0)