-
-
Notifications
You must be signed in to change notification settings - Fork 22
Add unist-util-flat-filter to list of utilities
#26
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
Nice, thanks! Could you publish the code on GitHub as well, so people can collaborate on it?
And also: you should use is.convert a) if you are also passing in index and parent, and b) reusing it, with this setup is is better.
@wooorm Oh goodness! I have no idea why my index.js file was not included in git commits! 😱 I'll be sure to push that. I am using is.convert, however
The index.js and index.test.js files have been added to the repo. Sorry once again, t'was an autogenerated gitignore that I forgot about
Sweet!
I am using is.convert, however
Right! What I meant was that, the way you are using is.convert currently, it’s better to use is.
If you want to use is.convert, you should a) convert it in flatFilter, b) pass the new converted function into flatFilterGeneric, and c) make sure that that converted functions get node, index, parent when called.
a) and b) would make it more performant, c) would make sure the user-provided test works exactly the same in your project as all other unist utilities
unist-util-flat-filter to list of utilities (追記ここまで)
Oh, I understand better now! I'll be sure to follow up in the library to include the changes as you mentioned. Thanks for the review! 😁
Sweet! Thanks & congrats on your first unist utility! ✨
I found that the
filterplugin did not have the functionality I was hoping for, so I created my own plugin complete with tests and published tonpm. I added it to the README for discoverability