ramda.github.io
ramda.github.io copied to clipboard
The ramdajs.com/docs/'s Filter input is not smart enough for filtering what I really want.
When searching o in Filter input of ramdajs.com/docs/, what I really want is R.o, but it is not on top of the result list. Can anyone optimize the filter algorithm?
Thanks for moving this issue. Looks like there is not much to the filter alg at the moment. It simply matches the input string vs. the list of functions, and hides any elements that do not match. This appears to be the code that does it:
https://github.com/ramda/ramda.github.io/blob/master/docs/main.js#L22
I'm actually working on some related stuff. I'll get to this at some point soon-ish
We can give each matched api with different weight using regex.
For example, each api's weight starts with 0, if api's name begins with input
characters, its weight +2; else if ends with input
characters, weight +1.
Then sort matched apis with weight and alphabetical order, weight first.