How to properly check the menu for emptiness in twig? I use Simplify Menu to display the necessary menu markup. How do I make sure that the menu is not empty (there are items there) and if there are menu items, they are enabled?
{% set items = simplify_menu('main') %}
  &lt;ul&gt;
    {% for menu_item in items.menu_tree %}
    &lt;li class=&quot;{{ item_class }} navigation__item&quot;&gt;
      &lt;a href=&quot;{{ menu_item.url }}&quot; class=&quot;{{ link_class }}&quot;&gt;{{ menu_item.text }}&lt;/a&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
{% endfor %}

In my work, I use the Twig tweak module, but I can't do a check with it either:
{% if drupal_menu('main') is empty %}
{% endif %}
This is tricky as you would expect {% if drupal_menu('main') is empty %} to work for checking if the menu exists or not. In reality, you'll want to use the render filter for twig. So that would become:
{% if drupal_menu('main') | render %}

I tested this code in my theme's page.html.twig file and it works. e.g.
{% if drupal_menu('main') | render %}
  {{ 'Main menu is not empty'|t }}
{% else %}
  {{ 'Main menu is empty'|t }}
{% endif %}

There is a very long winded issue here with regard to this:
[meta] Themes improperly check renderable arrays when determining visibility
There are also some related issues for this.

2447049: Add a render filter to twig
Checking for empty fields in Twig templates is complicated