Comments (11)
or say we have this one
var patterns = [
'foo/**', // include all filepaths (files and folders)
'!foo/', // we dont want `foo/` in the list
'!foo/bar/', // and also dont want `foo/bar/`
'!foo/bar/*', // we dont want all files
'foo/bar/*.j*', // except that are .js and .json
];
results
[charlike@localhost glob-fs]$ node playing.js multimatch
[ 'foo/bar.js',
'foo/bar.md',
'foo/bar.txt',
'foo/bar.hbs',
'foo/bar.json',
'foo/bar.coffee',
'foo/bar/bar.js',
'foo/bar/bar.json' ] 8
[charlike@localhost glob-fs]$ node playing.js micromatch
[ 'foo/bar.js',
'foo/bar.md',
'foo/bar.txt',
'foo/bar.hbs',
'foo/bar.json',
'foo/bar.coffee' ] 6
[charlike@localhost glob-fs]$
from micromatch.
note there foo/bar/bar.json missing
This is exactly what I was talking about with "re-inclusion" patterns. You said: micromatch/glob-fs#1 (comment).
Now you know what I mean? This isn't a bug, I did the PR to multimatch that allows it to re-include patterns like that, I can do the same here. IMO, this is the expected result since you are removing it from the set. But maybe it makes more sense to re-include.
talking about that, can you answer me why is needed to ignore negate glob if it is first in given patterns?!
I have no idea, I agree. it makes no sense
edit: actually, I think the reason they did that is because they didn't have the correct logic to do inclusion/exclusion patterns, like what was implemented in multimatch and globby
from micromatch.
Initially I was thinking maybe we should change to what multimatch does, but I'm not sure that's correct. You can get the exact result you want with foo/bar/*.j*
, right? Why exclude everything first, then include that?
from micromatch.
also I'm almost ready to push up a first pass at glob-fs. I focused 100% on the correctness of resolving paths, so it's all sync atm. It will be easy to do async, promises, streams whatever once the basic path logic is down
from micromatch.
Hmm, right, clear. Yea, maybe make more sense to save this behaving and allow users to un-negate patterns in options, like not-documented ignore
option.
You can get the exact result you want with foo/bar/.j, right?
Yep, but you know ... testing, complexity, possible use cases and etc.
also I'm almost ready to push up a first pass at glob-fs.
Great! From you sync, from me streams, haha. Almost pass all gulp/glob-stream tests. lol
Benchmarks shows x22,000 faster than glob-stream and its normal. :) glob-stream is slowest thing that I ever seen, srsly. And tools from this chain glob-stream -> vinyl-fs -> gulp, verb, template, assemble are very slow natively, because the glob-stream and glob + minimatch.
But yea, you know that - for this reason we work on micromatch/glob-fs :)
from micromatch.
actually, I think the reason they did that is because they didn't have the correct logic to do inclusion/exclusion patterns, like what was implemented in multimatch and globby
mm, yea and for this reason we'll never pass 90-100% of gulp/glob-stream/vinyl-fs tests and they are very very weird and low quality. They not deserves 100%-coverage-badge LOL
Cant wait for you first shot 🎉
from micromatch.
@tunnckoCore was this resolved?
from micromatch.
I'll look after 10-20mins
from micromatch.
no prob, I don't know how long I'll last anyway, trying to keep my eyes open!
from micromatch.
@jonschlinkert okey, we can close and wait your push.
from micromatch.
k thx
from micromatch.
Related Issues (20)
- Can't match string with leading dot HOT 3
- extglob Denial of service HOT 4
- Non-filepaths matchs HOT 3
- SyntaxError: Invalid or unexpected token when running from Jest HOT 1
- 'Or' functionality broken (using |)
- Proper docs for windows option??
- Add a way to generate a glob from a file name HOT 1
- Basename breaks matching complex pattern HOT 2
- Will micromatch gradually phase out CJS support instead of abruptly (cf multimatch)? HOT 2
- Documentation incomplete for `scan`
- Alternatives in extglobs not matching correctly? HOT 5
- micromatch('.prettierrc.json', '**/*.json') => false HOT 3
- Image for sponsorships
- [BUG] Vulnerabilities Found in Micromatch and Braces HOT 2
- `micromatch.not` returns nothing if empty pattern list provided
- [BUG] Vulnerabilities Found in Micromatch and Braces HOT 38
- gitIgnore and negation patterns - not following gitIgnore specs HOT 5
- Question: Globstar and trailing slashes
- Inefficient Regular Expression Complexity vulnerability with High severity found HOT 6
- Negation style ignores dot option?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micromatch.