diff --git a/index.js b/index.js index f648719..43b1e50 100644 --- a/index.js +++ b/index.js @@ -170,7 +170,7 @@ const REPLACERS = [ // > "**/foo/bar" matches file or directory "bar" anywhere that is directly // > under directory "foo". // Notice that the '*'s have been replaced as '\\*' - /^\^*\\\*\\\*\\\//, + /^\^*(?:\\\*\\\*\\\/)+/, // '**/foo' <-> 'foo' () => '^(?:.*\\/)?' diff --git a/test/fixtures/cases.js b/test/fixtures/cases.js index 237fbc1..9f391d2 100644 --- a/test/fixtures/cases.js +++ b/test/fixtures/cases.js @@ -870,6 +870,18 @@ const cases = [ } ], + [ + 'consecutive leading "**/" behave as a single "**/"', + [ + '**/**/foo' + ], + { + 'foo': 1, + 'a/foo': 1, + 'a/b/foo': 1 + } + ], + [ '"**/foo/bar" matches file or directory "bar" anywhere that is directly under directory "foo"', [