Lib should error instead of stripping invalid characters
See original GitHub issueI found an issue where ‘123.sd’ is turned into ‘123.00’. I was expecting this to error out as it is not a valid currency value. Looking at the code I found the following test. Any insights of what is the logic of such functionality?
If the functionality has come valid case, would it be possible to have a flag that will make this case error out?
test('should strip invalid characters', t => {
var str = currency('a1b2c3');
t.is(parseFloat(str), 123, 'currency("a1b2c3") is 123');
});
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Character causes invalid character error · Issue #147 - GitHub
Providing a utility to strip the characters out would be an even worse option, as this would change the meaning of the data....
Read more >Stripping Invalid XML characters in Java - Stack Overflow
I used Xalan org.apache.xml.utils.XMLChar class: public static String stripInvalidXmlCharacters(String input) { StringBuilder sb = new ...
Read more >invalid characters - Constant Contact Community - 381042
If you're receiving that error, try removing spaces and any other non-alphanumeric symbols from your file's name before importing to the ...
Read more >8.25. Strip Invalid Characters from Filenames - O'Reilly
Strip Invalid Characters from Filenames Problem You want to strip a string of characters that aren't valid in Windows filenames.
Read more >How do I get rid of invalid characters error? - SAS Communities
It's going to be a character variable. Start by reducing proc report and removing half the character variables and running it. If it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ericvera I think a having
strictInput
orstrict
mode actually sounds reasonable. I need to think about what that means in relation toerrorOnInvalid
but that’s something that could potentially be released with a2.0
version of the library.it’s v2.0.4 as of now, shouldn’t this be implemented?