micromatch / nanomatch

Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but without support for extended globs (extglobs), posix brackets or braces, and with complete Bash 4.3 wildcard support: ("*", "**", and "?").
https://github.com/micromatch
MIT License
95 stars 20 forks source link

MICROMATCH-140: check for consistency with the end of word #17

Closed mrmlnc closed 5 years ago

mrmlnc commented 5 years ago

Description

This is not a complete fix for https://github.com/micromatch/micromatch/issues/140.

Now we check that the word ends without additional characters.

Without this fix

const fixtures = [
  // Correct
  'some/file.md',
  'some/nested/file.md',
  'some_with_magic/file.md',
  'some1/file.md'
];

nm(fixtures, '**/some/**/file.md', ['some/file.md', 'some/nested/file.md', 'some_with_magic/file.md', 'some1/file.md']); // OK

With this fix

const fixtures = [
  // Correct
  'some/file.md',
  'some/nested/file.md',

  // Broken
  'some_with_magic/file.md',
  'some1/file.md'
];

nm(fixtures, '**/some/**/file.md', ['some/file.md', 'some/nested/file.md']); // OK

Bug Fix

jonschlinkert commented 5 years ago

Nice! Thanks!

I can take care of the readme updates, etc.

this is done automatically by our documentation tool.

If you want to merge and publish, I can make sure you're added to NPM. Or I can do it, whatever works for you. (and I can take care of readme updates etc either way)

mrmlnc commented 5 years ago

I added myself to the package.json file.