Skip to content

Commit

Permalink
Recursive descent parser for extglob
Browse files Browse the repository at this point in the history
allowing correct support for arbitrarily nested extglob expressions, as
well as simplified regexps that properly bind the start/end in all
possible cases.

Fix: #202
Fix: isaacs/node-glob#516
  • Loading branch information
isaacs committed Apr 2, 2023
1 parent 8b073a1 commit b378dc8
Show file tree
Hide file tree
Showing 13 changed files with 11,778 additions and 1,171 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## 8.0

- Recursive descent parser for extglob, allowing correct support
for arbitrarily nested extglob expressions
- Bump required Node.js version

## 7.4
Expand Down
10 changes: 5 additions & 5 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
Expand Up @@ -59,7 +59,7 @@
},
"devDependencies": {
"@types/brace-expansion": "^1.1.0",
"@types/node": "^18.11.9",
"@types/node": "^18.15.11",
"@types/tap": "^15.0.7",
"c8": "^7.12.0",
"eslint-config-prettier": "^8.6.0",
Expand Down
12 changes: 12 additions & 0 deletions src/assert-valid-pattern.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const MAX_PATTERN_LENGTH = 1024 * 64
export const assertValidPattern: (pattern: any) => void = (
pattern: any
): asserts pattern is string => {
if (typeof pattern !== 'string') {
throw new TypeError('invalid pattern')
}

if (pattern.length > MAX_PATTERN_LENGTH) {
throw new TypeError('pattern is too long')
}
}
Loading

0 comments on commit b378dc8

Please sign in to comment.