A new `is-empty` helper should be added
See original GitHub issueThis should use the Ember.isEmpty
function, and consider changing truthConvert
to no longer be falsy for empty arrays. That’s not how JS works, and truth helpers aren’t block helpers. Consider encourage users to use (is-empty value)
or (not (is-empty value))
to check arrays. This change would require a semver major bump.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:7
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Objective-C isEmpty helper suddenly stopping build
It sounds like the problem is that some class(es) in the framework/library declares a -count method that returns something different than ...
Read more >ch.qos.logback.core.util.OptionHelper.isEmpty java ... - Tabnine
Search for value of DISABLE_SERVLET_CONTAINER_INITIALIZER_KEY in the web-app first, then as a system property and * as an environment variable last.
Read more >$A.util.isEmpty() returns true on non-empty proxies
The root cause of this issue is $A.util.isEmpty() not being able to handle the Proxy wrapping the DOMElement.
Read more >Helper class for trigger - Salesforce Developer Community
Hi, I am new to salesforce development. How to write helper class for below apex trigger. the handler class should have same logic....
Read more >Built-in Helpers - Handlebars
You can use the if helper to conditionally render a block. ... If the input is an empty JSONObject {} , then author...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think adding is-empty seems fine, but I’m not convinced that truthConvert should be changed. Frankly, the idea that this isn’t how JS works doesn’t really hold much sway to me. HBS is not JS, and Ember fundamentally considers empty arrays as falsey in HBS.
It would be nice if this also checked for empty objects
{}
Ember.isEmpty
returnsfalse
when checking{}
so I had to create a helper that checked the length of myobject
’s key length. eg.,Object.keys(myObject).length === 0
returnstrue
.or maybe it’s better to create a new helper
is-empty-object