title: Validate if object is empty from values in an array - Javascript
body: <p>I have a data for businesses like below:</p>
  <pre><code>{
      &quot;business&quot;: {
          &quot;type&quot;: [
              &quot;LLC&quot;,
              &quot;Corporation&quot;
          ],
          &quot;LLC&quot;: {
              &quot;status&quot;: &quot;active&quot;,
              &quot;profits&quot;: 1000000,
              &quot;period&quot;: &quot;yearly&quot;
          },
          &quot;corporation&quot;: {},
          &quot;partnership&quot;: {}
      }
  }
  </code></pre>
  <p>How do I validate the &quot;corporation&quot; object, so if the &quot;type&quot; array contains the string &quot;Corporation&quot;, the &quot;corporation&quot; object cannot be empty?</p>
  <p>I've tried using validate.js to check if it is empty, it works but I can't specifically put the strings inside the type array to validate it.</p>
  <pre><code>const validate = require('validate.js');
  if (validate.isEmpty(business.LLC)) {
      return wrapper.error('fail', 'Object is empty');
  }
  </code></pre>
  <p>Thank you very much for the help </p>