question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A new `is-empty` helper should be added

See original GitHub issue

This 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:closed
  • Created 8 years ago
  • Reactions:7
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
rwjbluecommented, Dec 22, 2015

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.

2reactions
cmackenzcommented, Apr 12, 2018

It would be nice if this also checked for empty objects {}

Ember.isEmpty returns false when checking {} so I had to create a helper that checked the length of my object’s key length. eg., Object.keys(myObject).length === 0 returns true.

or maybe it’s better to create a new helper is-empty-object

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found