Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

baseNameMatch works incorrectly #312

Closed
canonic-epicure opened this issue May 4, 2021 · 1 comment
Closed

baseNameMatch works incorrectly #312

canonic-epicure opened this issue May 4, 2021 · 1 comment
Milestone

Comments

@canonic-epicure
Copy link

Environment

  • OS Version: Ubuntu 18.04
  • Node.js Version: Node 12.22

According to the docs for the baseNameMatch option:

If set to true, then patterns without slashes will be matched against the basename of the path if it contains slashes.

This makes me think, that pattern with slashes are not affected by this option. However, check the following REPL session:

nickolay@frontier:~/workspace/Bryntum/siesta-monorepo/siesta$ node
Welcome to Node.js v12.22.1.
Type ".help" for more information.
> const fg = require('fast-glob')
undefined
> fg.sync('tests/**/hoo*.t.js', { })
[ 'tests/hook/hook.t.js' ]
> fg.sync('tests/**/hoo*.t.js', { baseNameMatch : true })
[]
> 

As you can see, the pattern with slashes is processed differently, depending on this option.

Note, that in the glob package, this option is processed correctly (there it is called matchBase):

> const glob = require('glob')
undefined
> glob.sync('tests/**/hoo*.t.js', { })
[ 'tests/hook/hook.t.js' ]
> glob.sync('tests/**/hoo*.t.js', { matchBase : true })
[ 'tests/hook/hook.t.js' ]
> 
@mrmlnc
Copy link
Owner

mrmlnc commented May 22, 2023

Fixed in the master by #399. Will be shipped with 3.3.0.

@mrmlnc mrmlnc closed this as completed May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants