From 3c25b1349f3d3be0b82565961eccde7aab489232 Mon Sep 17 00:00:00 2001
From: colemanw <coleman@civicrm.org>
Date: Wed, 30 Oct 2024 13:50:22 -0400
Subject: [PATCH] Api4Explorer - Render true/false as 1/0 in cli code

The cli interpreter doesn't do well with primitives like true/false rendered as strings,
better to use the integer equivalents.
---
 ang/api4Explorer/Explorer.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ang/api4Explorer/Explorer.js b/ang/api4Explorer/Explorer.js
index 46f5fabd0a5..c82ca109475 100644
--- a/ang/api4Explorer/Explorer.js
+++ b/ang/api4Explorer/Explorer.js
@@ -1065,6 +1065,7 @@
 
     // Format string to be cli-input-safe
     function cliFormat(str) {
+      str = str.replace(/\b(true|false)\b/g, match => match === "true" ? '1' : '0');
       if (!_.includes(str, ' ') && !_.includes(str, '"') && !_.includes(str, "'")) {
         return str;
       }
-- 
GitLab