title: Grunt Files Object Format: All regular files files immediately under top level directory
body: <p>I can't figure out for the life of me how to get this work. The grunt configuration for a module I'm using (<a href="https://www.npmjs.com/package/grunt-sloc" rel="nofollow noreferrer">grunt-sloc</a>) requires the <a href="http://gruntjs.com/configuring-tasks#files-object-format" rel="nofollow noreferrer">Files Object Format</a>. Using this, I want to be able to match all regular files (i.e., non-directories) immediately under the top level directory.</p>
  
  <p>For example, say this is my directory structure, where <code>+</code> signifies a directory and <code>-</code> signifies a regular file:</p>
  
  <pre><code>repo
    + dir
      - unwanted.js
    - server.js
  </code></pre>
  
  <p>How do I use Grunt's <a href="http://gruntjs.com/configuring-tasks#files-object-format" rel="nofollow noreferrer">Files Object Format</a> to match <code>server.js</code> but not <code>dir</code> or <code>dir/unwanted.js</code>?</p>
  
  <p>This is how it would look in the <a href="http://gruntjs.com/configuring-tasks#compact-format" rel="nofollow noreferrer">Compact Fomat</a>:</p>
  
  <pre><code>mine: {
    src: [
      '*'
    ]
  }
  </code></pre>
  
  <p>Or, in bash, you would get them like this:</p>
  
  <pre><code>ls -p | grep -v /;
  </code></pre>
  
  <p>Here's what I've tried with the <a href="http://gruntjs.com/configuring-tasks#files-object-format" rel="nofollow noreferrer">Files Object Format</a>:</p>
  
  <ul>
  <li><p>This does not work:</p>
  
  <pre><code>mine: {
    files: {
      '.': ['*']
    }
  }
  </code></pre></li>
  <li><p>Neither does this:</p>
  
  <pre><code>mine: {
    files: {
      './': ['*']
    }
  }
  </code></pre></li>
  <li><p>Not even this:</p>
  
  <pre><code>mine: {
    files: {
      './': ['*/server.js']
    }
  }
  </code></pre></li>
  <li><p>Nor this:</p>
  
  <pre><code>mine: {
    files: {
      './': ['server.js']
    }
  }
  </code></pre></li>
  <li><p>This works, but it runs recursively, which I do not want:</p>
  
  <pre><code>mine: {
    files: {
      './': ['**/server.js']
    }
  }
  </code></pre></li>
  </ul>
  
  <p>After doing a bunch of testing and code reading, I've verified that it is in fact the <a href="https://www.npmjs.com/package/minimatch" rel="nofollow noreferrer">minimatch</a> package (a depencency of Grunt), which is not returning the matches I'm looking for. So it is not the grunt module I am using; it's my grunt configuration.</p>
  
  <p>Since Grunt is so popular and this seems like a very common use case, I'm guessing that there's a way to do this. Does anyone know what that is?</p>
  
  <h3>Update</h3>
  
  <p>As <code>RobC</code> pointed out, my last example does <em>NOT</em> work. It was picking up <code>server.js</code>'s in my <code>node_modules</code> directory, which made me think it was working.</p>