-
Notifications
You must be signed in to change notification settings - Fork 115
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
Add base path of entry for objectMode #222
Conversation
/azp run benchmark.regression.object |
/azp run benchmark.regression |
Can you give me some idea how you will use this opportunity? |
@@ -9,7 +9,7 @@ export default class DeepFilter { | |||
const maxPatternDepth = this._getMaxPatternDepth(positive); | |||
const negativeRe = this._getNegativePatternsRe(negative); | |||
|
|||
return (entry) => this._filter(basePath, entry, negativeRe, maxPatternDepth); | |||
return (entry) => this._filter(basePath, entry as Entry, negativeRe, maxPatternDepth); |
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.
JFYI: When we use the type assertion mechanism we introduce unsafe code. For example, then inside this function we can refer to the base
property, which may not be accessible (undefined
).
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.
Yes I know, but if not so I have to change fsWalk.Entry
or DeepFilterFunction
.
I want to implement a function like
|
My current vision for the development of this package does not involve adding this field to |
What is the purpose of this pull request?
For
objectMode
the base path of entry should be return, otherwise we can't get the base path through the results.What changes did you make? (Give an overview)
base
property forEntry
basePath
param forEntryTransformer.getTransformer(basePath: string)