fuzzy icon indicating copy to clipboard operation
fuzzy copied to clipboard

fuzzy should accept number values

Open samanpwbb opened this issue 9 years ago • 1 comments
trafficstars

It's common to filter lists with mixed-type data. fuzzy currently throws an error if you pass it a number value.

One workaround is to convert numbers to strings before passing values to fuzzy. The downside to this approach is that you have to throw out (sometimes essential) type information about your data. Ideally, fuzzy would handle both strings and numbers internally, return values that preserve the original type.

samanpwbb avatar Jul 01 '16 15:07 samanpwbb

Fix in Mapbox's fork: https://github.com/mapbox/fuzzy/pull/1 – @mattyork let me know if you'd like to have this – it introduces a breaking change: renames 'string' to 'val' in the returned objects.

samanpwbb avatar Jul 06 '16 19:07 samanpwbb