Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make type casting configurable #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tatablack
Copy link

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.

@gagle
Copy link
Owner

gagle commented Nov 2, 2014

Wow! Very good job. This was one of the things I had in mind.

@tatablack
Copy link
Author

Thanks.. 😉
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"... 😄

@tatablack
Copy link
Author

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.. 😄

@gagle
Copy link
Owner

gagle commented Apr 7, 2015

I'm doing the v2.0.0, I'll include this feature.

@eugef
Copy link

eugef commented Jul 6, 2016

Hi @gagle, any plans to merge this PR?

@jblievremont
Copy link

+1, this would really be useful (e.g when parsing a properties file that contains version numbers...)

@shrock-n-awe
Copy link

Any updates on this merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants