Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: isaacs/minimatch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.1.0
Choose a base ref
...
head repository: isaacs/minimatch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.1.1
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Jan 17, 2023

  1. Count closing parens when closing excess open parens

    Fix: isaacs/node-glob#415
    
    (Will backport to v5)
    isaacs committed Jan 17, 2023
    Copy the full SHA
    84092b2 View commit details
  2. 6.1.1

    isaacs committed Jan 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c80b476 View commit details
Showing with 25 additions and 4 deletions.
  1. +2 −2 package-lock.json
  2. +1 −1 package.json
  3. +2 −1 src/index.ts
  4. +4 −0 tap-snapshots/test/basic.js.test.cjs
  5. +16 −0 test/patterns.js
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
"name": "minimatch",
"description": "a glob matcher in javascript",
"version": "6.1.0",
"version": "6.1.1",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/minimatch.git"
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -907,7 +907,8 @@ export class Minimatch {
// Handle nested stuff like *(*.js|!(*.json)), where open parens
// mean that we should *not* include the ) in the bit that is considered
// "after" the negated section.
const openParensBefore = nlBefore.split('(').length - 1
const closeParensBefore = nlBefore.split(')').length
const openParensBefore = nlBefore.split('(').length - closeParensBefore
let cleanAfter = nlAfter
for (let i = 0; i < openParensBefore; i++) {
cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
4 changes: 4 additions & 0 deletions tap-snapshots/test/basic.js.test.cjs
Original file line number Diff line number Diff line change
@@ -109,6 +109,10 @@ exports[`test/basic.js TAP basic tests > makeRe *c*?** 1`] = `
/^(?:(?!\\.)(?=.)[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/
`

exports[`test/basic.js TAP basic tests > makeRe +(a)!(b)+(c) 1`] = `
/^(?:(?!\\.)(?=.)(?:a)+(?:(?!(?:b)(?:c)+)[^/]*?)(?:c)+)$/
`

exports[`test/basic.js TAP basic tests > makeRe +(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g 1`] = `
/^(?:(?=.)\\+\\(a\\|[^/]*?\\|c\\\\\\\\\\|d\\\\\\\\\\|e\\\\\\\\\\\\\\\\\\|f\\\\\\\\\\\\\\\\\\|g)$/
`
16 changes: 16 additions & 0 deletions test/patterns.js
Original file line number Diff line number Diff line change
@@ -311,6 +311,22 @@ module.exports = [
['[z\\-a]', []],
['[\\-\\]]', []],
['[a-b-c]', []],

// https://github.com/isaacs/node-glob/issues/415
() => {
files = [
'ac',
'abc',
'acd',
'acc',
'acd',
'adc',
'bbc',
'bac',
'bcc',
]
},
['+(a)!(b)+(c)', ['ac', 'acc', 'adc']],
]

Object.defineProperty(module.exports, 'files', {