krisk / Fuse

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

fix(typescript): `fieldNormWeight` should be optional, fixes #650 #648

Closed BenJenkinson closed 2 years ago

BenJenkinson commented 2 years ago

The fieldNormWeight config option has a default value of 1, and can therefore be optional (like the other config options)

https://github.com/krisk/Fuse/blob/a9e00804497a1bfd7a94040520417825c085c945/src/core/config.js#L58-L59

Related issues

Was this a regression?

huzaifahj commented 2 years ago

Created a duplicate pull request before finding this one. Agreed!

BenJenkinson commented 2 years ago

This would fix #650

KoltesDigital commented 2 years ago

Haha I was also too hurried.

I repeat here for the maintainers: FYI you may be interested in built-in Partial type to automatically flag all properties to be optional.

krisk commented 2 years ago

Fixed in latest.