Conversation
Codecov Report
@@ Coverage Diff @@
## master #38 +/- ##
=========================================
- Coverage 98% 97.4% -0.61%
=========================================
Files 3 3
Lines 201 154 -47
=========================================
- Hits 197 150 -47
Misses 4 4 |
|
Having though about it again in line with the comment here on the issue, I think this does make sense, but should be narrowed. A general "treat all strings as numbers if they pass On the other hand, if we limit it to just if someone tells searchjs to treat it as a number - we don't care why, they can declare it - then we have limited the scope and returned expected behaviour to user control. Let's do the following:
If we do that, then this all works well. |
deitch
left a comment
There was a problem hiding this comment.
Define a new modifier called _number which says, "treat this string field as number". Defaults to false, of course. If _number === true, then we treat the field as a number.
- Create the logic for this to limit the scope
- Update the README to reflect it
- Add tests to show it both not treating
"6.5"as a number if_numberis not set, and treating it as a number if_numberis set.
This fixes #37