title: How can I check if a string is empty including hard return?
body: <p>Currently I have a function that checks if a string is empty or not, but it does not detects if I there is a new line </p>
  
  <pre><code>export const isStrEmpty = function(text: string): boolean {
    return !text || text.match(/^ *$/) !== null;
  };
  </code></pre>
  
  <p>I tried adding <code>\n</code>, it doesn't work</p>
  
  <pre><code>export const isStrEmpty = function(text: string): boolean {
    return !text || text.match(/^ *\n$/) !== null;
  };
  </code></pre>
  
  <p>Is there a way I can make this function detects if there is a new line in the string?</p>