fuzzy icon indicating copy to clipboard operation
fuzzy copied to clipboard

Startswith

Open DomSavd opened this issue 8 years ago • 3 comments

Hi,

Is it possible to match an exact text? For example, i want to retrieve the results for all value that as "thisvalue" but not the other resultats that contain these letter for example "this poor value".

Thanks!

DomSavd avatar Feb 01 '16 11:02 DomSavd

+1 I hope there is an adjustable parameter to define the fuzziness.

wuyuanyi135 avatar May 24 '16 07:05 wuyuanyi135

+1

wych42 avatar Jun 02 '16 05:06 wych42

Can you folks provide some examples you'd like to see implemented so I have a better understanding of what knobs to provide?

To get exact startsWith behavior, there is no need for this library. You can define your own function:

var filter = (arr, searchTerm) => arr.filter(str => str.indexOf(searchTerm) === 0);
filter(["abc", "zabc"], "ab")
// ["abc"]

mattyork avatar Sep 25 '16 18:09 mattyork