Hi dorny,
Thanks for this package it helps greatly :)
I discovered the following unusual case, where ordering of the negated patterns seems to play a role.
test('negate all file patterns', () => {
const yaml = `
frontend:
- '!(amplify/**|data/**|deploy/**)**'
`
let filter = new Filter(yaml)
const files = modified(['data/jest.config.ts', 'amplify/backend/function/jest.config.ts', 'deploy/jest.config.ts' ])
const match = filter.match(files)
expect(match.frontend).toEqual([])
})
The above breaks, however if the pattern is shuffled where the amplify/** pattern is placed at the end then it works (I tried numerous combinations, in the middle doesn't work either).
Conclusion
Works:
- '!(deploy/**|data/**|amplify/**)**'
Doesn't Work
- '!(amplify/**|data/**|deploy/**)**'
Error

Hi dorny,
Thanks for this package it helps greatly :)
I discovered the following unusual case, where ordering of the negated patterns seems to play a role.
The above breaks, however if the pattern is shuffled where the
amplify/**pattern is placed at the end then it works (I tried numerous combinations, in the middle doesn't work either).Conclusion
Works:
- '!(deploy/**|data/**|amplify/**)**'Doesn't Work
- '!(amplify/**|data/**|deploy/**)**'Error