Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@Mejari
Copy link

@Mejari Mejari commented May 15, 2013

I needed slightly different behavior so I thought I would option-ize it. I've set up an additional "options" object parameter on the 3 parse methods (with backwards compatibility for iniparser.parse callback). Also updated readme and added test for the single new option: treatEmptyStringsAsNull, which will, as the name suggests, set the value of parameters that have no direct value (which come in as an empty string) to null.

For example:

var_with_noValue=

Would come in when the flag is false (default) as:

{
     var_withNoValue: ''
}

and the same thing would come in when the flag is true as:

{
     var_withNoValue: null
}

It should be relatively easy to add new parameters in the future.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants