-
Notifications
You must be signed in to change notification settings - Fork 6
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
[FEATURE] Introduce Readers "Filter" and "Transformer" #331
Conversation
2022096
to
b7a6080
Compare
b7a6080
to
93d5d24
Compare
93d5d24
to
a7403e4
Compare
a7403e4
to
b3993d8
Compare
Co-authored-by: KlattG <[email protected]>
lib/AbstractReader.js
Outdated
@@ -70,6 +70,14 @@ class AbstractReader { | |||
}); | |||
} | |||
|
|||
filter(callback) { | |||
const ReaderFilter = require("./ReaderFilter"); |
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.
Note: Cyclic dependency
This shouldn't cause any issues but we might also just use the "ReaderFilter" directly within ui5-builder.
This should make resource clone operations cheaper since the content doesn't need to be read and cloned immediately
@KlattG I think there's no further review necessary from your side. Thanks |
No major benefits since streams need to be drained into a buffer anyways. This reverts commit ecd7bd6.
… of instance We don't need more information anyways
@KlattG could you please have a look at the JSDoc in the following three files? Thanks!
|
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.
Not sure what the 'T' in Lines 80 & 96 of AbstractReader refers to, I expected some sort of description there.
lib/readers/Filter.js
Outdated
* @public | ||
* @callback module:@ui5/fs.readers.Filter~callback | ||
* @param {module:@ui5/fs.Resource} resource Resource to test | ||
* @returns {boolean} Return <code>true</code> to keep the resource, or <code>false</code> to disregard it |
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.
* @returns {boolean} Return <code>true</code> to keep the resource, or <code>false</code> to disregard it | |
* @returns {boolean} Whether to keep the resource |
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.
Thanks. Done
lib/AbstractReader.js
Outdated
* @public | ||
* @param {module:@ui5/fs.readers.Filter~callback} callback | ||
* Filter function. Will be called for every resource passed through this reader. | ||
* @returns {module:@ui5/fs.reader.Transformer} T |
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.
T = ?
... something missing here?
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
lib/AbstractReader.js
Outdated
* @public | ||
* @param {module:@ui5/fs.readers.Transformer~callback} callback | ||
* Callback to check and eventually transform any resource passed through the reader | ||
* @returns {module:@ui5/fs.reader.Transformer} T |
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.
see above
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
TODOs