jstachio icon indicating copy to clipboard operation
jstachio copied to clipboard

Configuration to allow empty String to be falsey

Open agentgt opened this issue 2 years ago • 2 comments

JStachio assumes that only null strings can be falsey and not empty strings.

JMustache by default assumes similar but it is configurable.

I'm not sure what Mustache.java does but I assume it is similar by default and probably configurable.

For greenfield projects this feature is debatable. If one wants to test for empty strings one can make a custom Lambda.

However for existing projects or one migrating to javascript mustache templates this might be desirable.

agentgt avatar May 05 '23 14:05 agentgt

A more general pluggable falsey would be better. Closing for now.

agentgt avatar Aug 22 '23 23:08 agentgt

Regardless if we do make a more general pluggable falsey we need this feature distinctly separated out for ease of onboarding JMustache users. In JMustache the property is called: emptyStringIsFalse.

JMustache also has treat 0 as falsey as an option: zeroIsFalse.

agentgt avatar Jan 12 '24 17:01 agentgt