-
Notifications
You must be signed in to change notification settings - Fork 60
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
feat: add a transform
method
#122
Conversation
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.
as per the discord conversation, can you add a transform
argument to the filter function? or some other way of being able to transform before filtering at all
For simplicity's sake, I think supporting just one or the other is better. Based on your use cases transforming before the filtering makes more sense. Pushed the change and clarified that in the documentation. |
paths.push((directoryPath || ".").substring(root.length)); | ||
return function (directoryPath, paths, _filters, transformer) { | ||
const relativePath = (directoryPath || ".").substring(root.length); | ||
paths.push(transformer?.(relativePath, true) ?? relativePath); |
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.
optional chaining and ??
would sadly break compatibility with anything below node 14
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.
Oh my, got used to those features so much at work that I forgot they weren't supported at one point. Gonna change later.
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.
also pending the second argument change to a Dirent
, just leaving it here as a reminder, amazing work so far :-)
Hey, I really appreciate the effort but as I mentioned in #107, fdir isn't the right place for this. P.S. please discuss before implementing any feature to avoid situations like these. |
is there any place we can contact you outside github to discuss fdir related stuff? we've been discussing our fdir prs/issues in the e18e discord server which you might be interested in joining |
I think the discussion should happen under a GitHub issue as that keeps things more localized and easier to reference later on. With that said, let me know if you prefer something more...informal. I can create a discord server for fdir but to be honest, I don't think the world needs yet another discord server. There are already too many. 😂 |
Resolves #107.
The issue and the code say everything, really. 😄