krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
17.79k stars 756 forks source link

Value.trim() is not a function #583

Closed sandeepbojan closed 2 years ago

sandeepbojan commented 2 years ago

I am using the nested object search and I am receiving Value.trim() is not a function error. Could you please help me, why would this error occur

dditlev commented 2 years ago

I had the same problem, but I found this small hint in the docs "The path has to eventually point to a string, otherwise you will not get any results." In the objects (docs) you want to index, you cannot pass values that are not strings, as fuse is trying to trim all the values (removing whitespace from strings). I accidentally passed a doc with a value that was an object. Hope this helps

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days