You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please describe the minimum necessary steps to reproduce this issue:
constmicromatch=require('micromatch');// version must be >= 4.0.1console.log(micromatch(['/test/t/'],['**/t/']));// [ '/test/t/' ]console.log(micromatch(['/test/t/'],['**/t']));// []constnm=require('nanomatch');console.log(nm(['/test/t/'],['**/t/']));// [ '/test/t/' ]console.log(nm(['/test/t/'],['**/t']));// [ '/test/t/' ]
What is happening:
micromatch takes into account the trailing slash and do an exact match nanomatch doesn't take it into account and match even without trailing slash in the pattern
What should be happening instead?
Both libraries should be aligned on this behaviour. From this previous issue on micromatch about trailing slashes, I believe we will want the fix to be done here in nanomatch.
Additional info
As micromatch switched from nanomatch to picomatch in v4.x (during this refactor), micromatch's behaviour has actually changed between v3.1.10 and v4.0.1. It was previously behaving like nanomatch.
Again, after reading the discussion about the trailing slashes linked above, I believe we want to keep its new behaviour, so an additional unit test could be added in micromatch to be sure to stay consistent in the future.
The text was updated successfully, but these errors were encountered:
Oh, I assumed that because in the description it states to be "Similar to micromatch", and because they have been aligned until last week (as micromatch was depending on it, I imagine).
Also it's a matter of having consistent behaviours inside the lib itself actually. If I take an example similar to the one from the linked discussion, I get this behaviour:
Please describe the minimum necessary steps to reproduce this issue:
What is happening:
micromatch
takes into account the trailing slash and do an exact matchnanomatch
doesn't take it into account and match even without trailing slash in the patternWhat should be happening instead?
Both libraries should be aligned on this behaviour. From this previous issue on micromatch about trailing slashes, I believe we will want the fix to be done here in nanomatch.
Additional info
As
micromatch
switched fromnanomatch
topicomatch
in v4.x (during this refactor),micromatch
's behaviour has actually changed betweenv3.1.10
andv4.0.1
. It was previously behaving likenanomatch
.Again, after reading the discussion about the trailing slashes linked above, I believe we want to keep its new behaviour, so an additional unit test could be added in micromatch to be sure to stay consistent in the future.
The text was updated successfully, but these errors were encountered: