-
-
Notifications
You must be signed in to change notification settings - Fork 109
Add option to filter files #172
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
Conversation
mcollina
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
index.js
Outdated
| } | ||
| } | ||
|
|
||
| if (!allowedPath(pathname, options.root)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this check, it would be possible to skip the function declaration and the function call that returns true
| if (!allowedPath(pathname, options.root)) { | |
| if (allowedPath && !allowedPath(pathname, options.root)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
index.js
Outdated
| maxAge: opts.maxAge | ||
| } | ||
|
|
||
| const allowedPath = opts.allowedPath || allowAllPaths |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const allowedPath = opts.allowedPath || allowAllPaths | |
| const allowedPath = opts.allowedPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
mcollina
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Checklist
npm run testandnpm run benchmarkand the Code of conduct
Closes #145