Skip to content

Commit b8eadb1

Browse files
committed
fix: default to string if value is falsy and not 0
1 parent d82ee9b commit b8eadb1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/utility.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ function processOperators(element, value, exclude = []) {
5151
return value.replace(regex, (match) => {
5252
if (operatorsMap[match]) {
5353
console.log(`Replacing "${match}"`);
54-
55-
return operatorsMap[match](element) || ""; // Pass `element` explicitly
54+
let newValue = operatorsMap[match](element); // Pass `element` explicitly
55+
if (!newValue && newValue !== 0) {
56+
newValue = "";
57+
}
58+
return newValue;
5659
}
5760
// Log a warning with suggestions for valid operators
5861
console.warn(

0 commit comments

Comments
 (0)