-
Notifications
You must be signed in to change notification settings - Fork 21
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
Create context select methods #27
Comments
I had the same request, so I'm glad there is an issue for it already. I also had a couple of other questions:
In a project I'm working on, I've created a util object to help with some common element selection operations that are not already included on an // searches the entire tree for the first occurrence of a type; this
// was useful for picking out array expressions that i knew only
// occurred once in a file. slow for large csts, but useful in my case.
function deepSearchForType(element, type) {}
// self-explanatory?
function findChildrenByType(element, type) {}
function findFirstChildOfType(element, type) {}
function findLastChildOfType(element, type) {} |
Looks inconsistent right? Heh, that's because we choose familiarity instead of consistency. Familiarity? You ask, yes Familiarity with DOM API. It also doesn't have
Nope, just we didn't had a need for it, could be okay addition though, could you create a ticket for this too?
Could you make it as standalone project first? Like https://github.com/Yeti-or/cst-helpers. Pretty sure that would be helpful! We need to realise what kind of API we should have. It seems we need a basics stuff first so people could augment on top of it. Like native Promises vs Bluebird or DOM API vs jQuery, kinda like that i think |
Thanks for the reply! I will definitely check that project out. When you say "create a ticket," do you mean to create a single issue with a single request (as opposed to this issue, which bundles several suggestions together)? |
Yeah, usually one bug/feature one ticket approach is easy to manage |
i.e so methods like
selectNodesByType
would be exist on other types of entities.Even though they can be slow, it could be terribly useful.
The text was updated successfully, but these errors were encountered: