antonmedv/finder

Browser version?

iapon opened this issue · 9 comments

iapon commented

Is there bundled browser version?

iapon commented

You can use https://unpkg.com/@medv/finder

Looks like it wants cssesc to work?
Also, did you want to add multi-selectors as input in the future(for getting the path for all of them)?

AA, no bundled version =)
You can add pr for bundled version if you want. For example I'll save it to releases page.
multi-selectors? What not just call finder a few times?

iapon commented

AA, no bundled version =)
You can add pr for bundled version if you want. For example I'll save it to releases page.
multi-selectors? What not just call finder a few times?

Sorry, I'm not so familiar with .ts, modules, bundling and etc.
About multi-selectors I mean, for example, we have div > table:nth-of-type(1) >tr and div > table:nth-of-type(2) >tr as input and wants to get output like this div > table > tr

ulshv commented

@iapon I just do selector.replace(/\:nth-of-type\(\d+\)/g, '')

If anyone interested in browser version: There are 2 of them:

Any idea how I go about getting a js file I can use in the browser from those two links?

@tomgallagher

npm install
npm run browser
<script src="{path}\browser.js"></script> from /dist

Now with v2 will be working!

<script type="module">
  import {finder} from 'https://medv.io/finder/finder.js'
</script>