I have an array of paths, let's say:
/Users/alansouza/workspace/project/src/js/components/chart/Graph.js
Also I have an entry in a configuration file with additional attributes for this path in a wildcard(glob) format, as in:
{
'**/*.js': {
runBabel: true
}
}
Question: Is there an easy way to validate if the path matches the wildcard expression?
For example:
const matches = Glob.matches(
'**/*.js',
'/Users/alansouza/workspace/project/src/js/components/chart/Graph.js'
);
if (matches) {
//do something
}
FYI: I'm using https://github.com/isaacs/node-glob