Does String match glob pattern
<p>I have an array of paths, let's say:</p>

<pre><code>/Users/alansouza/workspace/project/src/js/components/chart/Graph.js
</code></pre>

<p>Also I have an entry in a configuration file with additional attributes for this path in a wildcard(glob) format, as in:</p>

<pre><code>{
  '**/*.js': {
    runBabel: true
  }
}
</code></pre>

<p><strong>Question</strong>: Is there an easy way to validate if the path matches the wildcard expression?</p>

<p>For example:</p>

<pre><code>const matches = Glob.matches(
  '**/*.js',
  '/Users/alansouza/workspace/project/src/js/components/chart/Graph.js'
);

if (matches) {
  //do something
}
</code></pre>

<p>FYI: I'm using <a href="https://github.com/isaacs/node-glob" rel="noreferrer">https://github.com/isaacs/node-glob</a></p>