node-properties
node-properties copied to clipboard
Make type casting configurable
I can see how the automatic casting of property values to JavaScript types might come in useful, but sometimes you really just want the literal value.
For my use case: I am reading a properties file containing mappings between file names and their SHA-1 hashes, truncated to 8 characters. Some of those hashes might look like numbers in exponential notation, say '90e02100', in which case having them cast to a Number is definitely not a good thing.
The same could be argued for numbers in octal or hex notation, I guess.
So, as per subject, I made this configurable, added the relevant tests and updated the Readme.
Wow! Very good job. This was one of the things I had in mind.
Thanks.. :wink: When I first noticed this, I scratched my head for quite some time, since what I saw was some of my file hashes turned into "Infinity"... :smile:
If all is in order, may I encourage you to proceed with the merge? I've been pointing my package.json to my fork for a while, but I'd rather point to a published module.. :smile:
I'm doing the v2.0.0, I'll include this feature.
Hi @gagle, any plans to merge this PR?
+1, this would really be useful (e.g when parsing a properties file that contains version numbers...)
Any updates on this merge?