krisk / Fuse

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

JS error in FuseIndex:_addObject/isBlank #661

Closed codeflow-biz closed 2 years ago

codeflow-biz commented 2 years ago

Describe the bug

In FuseIndex.js:132 / _addObject function (the elseif condition if the code line has changed). If the "value" variable contains an (empty) object, the isBlank function is called and then a js error (value.trim() is not defined) is raised.

I guess the elseif condition should just be changed to "(isString(value) && !isBlank(value))" like it is a few rows above in the if block.

Version

latest (6.6.1)

🔬Minimal Reproduction

Goto https://choices-js.github.io/Choices/ and scroll down to the dropdown with "data-custom-properties" example.

krisk commented 2 years ago

Fixed in latest version.